Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Handbooks  /  A2A Agent Interop
Handbook~15 min readAgentsworked math + runnable code
The A2A Agent Interop Handbook

Agents that
call agents.

One team builds a research agent; another builds a coding agent; a third wants to combine them. Today that means bespoke glue for every pairing — a brittle integration written by hand. Agent-to-agent interop replaces the glue with a protocol: agents advertise what they can do so others can find them, and speak a shared format so one's output slots into another's input. It's the same move that turned isolated services into the web. Get the two agreements right — discovery and schema — and independent agents compose into an ecosystem. Here's how the handshake works.

01

From glue to protocol

As agents proliferate, the interesting systems are ones where agents use other agents — a coordinator delegating a sub-task to a specialist built by someone else. But if every pair of agents needs custom integration code, the effort grows with the number of pairs (the same quadratic wall that bites multi-agent systems), and nothing composes. The web solved this exact problem for services with shared protocols; A2A interop is the analogous move for agents.

The idea is to replace bespoke glue with two standard agreements. First, agents must be findable: each publishes what it can do, so another agent can discover a suitable partner without prior knowledge of it. Second, agents must be speakable-to: they share a message format, so one agent's output can be consumed directly by another. Discovery answers "who can do this?"; the shared schema answers "how do I talk to them?". Both are required — a capable agent you can't communicate with is as useless as a reachable one that can't do the task.

The one-sentence version

A2A interop needs two agreements — agents advertise capabilities so others can discover and route to them, and share a message schema so one agent's output chains into another's input.

02

Advertise and discover

The first half is capability discovery. Each agent publishes a capability card — a machine-readable description of its skills: what tasks it handles, what inputs it needs, what it returns. To delegate a task, a coordinator looks up the registry of cards, finds agents whose advertised skills include the required capability, and routes the task to one of them.

Discover, match, route
AdvertiseEach agent publishes a capability card — its skills and I/O.
MatchA task's required capability is looked up against advertised skills.
RouteSend the task to an agent that lists that capability.
No matchIf no agent advertises it, there's nowhere to route — fail explicitly.

The rule is crisp: an agent can handle a task if and only if the required capability appears in its advertised skills. So discovery is a lookup — scan the registry for agents that list the capability, and route to a capable one (or report that none exists). This decouples the caller from the callee: the coordinator doesn't need to know which agents exist ahead of time, only what capability it needs; new agents can join the registry and become usable without changing the caller. But finding the right agent is only half the handshake — you still have to be able to talk to it.

03

Speak the same language

The second half is a shared message schema. Discovery finds a capable agent, but delegation still fails if the two agents can't understand each other's messages. If agent A emits results in one format and agent B expects another, A's output can't feed B's input — the capability match is wasted. So A2A protocols standardize the message envelope: an agreed structure for requests, results, streaming updates, and errors.

With a shared schema, one agent's output is directly consumable as another's input, so tasks can chain across agents — research agent produces a report in the standard format, coding agent consumes it, and so on. This is the same discipline as structured outputs applied at the agent boundary: agree on the shape so machines can hand work to each other without a translator. The interop condition is simple and unforgiving — two agents can chain only if their schemas line up. Mismatch the versions or the format and the pipeline breaks even when every capability is present.

04

The interop rules

Capability discovery is set membership. An agent with advertised skills S can handle a task requiring capability c exactly when c ∈ S; discovery collects all such agents from the registry:

can_handle(S, c) = [ c ∈ S ]     discover(registry, c) = { a : c ∈ Sa }

Routing picks a member of that set; if it's empty, there's no agent for the task — fail explicitly rather than guessing.

But delegation succeeds only if both conditions hold — a capable partner and a compatible schema:

delegable(A→B)  =  ( c ∈ SB )  AND  ( schemaA.out = schemaB.in )

Capability without a shared schema can't chain; a shared schema without the capability has nothing to do. Both are necessary. The runnable version below discovers capable agents, routes a task, and checks schema compatibility.

RUN IT YOURSELF

Discover, route, chain

A2A interop is two lookups. Discovery scans a registry of capability cards and returns every agent whose advertised skills include the required capability; routing picks one, or reports none exists. That decouples the caller from the callee — it names a capability, not a specific agent. But delegation also needs a shared message schema: two agents can chain their output-to-input only if their schemas match, so a capability match with mismatched formats still fails. Change the registry, the required capability, or the schemas and watch routing and compatibility decide.

CPython · WebAssembly
05

The A2A stack

A working A2A protocol standardizes a handful of things so heterogeneous agents compose:

ElementWhat it standardizes
Capability cardHow an agent advertises its skills, inputs, and outputs so others can discover it.
Message envelopeThe shared schema for requests, results, streaming updates, and errors.
Task lifecycleHow a delegated task is created, tracked, streamed, and completed or cancelled.
Identity & authHow agents authenticate each other and authorize a delegation — trust across boundaries.
Discovery mechanismHow agents publish and find cards (a registry, a well-known endpoint).

A2A sits alongside MCP in the protocol picture: MCP standardizes the agent-to-tool interface (how an agent reaches a database or API), while A2A standardizes the agent-to-agent interface (how an agent delegates to a peer). An agent might use MCP to call a tool and A2A to hand a sub-task to another agent. Both share one philosophy — agree on discovery plus a message schema so independently-built components compose without custom glue. And the trust dimension is real: delegating to an agent you didn't build means authenticating it and bounding what it can do, so identity and authorization are first-class, not afterthoughts.

06

Pitfalls

The interop-specific trap is schema drift: two agents that once chained stop working when one updates its message format, silently. Version the schema and negotiate versions at connect time, so a mismatch is a clear error, not a corrupted payload. A close cousin is capability lies: an agent advertises a skill it does poorly (or maliciously), and discovery routes to it in good faith — so advertised capability is a claim to be verified, not trusted, with evals and reputation, not just the card.

Two more. Trust across boundaries: delegating to a third-party agent means its output flows back into your system and possibly your model's context — treat it as untrusted, authenticate the peer, and bound what a delegation can do (an agent you didn't build is a guardrail and sandbox concern). And over-federating: not every system needs an agent mesh — the coordination cost of many agents still applies, so reach for A2A when you genuinely want independently-built agents to compose, not to over-engineer a task one agent could do. Used where it fits, A2A turns a pile of bespoke integrations into an open ecosystem — the difference between wiring two agents together and letting any agent find and use any other.

Worth knowing

An advertised capability is a claim, not a guarantee — discovery routes on trust, so verify partners with evals and reputation, version schemas so drift is a clear error, and treat a third-party agent's output as untrusted (authenticate it, bound the delegation).

By the numbers

Worked example: research a bug, then fix it, step by step

A coordinator gets the task “find why checkout fails, then patch it”. It needs search first, then code. The registry holds four cards (illustrative): R1 skills {search, summarize}, outputs report-v1. C2 skills {code}, accepts report-v2. C1 skills {code, test}, accepts report-v1. L1 skills {contract-review}. Trace it with the page’s own functions.

StepCallWhat happensResult
1discover(reg, "search")Only R1 lists search[R1]
2route(reg, "search")First match; R1 runs and returns a report-v1R1
3discover(reg, "code")C2 and C1 both list code; registry order puts C2 first[C2, C1]
4route(reg, "code")First match is C2, chosen on capability aloneC2
5compatible("report-v1", "report-v2")R1’s output does not fit C2’s inputFalse: the chain breaks
6Filter step 3 by schema firstKeep agents where both conditions hold[C1]
7Delegate to C1R1’s report goes straight in; C1 returns a patchTask done
8route(reg, "draw")No card lists drawNone: fail out loud, don’t guess

Steps 4 and 5 are the bug the page’s delegable rule warns about. route picks on capability only, so the outcome depends on registry order. Add C2 to the registry a day later and a pipeline that worked starts failing, with no code change. The fix is to route on the full condition, capability and schema, as in step 6. If no agent passes both, report that, exactly as step 8 does for a missing capability.

Trade-offs

Cost and trade-offs: glue, lookups and hops

For a protocol, read Time as the work to build or run it and Space as what it grows with.

CaseTimeSpaceWhy
Bespoke glue, n agentsOne integration per pair: n(n−1)/210 agents: 45; 30 agents: 435Every new agent needs code for each agent it talks to. This is the quadratic wall.
Shared protocol, n agentsOne adapter per agent: n10 agents: 10; 30 agents: 30Each agent learns the protocol once, then reaches every other agent that speaks it.
Discovery as a scanO(R) per lookup over R cardsOne card per agentFine for dozens of agents. The page’s discover works this way.
Discovery by indexAbout O(1) per lookupAn entry per (capability, agent) pairMap each capability to its agents. You must update it when cards change.
Strict schema equalityOne string compareNothing extraSimple, but any version bump breaks every caller at once.
Negotiated versionsOne handshake per connectionBoth sides keep old versions aliveLets agents upgrade on their own schedule. Drift becomes a clear error.
A chain of k delegationsk network hops, each with auth and serialisationSuccess is the product: 0.95 per hop gives 0.86 at 3 hops and 0.77 at 5Each hop is a failure point. Keep chains short and retry each hop on its own.

The protocol turns a quadratic integration cost into a linear one. That is the whole case for A2A. The chain row is the case against using it everywhere: a task one agent could finish has no hops to fail.

In the wild

Where this shows up in production and interviews

  • The A2A protocol

    Google announced the Agent2Agent protocol in April 2025, and it is now a Linux Foundation project. It maps directly onto this page: an Agent Card is the capability card, messages are JSON-RPC 2.0 over HTTP, and long tasks stream progress with server-sent events.

  • Next to MCP

    A common split in one system: MCP connects each agent to its own tools and data, and A2A connects agents that different teams own. The coordinator from the worked example might reach the code repo over MCP and hand the patch work to C1 over A2A.

  • It is service discovery again

    Microservices solved the same two problems with a service registry and a published API schema. The lessons carry over: health-check the registry so dead agents drop out, version the contract, and never let the caller hard-code who answers.

  • The interview version

    In “design a multi-agent system across teams”, name the two agreements (discovery and schema), then go straight to trust. How is the peer authenticated? What can a delegated task touch? What happens to its output before it reaches your model? Treating peer output as untrusted is the answer interviewers listen for.

Self-check

Check yourself

A registry has 12 agents and a coordinator needs "translate". Three agents list it, but only one accepts your output schema. What should the router return?

That one agent. Discovery gives three candidates, but delegable needs capability and a matching schema. Picking the first of the three on capability alone works or fails depending on registry order, which is the bug in steps 4 and 5 of the worked example.

Your team runs 30 agents with hand-written glue between every pair. How many integrations is that, and how many adapters after moving to a shared protocol?

30 × 29 ÷ 2 = 435 integrations, against 30 adapters. The 31st agent would need up to 30 new integrations under glue, but only one adapter under the protocol.

An agent you have chained to for months upgrades its output to v2 without telling you. With strict equality, what do you see? With version negotiation?

Strict equality turns the drift into a hard failure on every call, which is at least visible. Without any check at all you could get a payload parsed wrongly and passed along silently, which is worse. Negotiation lets the two sides agree on v1 while it is still supported, or fail at connect time with a clear message.

A third-party agent’s card claims {"legal-review"}. Discovery routes a contract to it. What else must be true before you trust the result?

The card is a claim. You need evidence it does the job well (evals or a track record), an authenticated peer, a bounded delegation (it sees only this contract), and its output treated as untrusted input before it reaches your model or your users.

Frequently asked

Quick answers

What is A2A interop?

Letting agents built by different teams work together — one delegating a sub-task to another — via a protocol for discovery and messaging, not bespoke glue.

What is capability discovery?

Agents advertise their skills in a capability card; a coordinator matches a task's required capability and routes to an agent that lists it.

Why a shared schema?

Finding a capable agent isn't enough — a shared message format lets one agent's output feed another's input, so tasks chain across agents.

A2A vs MCP?

MCP standardizes agent-to-tool connections; A2A standardizes agent-to-agent connections. Same philosophy: agree on a protocol so components compose.

Finished this one? 0 / 209 Handbooks done
NextThe Agentic AI Interview Handbook Closest handbook to this one

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks