Skip to main content

Lesson 9: Agent to Agent Protocol

Topics Covered
  • The Challenge: How different agents talk to each other.
  • A2A Protocol: The standard for agent collaboration.
  • The 3 Stages: Discovery, Authentication, Communication.
  • Privacy: Treating agents as opaque systems.

1. The Challenge

Agents are autonomous systems that perceive, decide, and act. But complex problems often require multiple agents to collaborate (e.g., a Travel Agent needing to talk to a Flight Agent and a Hotel Agent).

If you want to use somebody else's agent, you need a standard way to collaborate, handle authentication, and communicate. That is what the A2A (Agent to Agent) Protocol does.

2. Core Actors

  1. User: Initiates the request (Human or Automated Service).
  2. Client Agent (A2A Client): Acts on behalf of the user to initiate requests.
  3. Remote Agent (A2A Server): The agent receiving the request and performing the task.

3. The Three Stages

Stage 1: Discovery

How does the Client Agent find the Remote Agent? The Remote Agent publishes an Agent Card—a JSON metadata document served on the agent's domain. Contains: Identity, Capabilities, Service Endpoint URL, and Auth requirements.

Stage 2: Authentication

Happens through the security scheme indicated in the Agent Card.

  • Client Agent authenticates.
  • Remote Agent authorizes and grants access control.

Stage 3: Communication

The Client Agent sends a task to the Remote Agent.

  • Format: JSON RPC 2.0.
  • Transport: HTTPS.
  • Modes:
    • Request/Response: Standard for quick tasks.
    • Streaming (SSE): Server-Sent Events for long-running tasks or status updates.

4. Privacy & Benefits

A major benefit of A2A is Privacy. The protocol treats agentic AI as opaque agents. Autonomous agents can collaborate without revealing their inner workings (internal memory, proprietary logic, or specific tool implementations). This preserves data privacy and Intellectual Property while allowing ecosystems to flourish.