Strict Trust Boundaries
Peer agents are opaque by design. A partner's billing or legal agent exposes skills and outputs—never its system prompts, internal chain-of-thought, memory store, or private API credentials.
Interoperability guide
How autonomous AI agents discover peers, delegate long-running tasks, and interoperate safely across frameworks and companies—covering A2A v1.0, MCP, AG-UI, and AGNTCY.
In 2026, open agent standards stopped competing and converged into complementary layers anchored under the Linux Foundation.
Production multi-agent systems cross four distinct boundaries: talking to a user frontend, delegating work to an external peer agent, invoking private tools and databases, and resolving identity and directories across organizations.
Rather than one monolithic spec, the ecosystem converged on four open standards—with IBM's ACP (Agent Communication Protocol) formally merging into A2A in August 2025 under the Linux Foundation.
Lets independent, opaque agents discover each other via Agent Cards and collaborate on long-running Tasks with typed Artifacts across frameworks, clouds, and company boundaries.
{
"jsonrpc": "2.0",
"id": "req-102",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [{ "kind": "text", "text": "Audit GPU spend anomaly for Oct–Nov 2026" }]
}
}
}| Protocol / Standard | Boundary | Governance | Wire Format & Transport | Discovery |
|---|---|---|---|---|
| A2A v1.0 (incl. ACP) | Agent ↔ Peer Agent | Linux Foundation (AAIF) | JSON-RPC 2.0, gRPC, or HTTP+JSON REST (+ SSE & webhooks) | /.well-known/agent-card.json |
| MCP | Agent ↔ Tools & Data | Linux Foundation (AAIF) | JSON-RPC 2.0 over stdio or Streamable HTTP | tools/list, resources/list, MCP Registry |
| AG-UI | Agent ↔ Frontend UI | Open-source community | Typed event stream over HTTP SSE / WebSockets | Frontend client bindings |
| AGNTCY | Control Plane / Ops | Linux Foundation (ex-Cisco) | Interoperable directory, identity & routing over A2A + MCP | Federated Agent Directory + DIDs |
| ANP & x402 / AP2 | Open Web P2P & Payments | Open community / Web | JSON-LD + DIDs (ANP); HTTP 402 payment headers (x402) | W3C Decentralized Identifiers |
Why calling another autonomous agent is fundamentally different from calling a stateless function or MCP tool.
Peer agents are opaque by design. A partner's billing or legal agent exposes skills and outputs—never its system prompts, internal chain-of-thought, memory store, or private API credentials.
Unlike a 100 ms database lookup, delegated agent work can take minutes, pause for human confirmation (input-required), or request secondary OAuth consent (auth-required).
An agent built with Google ADK, LangGraph, CrewAI, or OpenAI Agents SDK can delegate tasks to enterprise SaaS agents (ServiceNow, Salesforce, SAP) over one canonical schema.
Every A2A peer advertises its identity, skills, MIME modalities, and authentication contract at a standard well-known JSON endpoint.
Click any section on the right to inspect what a host orchestrator validates before sending its first Task to a remote agent.
{
"protocolVersion": "1.0",
"name": "FinOps Billing Specialist",
"description": "Audits cloud GPU spend, detects invoice anomalies, and produces reconciliation reports.",
"url": "https://billing.acme.example/a2a",
"provider": { "organization": "Acme FinOps", "url": "https://acme.example" },
"capabilities": {
"streaming": true,
"pushNotifications": true,
"stateTransitionHistory": true
},
"securitySchemes": {
"oauth2": {
"type": "oauth2",
"flows": {
"clientCredentials": {
"tokenUrl": "https://auth.acme.example/oauth/token",
"scopes": { "billing:read": "Inspect invoices", "billing:report": "Generate audit artifacts" }
}
}
}
},
"security": [{ "oauth2": ["billing:read"] }],
"defaultInputModes": ["text/plain", "application/json"],
"defaultOutputModes": ["application/json", "text/markdown"],
"skills": [
{
"id": "audit-gpu-spend",
"name": "Audit GPU Spend",
"description": "Compare billed GPU hours against cluster telemetry and flag overages.",
"tags": ["finops", "gpu", "reconciliation"],
"examples": ["Audit H100 spend for November 2026"]
}
]
}Keep public /.well-known/agent-card.json minimal for untrusted callers. After OAuth authentication, an enterprise peer can serve an extended card via agent/authenticatedExtendedCard exposing internal-only skills.
Defined canonically in a2a.proto so JSON-RPC 2.0, HTTP+JSON REST, and gRPC clients share identical semantics.
A single conversational turn (role: user | agent) carrying instructions, status notes, or clarification answers.
Typed content unit inside a Message or Artifact: text, structured JSON data, or binary/URI file.
The durable work record identified by taskId and contextId, progressing through a formal state machine.
The immutable deliverable produced by the remote agent—JSON tables, reports, code diffs, or charts—streamed in chunks or on completion.
The peer agent is actively executing (calling its own private MCP tools, querying databases, or running models) and streams incremental status updates.
data: {
"kind": "status-update",
"taskId": "task_9f42",
"status": {
"state": "working",
"message": { "role": "agent", "parts": [{ "kind": "text", "text": "Cross-checking 14,200 H100 GPU-hours via private MCP..." }] }
},
"final": false
}Three equivalent wire bindings (a2a.proto)
message/send, message/stream, tasks/get).Three interaction modes
message/stream pushes live status-update and artifact-update events over one connection.A concrete FinOps audit turn showing how AG-UI, A2A v1.0, and MCP collaborate without leaking credentials or duplicating glue code.
Operator asks the web console to audit November GPU overages.
Host agent reads billing peer's /.well-known/agent-card.json & OAuth scope.
Host sends message/stream with Bearer token and traceparent header.
Billing peer queries Postgres & Stripe via its own private MCP servers.
Peer streams audit JSON artifact over A2A; host renders chart via AG-UI.
| Architecture Need | Recommended Standard | Why |
|---|---|---|
| Sub-agents in one codebase / process | In-process graph (LangGraph, ADK, Swarm) | Zero network hop; share memory and typed state directly when one team owns everything. |
| Connect an LLM to DBs, Git, APIs, files | MCP | Stateless tool schemas, URI resources, and clear server-side credential isolation. |
| Delegate to remote / vendor / cross-team agents | A2A v1.0 | Opaque peers, Agent Card discovery, async Task state machine, and cross-org OAuth. |
| Stream progress, forms & approvals to users | AG-UI / MCP Apps | Typed frontend events, generative UI state sync, and human-in-the-loop interrupts. |
| Discover & verify agents across companies | AGNTCY (+ DIDs / x402) | Federated directory lookup, cryptographic agent identity, and machine-native billing. |
A complete Python 3.12+ peer exposing an Agent Card, SSE task streaming, caller-bound Task lookup, and an internal MCP tool boundary.
For production apps, you can also use the official a2a-sdk (Python) or @a2a-js/sdk (TypeScript)—the wire contract below is identical.
import hmac
import json
import os
import uuid
from dataclasses import dataclass
from fastapi import FastAPI, HTTPException, Request
from fastapi.responses import StreamingResponse
app = FastAPI(title="FinOps A2A Peer Agent")
A2A_BEARER_TOKEN = os.getenv("A2A_BEARER_TOKEN", "replace-in-prod")
@dataclass
class TaskRecord:
task_id: str
owner: str # Bound to verified caller identity — never trust Task ID alone
state: str
artifact: dict | None = None
TASKS: dict[str, TaskRecord] = {}
def verify_caller(request: Request) -> str:
"""Validate OAuth 2.1 / Bearer token from HTTP headers (never inside JSON payloads)."""
auth = request.headers.get("authorization", "")
if not auth.startswith("Bearer "):
raise HTTPException(status_code=401, detail="Missing Bearer token")
token = auth.split(" ", 1)[1]
if not hmac.compare_digest(token, A2A_BEARER_TOKEN):
raise HTTPException(status_code=401, detail="Invalid token")
return "svc:orchestrator" # In production, extract 'sub' from verified JWT
@app.get("/.well-known/agent-card.json")
async def agent_card():
return {
"protocolVersion": "1.0",
"name": "FinOps Billing Specialist",
"url": "https://billing.acme.example/a2a",
"capabilities": {"streaming": True, "pushNotifications": False},
"securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer"}},
"security": [{"bearerAuth": []}],
"skills": [{"id": "audit-gpu-spend", "name": "Audit GPU Spend"}],
}
async def run_private_mcp_audit(prompt: str) -> dict:
"""Internal tool call over private MCP — credentials never leave this agent."""
# In production: call self.mcp_session.call_tool("query_billing_ledger", {...})
return {"query": prompt, "billedUsd": 48200, "telemetryUsd": 44000, "deltaUsd": 4200}
@app.post("/a2a")
async def handle_a2a(request: Request):
caller = verify_caller(request)
body = await request.json()
method, req_id = body.get("method"), body.get("id")
params = body.get("params", {})
if method == "message/stream":
task_id = f"task_{uuid.uuid4().hex[:8]}"
TASKS[task_id] = TaskRecord(task_id=task_id, owner=caller, state="working")
prompt = params["message"]["parts"][0]["text"]
async def event_stream():
yield f"data: {json.dumps({'kind': 'status-update', 'taskId': task_id, 'status': {'state': 'working'}})}
"
report = await run_private_mcp_audit(prompt)
TASKS[task_id].state = "completed"
TASKS[task_id].artifact = report
yield f"data: {json.dumps({'kind': 'artifact-update', 'taskId': task_id, 'artifact': {'name': 'audit.json', 'parts': [{'kind': 'data', 'data': report}]}})}
"
yield f"data: {json.dumps({'kind': 'status-update', 'taskId': task_id, 'status': {'state': 'completed'}, 'final': True})}
"
return StreamingResponse(event_stream(), media_type="text/event-stream")
if method == "tasks/get":
task = TASKS.get(params.get("id", ""))
if not task or task.owner != caller:
raise HTTPException(status_code=404, detail="Task not found")
return {"jsonrpc": "2.0", "id": req_id, "result": {"id": task.task_id, "status": {"state": task.state}}}
raise HTTPException(status_code=400, detail=f"Unsupported method: {method}")Discovers the Agent Card, propagates a W3C traceparent for distributed tracing, and consumes streamed status & artifact frames:
import asyncio
import json
import os
import httpx
PEER_BASE = "http://localhost:8000"
TOKEN = os.getenv("A2A_BEARER_TOKEN", "replace-in-prod")
async def delegate_audit() -> None:
headers = {
"Authorization": f"Bearer {TOKEN}",
"traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
}
async with httpx.AsyncClient(timeout=30.0) as client:
# 1. Discover peer capabilities via /.well-known/agent-card.json
card = (await client.get(f"{PEER_BASE}/.well-known/agent-card.json")).json()
print(f"Discovered: {card['name']} (A2A {card['protocolVersion']})")
# 2. Stream a delegated Task via message/stream (SSE)
payload = {
"jsonrpc": "2.0",
"id": "req-1",
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [{"kind": "text", "text": "Audit H100 spend for November 2026"}],
}
},
}
async with client.stream("POST", f"{PEER_BASE}/a2a", headers=headers, json=payload) as resp:
resp.raise_for_status()
async for line in resp.aiter_lines():
if line.startswith("data: "):
event = json.loads(line[6:])
print(event["kind"], "->", event.get("status") or event.get("artifact"))
if __name__ == "__main__":
asyncio.run(delegate_audit())pip install fastapi uvicorn httpx
export A2A_BEARER_TOKEN="dev-secret-token"
# Terminal 1 — start A2A peer
uvicorn billing_a2a_agent:app --port 8000
# Terminal 2 — run orchestrator client
python orchestrator_client.pyConnecting autonomous agents across trust boundaries introduces threats that never existed in single-agent apps.
Identity, Auth & Isolation
taskId to the verified caller subject (task.owner == caller) to prevent cross-tenant task hijacking and confused-deputy attacks.Agentic Resilience & Guardrails
max_hops, dollar/token budgets, and strict deadlines across delegated tasks to stop infinite agent-to-agent ping-pong loops.traceparent headers across AG-UI → A2A → MCP so OpenTelemetry captures one unified waterfall across every agent.Primary specifications, Linux Foundation working groups, SDKs, and companion guides on StudioTV.
Core Specifications & Governance
a2a.protoUI Protocols, SDKs & Tooling