fix(adk): stop embedding the system prompt in the pod agent card - #2843
TigerkidYang wants to merge 2 commits into
Conversation
EnrichAgentCard replaced the curated card's skills with adka2a.BuildAgentSkills, whose first skill joins the agent description with the full instruction. The pod's /.well-known/agent-card.json therefore exposed the system prompt to anyone who could discover the agent, and diverged from the curated card the controller serves. Keep the curated skills verbatim whenever the card carries a skills field (an explicit empty list means none). Only when the field is absent derive skills, and then from agent and sub-agent names and descriptions only, never from instructions. Delegation is unaffected: the remote A2A tools in both runtimes read only the card description. Fixes kagent-dev#2549 Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: MichaelRunchangYang <[email protected]>
supreme-gg-gg
left a comment
There was a problem hiding this comment.
The a2a-gateway now serves the public Agent Card from the pinned runtime revision and invokes the Actor directly over gRPC without discovering its card. I think we should we remove runtime skill enrichment instead of maintaining a custom deriveAgentSkills implementation. It appears unnecessary on this path and loses upstream support for workflow/custom agents and tool-derived skills. The compiler-generated card should remain authoritative.
|
|
||
| // deriveAgentSkills builds a skill list from the agent's own description and | ||
| // its sub-agents. It deliberately ignores instructions and tools: the former | ||
| // is the system prompt, the latter is already reachable through tool listing. |
There was a problem hiding this comment.
what's "tool listing"? I don't recall such a mechanism in A2A
There was a problem hiding this comment.
You are right, A2A has no such mechanism. The wording was inaccurate, and that code is gone now (see below).
Per review: the a2a-gateway serves the public card from the pinned runtime revision, so the compiler-generated card is authoritative and a custom skill derivation is not worth maintaining. EnrichAgentCard no longer touches skills; it only fills a missing description, the HITL extension and the default interface. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: MichaelRunchangYang <[email protected]>
|
Thanks @supreme-gg-gg, agreed. With the gateway serving the card from the pinned revision, the compiler-generated card should stay authoritative, and a custom The pod still serves |
Problem
The agent pod's
/.well-known/agent-card.jsonembeds the agent's entire system prompt:EnrichAgentCardunconditionally replaces the curated card'sskillswithadka2a.BuildAgentSkills(agent), and adk-go'sbuildDescriptionFromInstructionsjoins the agent description with the full instruction into the first skill's description. Anyone who can discover the agent can read how it is instructed to behave (fee policies, escalation rules, …), and the pod card diverges from the curated card the controller serves. The reporter re-confirmed this on 0.10.0 stable.Fix
EnrichAgentCardno longer touchesskillsat all. The compiler-generated card is authoritative (it is also what the a2a-gateway serves from the pinned runtime revision), so the pod card now carries exactly the skills the compiler put there and nothing built from the ADK agent. The function still fills a missing description, the HITL extension and the default interface.adka2ais no longer imported here.The pod still serves
/.well-known/agent-card.jsonto direct-to-pod callers (the reporter's agentgateway setup, and the 0.10.x line), which is where this closes the leak.Delegation is not affected: the remote-A2A tools in both runtimes (
go/adk/pkg/tools/remote_a2a_tool.go,kagent-adk/_remote_a2a_tool.py) read only the cardDescription, and the reporter confirmed empirically that routing between sub-agents never depended on skills.Tests
agentcard_test.go: an agent with an instruction and a sub-agent. A card without skills stays without skills and no instruction text reaches it; compiler-generated skills and description are kept verbatim; the description / HITL / default-interface enrichment still applies.go vet,go test -run TestEnrichAgentCard ./adk/pkg/a2a/andgo test ./adk/pkg/app/pass.Backport
The same function exists unchanged on
release/v0.10.x, where gateway-fronted callers hit the pod card directly; happy to open the backport once this lands.Fixes #2549
Prepared with Claude Code assistance; the diff was reviewed and the tests above were run locally before opening the PR.
🤖 Generated with Claude Code