Agent-to-Agent Protocols: A2A
You'll learn to
- -Explain what the Agent2Agent protocol is for and how it differs from MCP
- -Describe an Agent Card, a Message, a Task and the contextId that groups them
- -Walk through a task lifecycle, including input-required and the terminal states
- -Name the security habits that apply when your agent talks to someone else's agent
Tip: the highlighter is on - just select any text below to mark it. Use the highlighter button up top to change color or turn it off. Highlights are saved on this device only. Log in to save them to your account instead.
Everything so far assumed one team built every agent. But agents are now built by different companies on different frameworks, and a useful task may need a travel agent from one vendor to talk to a payments agent from another. Without a shared language, each pair needs a custom integration. The Agent2Agent protocol, written A2A, is an open standard for exactly that: communication and interoperability between agentic applications that stay opaque to each other.
An Analogy: A Phone Book and a Phone Call Between Firms
When one company needs help from another, it looks the other company up, learns what it does and how to reach it, and then places a call. It does not get to rummage through the other company's files, and it does not need to. A2A formalizes those same steps for agents: a public description of who the agent is, a standard way to send it work, and a way to follow that work until it finishes.
A2A and MCP Are Different Layers
The A2A documentation draws the line clearly. MCP is the vertical layer: it connects one agent to tools, data and resources, and every connection gives that agent more to work with on its own. A2A is the horizontal layer: it connects agents across a boundary, maybe to another team or another organization, so they can discover each other, negotiate and exchange work. Used together, MCP gives each agent depth and A2A gives the system reach. The tool design chapter covered MCP.
The Moving Parts
- -Agent Card: a JSON document an agent publishes describing its identity, capabilities, skills, endpoint and how to authenticate. By convention it is found at /.well-known/agent-card.json on the agent's domain, and may be digitally signed.
- -Message: one turn of communication. Simple exchanges can be a single message with no task at all.
- -Task: a unit of work with a lifecycle, created when the work needs trackable, longer processing. It reports its state as it goes.
- -contextId: an identifier that groups related messages and tasks, so a conversation keeps continuity across several interactions.
- -Streaming and push notifications: ways to receive progress and results for long-running tasks without polling.
A task moves through states. In the specification these include submitted, working, input-required, auth-required, completed, failed, canceled and rejected. The first few are in progress or paused. The last four are terminal, and a task in a terminal state accepts no further messages: to refine a result you start a new interaction with the same contextId. The code is a small teaching model of that idea, not the specification's own lifecycle rules.
The card tells a caller everything it needs to decide whether this agent can help: a name, a description, a skill and a capability flag for streaming. The task went from submitted to working, paused at input-required while it waited for more information from the caller, went back to working and then completed. After completion, any further move was refused with the message that a completed task takes no more messages. The last line shows a task refusing to skip from submitted straight to completed, which keeps the lifecycle honest.
Security When You Talk to Someone Else's Agent
- -Treat everything an outside agent sends as untrusted input, the same as a web page. It can carry prompt injection.
- -Authenticate as the card requires, and verify a signed card before trusting its claims.
- -Share the minimum. Opaque is a feature: the other agent never needs your memory, tools or internal reasoning.
- -Require human approval before an outside agent's request leads to an irreversible action on your side.
- -Log every cross-agent task with its context id, so an incident can be followed across both systems.
Protocols move quickly, and A2A has had a major version release. Check the current specification before building, and use the official SDKs instead of writing the wire format yourself.
Interview Signal is part of Pro
See a real weak answer next to a real strong one for this exact topic.
Quiz is part of Pro
Test what you just read with a short quiz, and bank the XP.
Discussion0
Join the Discussion
Sign in to leave comments, reply to others, or like insights.
No comments yet. Be the first to start the thread!