feat: A2A (Agent2Agent) protocol support — Agent Card server + client tool - #52037
Closed
cardinalconseils wants to merge 1 commit into
Closed
feat: A2A (Agent2Agent) protocol support — Agent Card server + client tool#52037cardinalconseils wants to merge 1 commit into
cardinalconseils wants to merge 1 commit into
Conversation
… tool Tier 1 — Agent Card endpoint: - GET /.well-known/agent-card.json serves A2A-compliant Agent Card auto-generated from SOUL.md identity, installed skills, Hermes version, and auth config. Public, no auth required (standard discovery path). - POST /a2a JSON-RPC 2.0 endpoint accepts message/send, task/get, task/list, task/cancel. Routes through existing APIServerAdapter._run_agent, same code path as /v1/chat/completions. Returns A2A Task objects with Artifacts. Supports blocking and non-blocking modes. - Plugin hooks into API server via try/except import in connect() — never breaks startup if plugin is missing. - A2A endpoints advertised in /v1/capabilities. Tier 2 — A2A client tool: - a2a_send tool (delegation toolset) lets Hermes act as A2A client. Operations: discover (fetch Agent Card), send (send message/task), status (poll task), list (list tasks), cancel (cancel task). - Uses stdlib urllib only — no external dependencies. - Enables the failed payment scenario: Support Agent discovers a Fraud Agent's card, sends a task, receives a risk score artifact. Governance (config + existing features, no new code): - Agent identity: SOUL.md - Permissions: toolset restrictions + DELEGATE_BLOCKED_TOOLS - Auth: Bearer token reuse from API_SERVER_KEY - Auditability: session transcripts in state.db - No secrets in any A2A output (tested with 12 forbidden patterns) 38 tests pass (20 Agent Card/models, 18 client tool). Security gate clean. Spec: https://github.com/a2aproject/A2A
Collaborator
Related: #514 (the A2A feature request), #46241 (A2A server adapter approach), #41711 (consolidated single-plugin A2A approach). This PR takes a third approach — a plugin Agent Card server ( |
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.
Summary
Implements A2A (Agent2Agent) protocol support for Hermes Agent, enabling inter-agent collaboration with any A2A-compliant system (Google ADK, LangGraph, CrewAI, etc.).
MCP connects agents to tools. A2A connects agents to other agents.
Tier 1 — Agent Card Server (plugin)
message/send— create task, run agent, return Task with Artifactstask/get— get task status by IDtask/list— list recent taskstask/cancel— cancel a running taskAPIServerAdapter._run_agent()— same code path as/v1/chat/completions. Supports blocking and non-blocking modes.try/exceptimport inconnect()— never breaks startup if plugin is missing./v1/capabilities.Tier 2 — A2A Client Tool
discover— fetch and parse Agent Card from remote agentsend— send message/task to remote agent, receive structured artifactsstatus— poll task statuslist— list recent tasks on remote agentcancel— cancel a running taskurllibonly — no external dependencies.Governance (config + existing features, no new code)
Files
New files (7):
plugins/a2a/__init__.py— Plugin entry pointplugins/a2a/agent_card.py— Agent Card generation from SOUL.md + skills + configplugins/a2a/models.py— A2A data model (Task, Message, Part, Artifact) with lifecycleplugins/a2a/jsonrpc.py— JSON-RPC endpoint handlerstools/a2a_send_tool.py— A2A client tool (discover/send/status/list/cancel)tests/plugins/test_a2a.py— 20 unit teststests/tools/test_a2a_send.py— 18 unit testsModified files (2):
gateway/platforms/api_server.py— A2A route registration + capabilities advertisementtoolsets.py— a2a_send added to delegation toolsetTest Results
38 tests pass (20 Agent Card/models, 18 client tool). Security gate clean.
Security
Spec Reference
https://github.com/a2aproject/A2A/blob/main/docs/specification.md