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:

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.
- Core Concepts
- What problems does A2A solve?
- Key terminology and definitions
-
Basic architecture patterns
- How agents identify themselves
- UUID vs human-readable names
-
Identity in distributed systems
- Request/Response pattern
- Handshake and negotiation
-
Event streaming
- Discovery → Negotiation → Execution
- Multi-turn conversations
- State management
Phase 2: 🔍 Discovery & Registration¶
Learn how agents find each other in a distributed system.
- Agent Cards
- Structure of an Agent Card
- Capability declarations
-
Metadata and versioning
- Centralized vs distributed registries
- Service discovery patterns
-
Health monitoring and heartbeats
- How to query for specific capabilities
- Ranking and selection algorithms
- 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
- Authentication Overview
- Why agent authentication is hard
- Trust models in distributed systems
-
PKI and certificate chains
- How agents prove their identity
- Signature verification
-
Nonce-based replay protection
- Common attack vectors
- Malicious agent scenarios
-
Defense-in-depth strategies
- Input validation
- Rate limiting
- Audit logging
- Least privilege principles
Phase 4: 💬 Communication Patterns¶
Master the actual message exchange between agents.
- Protocol Messages
- JSON message structure
- TextPart, DataPart, FilePart
-
Message routing
- Server-Sent Events (SSE)
- Real-time updates
-
Push vs pull patterns
- Standard error codes
- Graceful degradation
- Recovery strategies
Phase 5: 📚 Reference Materials¶
Quick lookup for specifications and standards.
- Message Schemas
- JSON Schema definitions
- Validation rules
-
Version compatibility
- Standard capability names
- Custom capability guidelines
-
Capability hierarchies
- Version history
- Breaking vs non-breaking changes
- Migration guides
🎯 Recommended Learning Sequences¶
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¶
- Current README - Project overview
- A2A + MCP Integration - How protocols work together
- Implementation Patterns - Architectural guidance
Presentations & Slides¶
Code Examples¶
- Crypto Agent Examples - All three security levels
- Security Module - Production reference
🗺️ Navigation Map¶
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:¶
- Complete Beginner?
- Start with Core Concepts
- Read linearly through Fundamentals
-
Don't skip ahead
-
Familiar with Agent Systems?
- Skim Fundamentals
- Focus on Security
-
Study code examples
-
Security Professional?
- Jump to Threat Model
- Review vulnerable code (Example 1)
- 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.1
- Last Updated: January 2026
- Status: Learning Project (Non-Production)
- Audience: Developers, Security Engineers, AI Architects
🎯 Key Takeaways¶
Before moving to the next section, ensure you understand:
- ✅ What A2A is: An orchestration protocol for agent communication
- ✅ Why it exists: To enable scalable multi-agent systems
- ✅ Security first: All examples show vulnerable → secure progression
- ✅ Your learning path: Progressive phases from basics to production
- ✅ 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.