Why Agents Need a Protocol
Understand why AI agents require a shared protocol to avoid fragmented communication. Explore how the A2A protocol standardizes interactions, enabling agents built on various platforms to collaborate securely and efficiently. Learn key concepts such as agent discovery, request handling, authorization, and error management to build interoperable agent systems.
We'll cover the following...
Suppose that there are five teams, and each one is building a helpful “robot coworker.” One is in Python, another in JavaScript, and a third runs on a vendor cloud. Two are also experimental internal tools built with agentic frameworks like CrewAI and LangGraph. Now, the company wants them to handle a customer request together: plan a trip, check inventory, price it, and invoice it. Without shared rules, every pair invents a private handshake: custom data shapes, one-off tokens, inconsistent errors, and fragile fixes. It’s slow and brittle. One update leads to a break in four links; nobody can trace what happened, and security gets patchy.
A protocol is simply a playbook that stops the chaos. It standardizes how agents introduce themselves (capabilities), ask for work (requests), share progress (streaming), fail safely (errors), and prove permissions (authorization). With that in place, teams build once and reuse everywhere, making the whole process clear, safe, and predictable. And that’s exactly where A2A comes in.
For starters, think simple: A2A is just a set of shared rules so agents can ask for help and share results without surprises.
What is A2A?
The Agent2Agent (A2A) protocol is an
A2A builds on familiar web tech (HTTP, JSON-RPC, and streaming via server-sent events), which means it fits cleanly into existing enterprise stacks. Unlike raw WebSockets or gRPC, A2A defines a structured intent schema, allowing discoverability and task negotiation between heterogeneous agents.
It supports enterprise-style authentication and authorization options (OAuth, API keys, mTLS), handles short requests and long-running work with real-time updates. It is also modality-agnostic in that, not just text, but files and structured data can flow between agents when needed.
At a high level, A2A establishes a simple request–response routine between a client agent (asks) and a remote agent (does). Remote agents publish a small JSON “Agent Card” that lists what they can do and what they require. The client selects a match, sends a task containing a method name, inputs, and identity. The task follows a life cycle, streams progress, and returns an artifact as output. If something goes wrong, the remote agent sends a structured error, and permissions are enforced with tokens and scopes throughout.
If some of these terms feel unfamiliar, that’s fine; we’ll unpack them as we go. For now, focus on the big idea: A2A defines clear steps so agents can find the right partner, ask for help, and keep one another updated safely. When a request is unclear, agents shouldn’t guess but ask for the missing information or politely decline communication.
What are the prerequisites?
You don’t need to be an AI expert, just curious and comfortable with basic software skills. We’ll build A2A concepts step-by-step, using Python for examples, but everything you learn will translate to other languages and frameworks. You’re already in good shape if you’ve shipped a small web service, parsed JSON, or called an API.
What helps most:
Being comfortable with Python 3 (functions, packages, virtual environments such as
venv,uv,poetry, orpip; basic typing).HTTP basics (requests, responses, headers, status codes).
JSON literacy (reading and writing payloads, schemas, error shapes).
Command-line familiarity (running scripts, environment variables).
Introductory security concepts (tokens, API keys, least privilege).
Logging and debugging basics (tracebacks, print or log statements).
Event and streaming familiarity (SSE or WebSockets), REST/RPC intuition.
We’ll keep the code gentle, explain terms on first use, and keep it beginner-friendly.
How to use the A2A SDK
You can install the A2A Python SDK to start building or running agents. Use the following commands depending on your setup:
# Core SDKpip install uvuv pip install a2a-sdk# orpip install a2a-sdk
To include optional extras, you can add extensions such as:
uv add "a2a-sdk[all]" # All featuresuv add "a2a-sdk[http-server]" # HTTP Serveruv add "a2a-sdk[grpc]" # gRPC Supportuv add "a2a-sdk[telemetry]" # OpenTelemetry Tracinguv add "a2a-sdk[encryption]" # Encryption
That’s it. Once installed, you’re ready to define your first agent and start communicating via A2A. You can go ahead and try whatever method that you want to in the terminal below:
That’s it! This is really just how easy it is to get A2A up and running in your system.