Agent-to-agent protocols (A2A)
An open protocol (Google, Apr 2025; v1.0 Mar 2026; now in the Linux Foundation's Agentic AI Foundation) for agents from different vendors to discover each other through an Agent Card and delegate long-running tasks over HTTP. It complements MCP (agent-to-tool).
Analogy: Hiring a subcontractor: you read their public profile, send a work order, get status updates and questions, and receive deliverables, without ever seeing how their shop works inside.
How it works
- The Agent Card at
/.well-known/agent-card.jsonlists skills, interfaces, I/O modes and auth; it can be signed. - Long work becomes a task with a lifecycle (working, input-required, completed…) and returns artifacts.
- It runs over JSON-RPC, gRPC or REST; SSE streams progress and webhooks serve hours-long jobs.
- Agents stay opaque: no shared memory, prompts or tools, so treat a remote agent's output as untrusted.
- Each hop is a full LLM loop (seconds to minutes): keep delegation chains to 1–2 hops.
Check yourself
Answer to mark it learned; your answers aren't scored.
Your procurement agent delegates quotes to a supplier's A2A agent. Quotes take 2–40 minutes and the supplier sometimes asks "which warehouse?". Your client blocks on one synchronous HTTP call with a 30 s timeout and keeps failing. Best fix?
Go deeper
Full explanation
A2A (Agent2Agent) is an open protocol for agents from different teams or vendors to delegate work to each other. Google launched it in April 2025, donated it to the Linux Foundation in June 2025 (under its Agentic AI Foundation since Aug 2026) and shipped v1.0 on 12 Mar 2026.
How it works:
- Discovery: each agent publishes an Agent Card, JSON at
/.well-known/agent-card.jsonlisting skills,supportedInterfaces(URL, binding, version), input/output modes and auth schemes; cards can be signed (JWS). - Tasks: a client sends a message; longer work becomes a task with a lifecycle (submitted → working → input-required → completed/failed/canceled/rejected,
TASK_STATE_*on the wire). Results return as artifacts of parts (text, file, data). - Bindings: JSON-RPC 2.0 over HTTPS (
SendMessage,GetTask; pre-1.0message/send,tasks/get), gRPC and HTTP+JSON/REST; SSE streams progress; push notifications (webhooks) serve hours-long jobs. - Opacity: agents share no memory, prompts or tools; each is a black box behind a contract.
A2A vs MCP: Model Context Protocol (MCP) connects an agent down to tools and data, with the agent in control. A2A connects agents sideways as peers that negotiate, ask follow-ups and run long tasks. A remote A2A agent often uses MCP internally.
Reality check: A2A is younger and less adopted than MCP, every pre-1.0 release broke the wire format, and a remote agent's output is untrusted input. Inside one codebase, a function call or Pattern: orchestrator–workers beats a network protocol.
Code Discover a remote agent and delegate a task
import time, uuid
import httpx
AGENT = "https://agents.supplier.example" # another org's agent: treat as untrusted
HEADERS = {"A2A-Version": "1.0"} # required on every request since v1.0
def rpc(url: str, method: str, params: dict, token: str) -> dict:
body = {"jsonrpc": "2.0", "id": str(uuid.uuid4()), "method": method, "params": params}
r = httpx.post(url, json=body, headers={**HEADERS, "Authorization": f"Bearer {token}"}, timeout=30)
r.raise_for_status()
return r.json()["result"]
# 1) Discovery: the Agent Card lists skills, interfaces (url + binding), auth schemes
card = httpx.get(f"{AGENT}/.well-known/agent-card.json", headers=HEADERS).json()
assert any(s["id"] == "quote-bulk-order" for s in card["skills"])
url = next(i["url"] for i in card["supportedInterfaces"] if i["protocolBinding"] == "JSONRPC")
token = get_oauth_token(card["securitySchemes"]) # helper: your IdP + their scheme
# 2) Send work as a message; long work comes back as a Task with an id
res = rpc(url, "SendMessage", {"message": {
"role": "ROLE_USER", "messageId": str(uuid.uuid4()),
"parts": [{"text": "Quote 500 units of SKU 88-A, delivery by Dec 15"}], # no 'kind' since v1.0
}}, token)
task = res["task"] # a quick reply comes back as res["message"] instead
# 3) Track it (production: SendStreamingMessage over SSE, or a push-notification webhook)
while task["status"]["state"] in ("TASK_STATE_SUBMITTED", "TASK_STATE_WORKING"):
time.sleep(5)
task = rpc(url, "GetTask", {"id": task["id"]}, token)
if task["status"]["state"] == "TASK_STATE_INPUT_REQUIRED":
ask_human(task["status"].get("message")) # the remote agent needs more info
for art in task.get("artifacts", []): # outputs: text, files, structured data
handle(validate(art["parts"])) # untrusted input: schema-check firstReal example
A retailer's procurement agent needs bulk quotes from three suppliers, each running its own agent on a different framework and cloud. Without a standard: three bespoke APIs, three auth flows, three polling schemes. With A2A it reads each supplier's Agent Card, sends one SendMessage per supplier and gets three tasks back. One supplier answers input-required ("which warehouse?"), resolved in the same context. Quotes arrive as structured artifacts 2–40 minutes later via push notifications. The procurement agent never sees the suppliers' prompts or tools, and validates every artifact against a schema before a human approves the order.
Trade-offs +4 · −4
+ You gain
- Vendor-neutral: agents on different frameworks and clouds interoperate through one contract.
- Built for long-running, stateful work: task lifecycle, streaming, push notifications, input-required.
- Opaque by design: collaborate without exposing prompts, tools or internal data.
- Reuses standard web plumbing: HTTPS, OAuth/OIDC, API keys, mTLS.
− You pay
- Young and evolving: every pre-1.0 release renamed methods (
tasks/send→message/send→SendMessage); v1.0 (Mar 2026) is the first stable wire format. - Far less real adoption than MCP; many integrations are still demos.
- Each hop adds latency, cost and a trust boundary; debugging spans organizations.
- Cross-agent prompt injection: a remote agent's output can steer yours.
Use it when
Agents owned by different organizations or vendors that must delegate long-running, multi-turn work to each other: supplier networks, enterprise platforms (CRM agent ↔ ITSM agent), agent marketplaces.
Avoid it when
Agents inside one codebase or team: call them as functions or sub-agents. If the remote "agent" is really a stateless capability, expose it as an MCP tool; that is simpler and far better supported.
Numbers to know 4
- Launched Apr 2025 by Google with 50+ partners; to the Linux Foundation in Jun 2025 (founding members include AWS, Cisco, Microsoft, Salesforce, SAP, ServiceNow); under its Agentic AI Foundation since Aug 2026.
- Bindings: JSON-RPC 2.0, gRPC and HTTP+JSON over HTTPS, SSE streaming, webhook push; v0.3 (Jul 2025) added signed Agent Cards and the
agent-card.jsonpath. - v1.0 (12 Mar 2026): PascalCase operations (
SendMessage,GetTask, newListTasks),TASK_STATE_*enums, Parts withoutkind,supportedInterfacesreplacing the card'surl, mandatoryA2A-Versionheader. - Rule of thumb: each agent hop is a full LLM loop (seconds to minutes), so keep delegation chains to 1–2 hops.
Common pitfalls 4
- Using A2A between agents you own in one repo: a network protocol where a function call would do.
- Trusting an Agent Card at face value: anyone can publish one claiming any skill. Verify domain, signature and auth.
- Sending the remote agent your user's full context or credentials instead of the minimum the task needs.
- Blocking synchronously on long tasks instead of streaming or push notifications with timeouts.
Interview questions 2
Answer out loud first, then reveal.
MCP or A2A: do I need both?Show answer
They answer different questions. MCP is agent-to-tool: my agent discovers and calls functions and reads data, and stays in control. A2A is agent-to-agent: I delegate a goal to an autonomous peer that may take minutes, ask me follow-up questions and return artifacts, without exposing its internals. Most systems need only MCP today. I add A2A when I must delegate to an agent another organization or vendor owns. If the remote thing is really a stateless capability, I'd consume it as an MCP tool instead.
What security concerns does A2A raise?Show answer
Three trust boundaries. Identity: an Agent Card is just JSON at a URL, so I verify the domain, use signed cards where available and authenticate with OAuth or mTLS, never anonymously. Data: I send the minimum context the task needs, never my user's credentials, and I log what crossed the boundary. Output: the remote agent's messages and artifacts are untrusted input and a prompt-injection vector, so I schema-validate them and require human approval before they trigger side effects like payments.