Repository navigation
feat: Dedicated subagents via subAgent.agentRef over the A2A gateway (restores kagent#2952 API; completes #12 for declarative Agents) - #32
Open
pboers1988 wants to merge 2 commits into
Conversation
…(restores the kagent#2952 API deferred in kagent-dev#3007; SURF carry on planeo/v1.0.1) - api: restore SubAgentToolBinding.agentRef (exactly one of templateRef/agentRef, same namespace), CRDs regenerated. - translator: Dedicated bindings compile to ADK remote_agents pointing at the controller gateway (<controlPlaneUrl>/agents/<ns>/<agent>/.well-known/agent-card.json, 30m timeout, sessions not isolated); self-reference and agentRef inside a Shared child are rejected. - translator: kagent.surf.net/remote-agents annotation for external A2A servers (url entries only, egress origins added; controller origin and IP literals rejected). - runtimeauth: PeerDelegator also accepts an agentRef binding on the caller's own template as the peer declaration; planeo's kagent.planeo.dev/agent-refs keeps working. Upstream: kagent-dev#3642 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Boers <peter.boers@surf.nl>
… instead of granting egress The kagent.surf.net/remote-agents annotation only wires the remote-A2A tool. It no longer adds its origins to the compiled egress, which let anyone who can annotate an Agent open egress to any HTTP(S) origin. Compilation now fails with a validation error unless each external origin is granted by an EgressPolicy in the Agent's spec.egressPolicyRefs. Dedicated agentRef bindings are unchanged (controller origin already granted). ExternalRemoteAgents returns only the configs. The resolved policy origins reach Build through HarnessInput.EgressGrants; egress.Covers matches exact and leftmost-label wildcard origins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Boers <peter.boers@surf.nl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The planeo carry (#12,
kagent.planeo.dev/agent-refs) authorizes an actor to call a declared same-namespace peer through the A2A gateway. A declarative Agent still gets no tool to make that call: the translator never writesADKAgentConfig.remote_agents. The Go ADK reads the field (go/adk/pkg/agent/agent.go:106), but nothing ingo/coresets it.We checked this with a compile probe on
planeo/v1.0.1(af68fec). An inline Agent annotated withagent-refs: telemetry-agentcompiles to an agent config with onlymodel, description, instruction, stream, session_db_url. The same holds when the annotation is on the referenced AgentTemplate.This PR closes that gap by following upstream's own deferred API instead of adding a new one.
tools[].subAgent.agentRefexactly as kagent-dev#2952 shipped it before kagent-dev#3007 deferred it: exactly one oftemplateRef/agentRef, a same-namespaceLocalObjectReference, the same CEL rules and messages. CRDs regenerated.<controlPlaneUrl>/agents/<ns>/<agent>/.well-known/agent-card.json, with a 30m timeout andisolate_sessions: false. Self-reference is rejected. AnagentRefinside a Shared child template is rejected, because the delegator only reads the calling Agent's own template. Binding names are unique across Shared and Dedicated bindings.PeerDelegator.declaresalso accepts anagentRefbinding on the caller's own template (inline or referenced) as the declaration.kagent.planeo.dev/agent-refskeeps working unchanged.kagent.surf.net/remote-agentslists external A2A servers (URL entries only) that are not kagent Agents. It only wires the tool. The origin must be granted by an EgressPolicy inspec.egressPolicyRefs, otherwise compilation fails with a validation error. Controller-origin and IP-literal URLs are rejected. Happy to drop this part if you'd rather not carry it.Manifest shape:
Tests
CGO_ENABLED=0 go test ./api/... ./core/internal/translator/... ./core/internal/runtimeauth/... ./core/internal/a2agateway/... ./core/internal/egress/...passes, andgo vet ./core/... ./api/...is clean.go/core/internal/controllerfailuresTestRuntimeRevisionGC*andTestUnresolvedPoolReleasesAbandonedRevisionalso fail on unpatchedaf68fecd.Residual risk (not changed here)
The delegated call runs as the session owner's full user principal. A prompt-injected caller could therefore list, read and cancel the owner's other sessions on that peer, and the peer never opts in. We plan to harden this on our side with two changes:
We'd like to align with you on the shape (and on kagent-dev#3642) before sending it.
Refs: kagent-dev#3642, kagent-dev#2952, kagent-dev#3007, #12
🤖 Generated with Claude Code