A2A Agent2Agent Protocol
A2A Agent2Agent Protocol
| 实践与版本边界: [[atlassian-rovo-a2a-live-card-and-enterprise-gates | Rovo 企业 A2A]] 的 2026-09-12 live Card version=1.0.0 但 protocolVersion=0.3.0,streaming 开而 push/history 关;本机只核验公开 GET 和 JSON,尚非鉴权 E2E。^[raw/articles/atlassian-rovo-a2a-live-card-and-enterprise-gates-2026-09-12.md] [[a2a-output-attestation-and-delegation-ancestry | A2A 输出/祖先取证]] 的 E12 作者回执使用 Card protocol 0.3、message/send 与 MCP Streamable HTTP;2026-09-11 核对 90 条输出 hash/字节长度,未重跑完整 verifier。子方签入父引用不等于父方授权,双签边也不证明内容安全或业务完成;两类证据都不能当 v1 conformance。^[raw/articles/a2a-output-attestation-and-delegation-ancestry-2026-09-11.md] |
| 实现验收: [[a2a-tck-conformance-coverage-and-security-boundaries | 官方 A2A TCK]] 以固定 spec/commit、Agent Card 接口和 task/push tests 连接协议与可执行断言;必须区分不适用、未实现、前置失败与通过。SDK #786 的 task ownership 指控已被后续评论限定为旧 0.3 缺口,不能按旧标题认定当前 1.0 仍缺授权。^[raw/articles/a2a-tck-conformance-coverage-and-security-boundaries-2026-09-10.md] |
定义
A2A(Agent2Agent Protocol)是面向 agent-to-agent collaboration 的开放协议:它让不同框架、不同供应商、不同组织拥有的 agent 能以统一方式发现彼此、声明能力、协商交互、管理共享任务、交换对话上下文和复杂数据。
| 和 [[MCP-Gateway-Runtime | MCP Gateway Runtime]] 的关系不是替代,而是分层互补:MCP 主要解决 agent 如何调用工具、API、数据库、文件、prompt/resource 等“能力原语”;A2A 主要解决一个 agent 如何把更复杂、状态更长、需要协商的任务委托给另一个 agent。 |
A2A and MCP 的边界判断
官方 A2A and MCP 文档给出的核心分界是:
- MCP domain:tools and resources。对象通常是输入/输出清晰、能力边界明确、偏 stateless 的工具或资源,例如数据库查询、天气 API、车辆诊断工具、repair manual database。
- A2A domain:agents。对象是更自治的系统,能推理、规划、调用多个工具、维护更长状态,并通过多轮对话完成开放任务。
因此一个生产级 agentic system 常见形态是:
用户 / 上游 agent
→ A2A 请求某个 specialist agent 处理复杂任务
→ specialist agent 内部用 MCP 调用工具、资源、API
→ A2A 返回任务状态、消息、artifact 或后续协商
这对我们的架构边界很重要:不要把所有 agent 都包装成 MCP tool。若对象本质上需要多轮协商、长期任务状态、异步更新、artifact 产出或自有工具链,就更适合暴露为 A2A agent;若对象只是稳定函数/资源访问,则更适合 MCP tool。
关键对象
Agent Card
A2A 通过 Agent Card 做 agent self-description。它相当于远程 agent 的“业务名片”,描述:
- identity:name、description、provider;
- service endpoint:A2A 服务 URL;
- capabilities:例如 streaming、pushNotifications;
- authentication:Bearer、OAuth2 等认证要求;
- skills:通过 AgentSkill 描述任务能力,包括 id、name、description、inputModes、outputModes、examples。
对 Context-Engineering 来说,Agent Card 是 agent collaboration 的上下文 manifest:它决定上游 agent 知道哪些远程 agent 可用、每个 agent 能做什么、认证方式是什么、输出形态是什么。
Agent Discovery
A2A 的 discovery 重点是找到 Agent Card。官方文档列出三类路径:
- Well-Known URI:在
https://{agent-server-domain}/.well-known/agent-card.json暴露公开或域内可发现的 Agent Card。 - Curated Registry:企业或 marketplace 维护 agent card 目录,按 skill、tag、provider、capability 检索。
- Direct Configuration / Private Discovery:私有系统里通过配置文件、环境变量或专有 API 固定声明远程 agent。
对 MCP-Gateway-Runtime 来说,A2A discovery 会把 registry/control plane 从“工具目录”扩展成“agent 目录”:同一个 gateway/registry 可能需要同时管理 MCP tools、A2A agents、REST/gRPC endpoints,并按 identity、risk tier、workspace 和 policy 做选择性暴露。
协议能力
A2A 规范强调以下能力:
- JSON-RPC protocol binding;
- task lifecycle:send message、send streaming message、get/list/cancel task;
- messages 与 artifacts:artifact 可以是文档、图片、结构化数据等任务产物;
- streaming / Server-Sent Events:适合实时状态更新;
- push notifications:适合长任务或断连场景;
- authentication / authorization:Agent Card 声明认证要求,敏感 card 应做访问控制;
- async first:支持 long-running operations 与 human-in-the-loop。
这说明 A2A 更接近“任务协作协议”,而 MCP 更接近“能力调用协议”。
和 MCP / Agent Runtime / Gateway 主题簇的关系
A2A 应挂到 MCP-Gateway-Runtime 主题簇下,但它补的是另一个维度:
MCP Gateway / federation control plane
├── MCP:agent-to-tool / agent-to-resource
├── A2A:agent-to-agent delegation / collaboration
├── REST / gRPC:企业既有服务接口
├── Gateway / Registry:统一发现、路由、权限、审计、trace
└── Benchmark / Security:验证 runtime 是否可靠
| [[ibm-contextforge-mcp-federation-control-plane | IBM ContextForge]] 已经体现了这个趋势:federation control plane 不只聚合 MCP server,也可能联邦 A2A、REST、gRPC 和 agent routing。A2A 让 gateway 的治理对象从“工具”扩展到“有自主性、状态和委托关系的 agent”。 |
对 Hermes / llm-wiki 的启发
- 工具不要冒充 agent,agent 也不要降级成普通工具。 如果远端系统需要多轮沟通、维护任务状态、产出 artifact、异步通知或自行调用工具,就应考虑 A2A,而不是把它压扁成一个 MCP function。
- Agent Card 应进入 tool/agent registry。 Hermes 如果未来管理多个 coding agent、研究 agent、发布 agent,应记录每个 agent 的 card、skill、auth、risk tier、owner、trace destination 和可委托边界。
- A2A 实践案例应成为雷达高优先级。 只讲协议定义价值有限,真正值得跟踪的是:谁在生产里用 Agent Card / Discovery / registry / task lifecycle 管理跨 agent delegation。
- Benchmark 需要区分 MCP tool use 和 A2A delegation。 Agent-Benchmarks 里应记录被测系统是否用了 A2A、委托了哪些 agent、远程 agent 是否 opaque、artifact/trace/receipt 是否可验证。
- 安全边界要升级。 A2A 的 blast radius 不只是工具误调用,还包括跨 agent 委托、能力发现泄漏、Agent Card 暴露敏感 skill、push notification webhook 滥用和 registry selective disclosure 失效。
失败模式 / 开放问题
- Agent Card 泄露内部 endpoint、敏感 skill 或认证要求。
- Curated registry 没有标准 API,企业实现可能碎片化。
- 把 A2A agent 包装成 MCP tool 后丢失协商、多轮、状态和异步能力。
- 上游 agent 过度信任远程 opaque agent 的自然语言报告,缺少 artifact receipt 或 verifier。
- A2A delegation 的责任归属、审计路径、成本预算和 human approval 边界不清。
- MCP gateway 与 A2A registry 合并后,工具权限和 agent 委托权限被混在一起,导致 policy surface 膨胀。
雷达关键词
后续 AI 知识点雷达应提高以下关键词优先级:
A2A protocolAgent CardAgent Discoveryagent-to-agent delegationmulti-agent interoperabilityA2A practical case studyA2A registryA2A MCP integration
更高优先关注 A2A 的实践案例:有真实 agent card、registry、task lifecycle、streaming/push、auth、trace、benchmark 或 enterprise deployment 证据的内容,优先级高于只介绍协议概念的新闻稿。
2026-09-03 补充:A2A Samples 作为实践入库门槛样本
| [[a2a-samples-agent-card-discovery-interoperability | A2A Samples]] 显示,A2A 实践案例的核心证据不是“项目声明支持 A2A”,而是是否真的有 host/client 读取 AgentCard、维护 remote agents、委托任务、处理 streaming/push/artifacts,并能解释远端 agent 内部是否继续调用 MCP/custom tools。 |
这也把 AgentCard 的安全属性前置:外部 agent 的 card、message、artifact、task status 都应视为 untrusted input。对 Hermes 来说,A2A discovery 进入上下文前应先有 card hash/version、owner/risk tier、sanitization verdict、allowed skills 和 trace destination;否则 AgentCard 会从“发现机制”变成 prompt-injection 供应链。
写入记录
- 2026-09-02 21:23 CST:基于 A2A 官方
A2A and MCP、What is A2A、Agent Discovery和 specification 文档新建概念页,明确 A2A 与 MCP 的架构边界,并挂入 MCP / Agent Runtime / Gateway 主题簇。
| - 2026-09-03 09:00 CST:补充 [[a2a-samples-agent-card-discovery-interoperability | A2A Samples]] 对实践入库门槛、AgentCard untrusted-input handling 和 A2A+MCP 组合形态的启发。 |
2026-09-03 补充:知识点雷达与自我优化入口
AI-Knowledge-Point-Radar 已把 A2A protocol、Agent Card、Agent Discovery、agent-to-agent delegation 和 multi-agent interoperability 设为高优先级雷达关键词;后续新增 A2A 实践案例应反链到本页。
写入记录
- 2026-09-03 21:00 CST:加强与 AI-Knowledge-Point-Radar、LLM-Wiki-Optimization-Log 的 wikilink 串联,统一从知识点价值和机制闭环维护本页。
2026-09-05 补充:Agent Discovery 之后需要 certification / trust directory
| [[a2apex-agent-card-certification-directory | A2Apex]] 补充了 A2A 实践链路中的 trust directory 形态:读取 Agent Card 只是 discovery 的第一步;生产 registry 还需要 schema compliance、live JSON-RPC endpoint testing、auth scheme validation、test history、public profile、badge/trust score 等可复核信号。 |
这强化了本页对 Agent Card 的判断:Agent Card 是 untrusted self-description,不是可信证书。Hermes 若未来接入 A2A agents,应把 card_hash、last_verified_at、endpoint_probe_result、auth_verdict、allowed_skills、risk_tier 和 trace_destination 作为 registry 字段,并把 directory/trust score 的来源和测试方法记录下来。
写入记录
- 2026-09-05 09:00 CST:补充 A2Apex 对 Agent Card certification、live endpoint testing、trust directory 和 registry poisoning 风险的启发。
2026-09-06 补充:Agent Card 进入 runtime planner 后才算可执行能力
| [[agentmesh-runtime-gateway-task-envelope-sandboxclaim | AgentMesh Runtime Gateway]] 的 AgentCard 用法提醒:A2A 的 Agent Card / Discovery 不能只停留在公开自述和目录层;进入生产 runtime 后,每个 agent card 都应转成可调度约束,包括 capability set、supported data level、estimated cost、runtime requirements、auth/trace owner 和 allowed delegation scope。 |
| 这让 [[a2apex-agent-card-certification-directory | A2Apex]] 的外部 certification 与内部 planner 形成闭环:外部目录验证 card 是否合规、在线、认证可用;内部 runtime 决定这个 agent 在当前 task envelope 中是否有权处理 restricted data、production mutation 或高成本任务。对 Hermes 来说,A2A registry 的字段应同时覆盖 discovery receipt 与 execution planning receipt。 |
写入记录
- 2026-09-06 09:00 CST:补充 AgentMesh 对 Agent Card 从 discovery manifest 升级为 runtime planner 约束的启发。
2026-09-07 补充:A2A 从 discovery 进入 task-state harness
| [[a2a-query-task-handle-approval-broker | a2a-query]] 补充了 A2A 进入产品/runtime 后的状态层:Agent Card 被解析和缓存只是开始;上游应用还需要 TaskHandle、task snapshot cache、poll/stream/resubscribe、artifact accessor、approval broker 与 devtools wire receipt,才能把远端 agent 的长任务可靠展示给用户或上游 agent。 |
| [[dsh-nacos-bridge-registry-to-harness-runtime | dsh-nacos-bridge]] 则补充了 discovery 到 runtime 的桥接层:A2A Agent Card 可以和 MCP server 一起从 Nacos AI Registry 被发现,并挂载到 dsh runtime。对 Hermes 来说,A2A registry 字段应分两组:一组证明 card 来源与 trust,一组证明 task lifecycle 能被 handle、resume、reconcile 和 audit。 |
写入记录
- 2026-09-07 09:00 CST:补充 dsh-nacos-bridge 与 a2a-query 对 A2A registry-to-runtime、TaskHandle、approval broker 和 task-state harness 的启发。
2026-09-08 补充:A2A reverse-proxy 是 enterprise delegation 的显式 operating mode
| [[agentic-community-mcp-gateway-registry-ai-asset-control-plane | MCP Gateway & Registry]] 的 A2A 文档把实践形态拆成 registry-only 与 reverse-proxy 两种模式:registry-only 只负责注册、发现和访问控制,agent 间随后直连;reverse-proxy 则让 gateway 代理 /.well-known/agent-card.json 与 JSON-RPC call,把真实 backend 存在 proxy_pass_url,对非管理员读 redacted,并要求调用方具备 invoke_agent grant。 |
这补强了本页的安全边界:A2A Agent Card 不只是 discovery manifest,也是可能进入 gateway 数据面的 routing contract。Hermes 若未来做 A2A 委托,应在 task receipt 里记录 operating mode、card_url/card_hash、advertised_url 是否被 gateway rewrite、gateway token 与 target-agent credential 如何分离、trace/audit 落在哪里。否则“发现了一个 agent”会被误当成“安全地委托给了一个 agent”。
写入记录
- 2026-09-08 09:01 CST:补充 MCP Gateway & Registry 的 A2A registry-only / reverse-proxy 双模式、Agent Card URL rewrite、
invoke_agentgate 与凭据分离对 Hermes A2A 委托 receipt 的启发。
2026-09-09 补充:v1.0 把 A2A 变成协议绑定与兼容性治理问题
| [[a2a-v1-protocol-binding-governance | A2A v1]] 让本页的判断从“Agent Card + JSON-RPC task lifecycle”升级到 protocol-binding governance:规范声明 spec/a2a.proto 是权威定义,文档/SDK/schema 都应从 proto 派生;同一 A2A application protocol 可以映射到 JSON-RPC、gRPC、HTTP+JSON/REST;Agent Card 通过 supportedInterfaces[] 按 interface 记录 URL、protocolBinding 与 protocolVersion。 |
对 Hermes 来说,A2A registry 不能只存 card_url 和 skills。后续 registry/task receipt 应增加:card hash/signature、supportedInterfaces、preferred binding、protocol version、v0.3 compatibility mode、extended card auth policy、extension requirements、A2A-Version/A2A-Extensions header、stream/push/resubscribe/list task conformance。这和 MCP-Gateway-Runtime 的资产控制面、Harness-Engineering 的委托合同、Agent-Benchmarks 的 conformance eval 直接相连。
写入记录
| - 2026-09-09 09:01 CST:补充 [[a2a-v1-protocol-binding-governance | A2A v1]] 对 AgentInterface、protocol binding、version negotiation、extended card、signature 与 compatibility receipt 的启发。 |
- 2026-09-10 09:11 CST:新增 TCK 覆盖分母与 SDK issue 版本边界入口,避免把协议声明/旧 issue 当当前运行证据。
- 2026-09-11 09:09 CST:新增具有作者逐任务数据的 A2A/MCP 双签取证案例入口,明确 0.3 版本、hash 核验与本机执行之间的边界。
- 2026-09-12 09:17 CST:加入 Rovo live Card 企业实践入口,区分服务/协议版本与公开发现/鉴权 E2E;不复制长篇 source。