Phase 2: Coordination & Agreement · ~75 minutes · Python (stdlib · `http.server` · `json`)
The Concept
The four elements
Agent Card. A JSON document at /.well-known/agent-card.json describing the agent: name, skills, supportedInterfaces (endpoint URL, protocol binding, protocol version), default input and output media types, and auth requirements (securitySchemes plus securityRequirements). Discovery happens by reading the card.
GET /.well-known/agent-card.json HTTP/1.1
Host: agent.example.com
{
"name": "code-review-agent",
"description": "Reviews Python and TypeScript code.",
"version": "1.0.0",
"supportedInterfaces": [
{
"url": "https://agent.example.com",
"protocolBinding": "HTTP+JSON",
"protocolVersion": "1.0"
}
],
"capabilities": {"streaming": false, "pushNotifications": false},
"securitySchemes": {
"bearer": {"httpAuthSecurityScheme": {"scheme": "Bearer"}}
},
"securityRequirements": [{"schemes": {"bearer": {"list": []}}}],
"defaultInputModes": ["text/plain", "application/json"],
"defaultOutputModes": ["application/json"],
"skills": [
{
"id": "review-python",
"name": "Review Python",
"description": "Reviews Python code.",
"tags": ["code-review", "python"]
},
{
"id": "review-typescript",
"name": "Review TypeScript",
"description": "Reviews TypeScript code.",
"tags": ["code-review", "typescript"]
}
]
}
Task. The unit of work. An async, stateful object with a lifecycle: TASK_STATE_SUBMITTED → TASK_STATE_WORKING → TASK_STATE_COMPLETED / TASK_STATE_FAILED / TASK_STATE_CANCELED. A client sends a message, the server creates the task, and the client polls or subscribes for updates.
Artifact. The result type produced by a task. Text, structured JSON, image, video, audio. Artifacts are typed: each part carries one of text, raw, url, or data and can name its mediaType, so different modalities are first-class.
Opaque lifecycle. A2A does not prescribe how the remote agent solves the task. The client sees state transitions and artifacts; the implementation is free to use any framework.
The MCP/A2A split
- MCP: agent ↔ tool. The agent reads/writes via JSON-RPC to a tool server. Stateless by default.
- A2A: agent ↔ agent. Peer protocol; both sides are agents with their own reasoning.
Production multi-agent systems use both. An A2A peer calls MCP tools on its side. The split keeps the two concerns clean.
Discovery flow
These are the HTTP+JSON binding routes, and every request carries A2A-Version: 1.0. By default SendMessage blocks until the task reaches a terminal or interrupted state, so a polling client sets configuration.returnImmediately to get the task back at once.
Or with streaming: POST /message:stream returns Server-Sent Events (a task first, then statusUpdate and artifactUpdate events), and /tasks/{id}:subscribe reattaches to a running task. The stream closes when the task reaches a terminal state; there is no final flag.
Auth
A2A supports three common patterns:
- Bearer token: OAuth2 or opaque (
httpAuthSecurityScheme or oauth2SecurityScheme). - mTLS: mutual TLS; organizations prove identity to each other (
mtlsSecurityScheme). - API key: a key in a header, query parameter, or cookie (
apiKeySecurityScheme).
Auth is declared in the Agent Card: securitySchemes names each scheme and securityRequirements says which ones a client must satisfy. Clients discover and comply.
150+ organizations by April 2026
Enterprise adoption drove A2A scale. The headline: A2A became the way enterprise agent systems cross trust boundaries. Google Cloud shipped Vertex AI Agent Builder A2A support; Microsoft Agent Framework supports it; most major frameworks (LangGraph, CrewAI, AutoGen) ship A2A adapters.
Where A2A wins
- Cross-organization calls. Agent at company A calls agent at company B. Without A2A, every pair is a bespoke contract.
- Heterogeneous frameworks. LangGraph agent calls CrewAI agent calls custom Python agent. A2A normalizes.
- Typed artifacts. Video result, structured JSON, audio — all first-class.
- Long-running tasks. Opaque lifecycle + polling makes hours-long tasks straightforward.
Where A2A struggles
- Latency-sensitive micro-calls. A2A's lifecycle is async. Sub-millisecond agent-to-agent does not fit; use direct RPC.
- Tight-coupled in-process agents. If both agents run in the same Python process, A2A's HTTP round-trip is overkill.
- Small teams. Spec overhead is real; internal-only agents may not need the formality.
A2A vs ACP, ANP, NLIP
Several related specs emerged in 2024-2026:
- ACP (IBM/Linux Foundation) — predecessor to A2A, narrower scope.
- ANP (Agent Network Protocol) — peer-discovery-heavy, decentralized-first.
- NLIP (Ecma Natural Language Interaction Protocol, standardized December 2025) — natural-language content type.
A2A is the most-adopted peer protocol as of April 2026. See arXiv:2505.02279 (Liu et al., "A Survey of Agent Interoperability Protocols") for the comparison.