Skip to content

Agent2Agent (A2A) Protocol - Overview

🎯 Welcome to A2A Protocol Learning

This is your starting point for understanding the Agent2Agent (A2A) Protocol - a communication framework that enables AI agents to discover, communicate with, and collaborate with other agents in distributed multi-agent systems.

⚠️ LEARNING PROJECT NOTICE
This documentation is part of a security-focused learning project. All code examples progress from intentionally vulnerable implementations to production-ready secure versions. This is NOT production-ready code - it's designed to teach security principles through practical examples.


🤔 What is the Agent2Agent Protocol?

The Agent2Agent (A2A) Protocol is a high-level orchestration protocol that standardizes how AI agents:

  • Discover each other through registries and capability matching
  • Identify themselves using Agent Cards (structured identity documents)
  • Communicate using standardized message formats
  • Collaborate on complex tasks requiring multiple specialized agents
  • Authenticate and authorize interactions for secure operations

The Big Picture

Think of A2A as the "language and etiquette" that agents use to work together:

"The Big Picture"

A2A handles the "who" - Which agents exist? What can they do? How do they find each other? How do they prove their identity?


🎓 Why Learn A2A?

For Developers

  • Build multi-agent systems that scale beyond single-agent limitations
  • Create agents that can dynamically discover and collaborate with other agents
  • Understand distributed system patterns for AI architectures
  • Learn security principles specific to agent-to-agent communication

For Security Professionals

  • Understand unique attack vectors in multi-agent systems
  • Learn authentication and authorization patterns for autonomous agents
  • Master identity verification in distributed agent networks
  • Recognize common vulnerabilities in agent communication

For AI Architects

  • Design scalable agent ecosystems that grow organically
  • Implement service mesh patterns for agent networks
  • Balance flexibility and security in agent orchestration
  • Create resilient systems with fallback and redundancy

📚 Your Learning Path

This documentation is organized into progressive sections that build on each other:

Phase 1: 📘 Fundamentals (Start Here!)

Understand the core concepts before diving into implementation.

  1. Core Concepts
  2. What problems does A2A solve?
  3. Key terminology and definitions
  4. Basic architecture patterns

  5. Agent Identity

  6. How agents identify themselves
  7. UUID vs human-readable names
  8. Identity in distributed systems

  9. Message Types

  10. Request/Response pattern
  11. Handshake and negotiation
  12. Event streaming

  13. Conversation Flows

  14. Discovery → Negotiation → Execution
  15. Multi-turn conversations
  16. State management

Phase 2: 🔍 Discovery & Registration

Learn how agents find each other in a distributed system.

  1. Agent Cards
  2. Structure of an Agent Card
  3. Capability declarations
  4. Metadata and versioning

  5. Agent Registry

  6. Centralized vs distributed registries
  7. Service discovery patterns
  8. Health monitoring and heartbeats

  9. Capability Matching

  10. How to query for specific capabilities
  11. Ranking and selection algorithms
  12. Fallback strategies

Phase 3: 🔐 Security (CRITICAL!)

This is where we focus on security vulnerabilities and solutions.

🎯 LEARNING APPROACH
Each security topic shows: 1. ❌ Common vulnerability patterns 2. ⚠️ Why they're dangerous 3. ✅ Proper secure implementation 4. 🔍 How to test and validate

  1. Authentication Overview
  2. Why agent authentication is hard
  3. Trust models in distributed systems
  4. PKI and certificate chains

  5. Authentication Tags

  6. How agents prove their identity
  7. Signature verification
  8. Nonce-based replay protection

  9. Threat Model

  10. Common attack vectors
  11. Malicious agent scenarios
  12. Defense-in-depth strategies

  13. Security Best Practices

  14. Input validation
  15. Rate limiting
  16. Audit logging
  17. Least privilege principles

Phase 4: 💬 Communication Patterns

Master the actual message exchange between agents.

  1. Protocol Messages
  2. JSON message structure
  3. TextPart, DataPart, FilePart
  4. Message routing

  5. Streaming & Events

  6. Server-Sent Events (SSE)
  7. Real-time updates
  8. Push vs pull patterns

  9. Error Handling

  10. Standard error codes
  11. Graceful degradation
  12. Recovery strategies

Phase 5: 📚 Reference Materials

Quick lookup for specifications and standards.

  1. Message Schemas
  2. JSON Schema definitions
  3. Validation rules
  4. Version compatibility

  5. Capability Vocabulary

  6. Standard capability names
  7. Custom capability guidelines
  8. Capability hierarchies

  9. Protocol Versions

  10. Version history
  11. Breaking vs non-breaking changes
  12. Migration guides

For Complete Beginners: "Zero to Agent"

Week 1: Understanding 1. Read all of Phase 1 (Fundamentals) 2. Review the presentation slides 3. Understand the "why" before the "how"

Week 2: Discovery 1. Study Phase 2 (Discovery & Registration) 2. Look at simple Agent Card examples 3. Understand how registries work

Week 3: Security Awareness 1. Read Phase 3 (Security) - ALL OF IT 2. This is the most critical phase 3. Learn to recognize vulnerable patterns

Week 4: Hands-On 1. Study the example code progression: - Example 1: Vulnerable (identify flaws) - Example 2: Improved (understand trade-offs) - Example 3: Secure (production patterns)


For Experienced Developers: "Fast Track"

Day 1: Quick Overview - Skim Fundamentals - Deep-dive Security section - Review message schemas

Day 2-3: Code Examples - Start with Example 3 (secure implementation) - Work backwards to understand what it fixes - Compare with Examples 1 and 2

Day 4-5: Build Your Own - Implement a simple agent pair - Add authentication - Test security controls


For Security Auditors: "Red Team Path"

Start Here: 1. Read Threat Model first 2. Study vulnerable Example 1 3. Identify attack vectors

Then: 1. Review security controls in Example 3 2. Attempt to bypass protections 3. Document findings

Finally: 1. Propose improvements 2. Write security test cases 3. Create threat scenarios


🔑 Key Concepts to Master

Before moving forward, make sure you understand these core ideas:

1. Agent Identity

  • Every agent has a unique ID
  • Agent Cards describe capabilities
  • Identity ≠ Authentication (proving who you are)

2. Discovery

  • Agents find each other via registries
  • Capability-based matching (not just by name)
  • Dynamic discovery vs hardcoded connections

3. Security

  • Never trust incoming messages
  • Verify signatures and authenticity
  • Defend against replay attacks
  • Rate limit everything

4. Communication

  • JSON-based text protocol
  • Standard message types
  • Error handling is mandatory

🛡️ Security-First Mindset

Throughout this documentation, you'll see security annotations:

  • VULNERABLE - Don't do this
  • ⚠️ RISKY - Acceptable only in specific contexts
  • SECURE - Follow this pattern
  • 🔍 TEST THIS - How to verify security

Example:

# ❌ VULNERABLE: No validation
def handle_message(msg):
    return eval(msg.payload)  # Code injection risk!

# ✅ SECURE: Proper validation
def handle_message(msg):
    schema.validate(msg.payload)  # Validate first
    return safe_process(msg.payload)

💻 Code Examples Journey

This project includes three progressive implementations:

Example 1: Basic (Intentionally Vulnerable)

  • Purpose: Learn to recognize security flaws
  • Location: examples/a2a_crypto_example/
  • Security: ❌ Minimal to none
  • Use Case: Study only, never deploy

Example 2: Improved (Partial Security)

  • Purpose: Understand incremental hardening
  • Location: examples/a2a_crypto_simple_registry_example_1/
  • Security: ⚠️ Better but incomplete
  • Use Case: Learning trade-offs

Example 3: Secure (Production-Ready)

  • Purpose: Production-grade security
  • Location: examples/a2a_crypto_example/security/
  • Security: ✅ Comprehensive controls
  • Use Case: Template for real implementations

🌐 A2A in the Broader Ecosystem

How A2A Relates to Other Protocols

A2A vs MCP: - A2A: Agent-to-agent orchestration (the "who") - MCP: Agent-to-tool connections (the "what") - Together: Complete multi-agent system

A2A vs REST APIs: - REST: Client-server, stateless, synchronous - A2A: Peer-to-peer, stateful, asynchronous capable

A2A vs Microservices: - Microservices: Service architecture pattern - A2A: Protocol for service discovery and communication - A2A can implement microservice patterns

When to Use A2A

✅ Use A2A When: - You have multiple specialized agents - Agents need to discover each other dynamically - You need agent orchestration and delegation - Security and authentication are critical

❌ Don't Use A2A When: - Single agent is sufficient - All connections are known at design time - Simple REST APIs would work fine - You don't need agent autonomy


📖 Additional Resources

Official Documentation

Presentations & Slides

Code Examples


YOU ARE HERE → 00_A2A_OVERVIEW.md (This document)
     ┌───────────────┼───────────────┐
     │               │               │
     ▼               ▼               ▼
📘 Fundamentals  🔍 Discovery   🔐 Security
     │               │               │
     └───────────────┼───────────────┘
           💬 Communication Patterns
            📚 Reference Materials
           💻 Code Examples (1→2→3)

🚀 Ready to Start?

Next Steps:

  1. Complete Beginner?
  2. Start with Core Concepts
  3. Read linearly through Fundamentals
  4. Don't skip ahead

  5. Familiar with Agent Systems?

  6. Skim Fundamentals
  7. Focus on Security
  8. Study code examples

  9. Security Professional?

  10. Jump to Threat Model
  11. Review vulnerable code (Example 1)
  12. Test secure implementation (Example 3)

📬 Getting Help

Questions?

  • Check the References for links to specifications
  • Review code examples for practical implementations
  • Look for inline security annotations in example code

Found an Issue?

  • Security vulnerability? Document it!
  • Documentation unclear? Note what confused you
  • Code example confusing? Suggest improvements

Contact: robert@fischer3.net


📝 Document Version

  • Version: 1.0
  • Last Updated: November 2025
  • Status: Learning Project (Non-Production)
  • Audience: Developers, Security Engineers, AI Architects

🎯 Key Takeaways

Before moving to the next section, ensure you understand:

  1. What A2A is: An orchestration protocol for agent communication
  2. Why it exists: To enable scalable multi-agent systems
  3. Security first: All examples show vulnerable → secure progression
  4. Your learning path: Progressive phases from basics to production
  5. Not production code: This is educational material only

🎓 Let's Begin!

Ready to dive deeper? Choose your path:

📘 Start with Fundamentals →

Begin at the beginning with core concepts and terminology.

🔐 Jump to Security →

If you already know agent basics, start with security concerns.

💻 Explore Code Examples →

Prefer learning by reading code? Start with the examples.


Happy Learning! 🚀

Remember: The goal isn't just to make agents talk - it's to make them talk securely.