This proof-of-concept is designed for AUTHORIZED SECURITY TESTING ONLY.
- Only use on systems you own or have explicit permission to test
- Educational purposes for security research
- Not for malicious use
- Follow responsible disclosure practices
Demonstrates security vulnerabilities in Agent-to-Agent (A2A) communication systems, specifically:
- Direct Prompt Injection - Injecting malicious instructions in user input
- Context Poisoning - Poisoning agent handoff context
- Privilege Escalation - Attempting to access unauthorized data
- Lateral Movement - Impersonating other users
Customer Service Agent Chain:
User Request β Customer Service Agent β Database Agent β Email Agent β Response
Attack Goal:
- Authenticated user tries to access other users' data
- Inject instructions to exfiltrate entire customer database
- Bypass authentication and authorization controls
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .env
# Edit .env and add your Anthropic API key# Run complete demonstration
python run.py
# Run individual attacks
python -m demos.demo_baseline
python -m attacks.attack_1_direct_injection- User authenticates as john@example.com
- Requests their account balance
- Receives ONLY their data ($5000 balance)
- Inject system-level commands in user input
- Attempt to override agent behavior
- Goal: Retrieve all customer data instead of just user's data
- Poison the context passed between agents
- Instructions persist across multiple requests
- Goal: Establish persistent backdoor in agent chain
- Start with limited user permissions
- Attempt to escalate to admin-level access
- Goal: Access data beyond authenticated scope
- Authenticated as attacker@example.com
- Attempt to access john@example.com's data
- Goal: Bypass user isolation
- Agents follow injected instructions
- Retrieve data beyond authorized scope
- Return sensitive information from other users
- Execute unauthorized actions
- Demonstrate vulnerabilities in A2A communication systems
After running, check reports/ directory for:
poc_report.html- Detailed HTML reportattack_log.json- JSON log of all attemptsvulnerability_summary.txt- Text summary
Edit config.py to customize:
- Attack payloads
- Simulated database
- Agent system prompts
- Model configuration
docker build -t a2a-security-poc .# Run full demonstration
docker run --rm -v $(pwd)/reports:/app/reports -v $(pwd)/.env:/app/.env a2a-security-poc
# Run specific attack
docker run --rm -v $(pwd)/reports:/app/reports -v $(pwd)/.env:/app/.env a2a-security-poc python -m attacks.attack_1_direct_injectionCreate docker-compose.yml:
version: '3.8'
services:
a2a-poc:
build: .
volumes:
- ./reports:/app/reports
- ./.env:/app/.env
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}Run with:
docker-compose up- Solo.io - MCP and A2A Attack Vectors
- Invariant Labs - Tool Poisoning Attacks
- Palo Alto Unit 42 - Agent Session Smuggling
a2a-security-poc/
βββ README.md
βββ requirements.txt
βββ .env.example
βββ .gitignore
βββ config.py
βββ Dockerfile
βββ run.py
βββ src/
β βββ __init__.py
β βββ agents.py
β βββ auth.py
β βββ database.py
β βββ utils.py
βββ attacks/
β βββ __init__.py
β βββ attack_1_direct_injection.py
β βββ attack_2_context_poisoning.py
β βββ attack_3_privilege_escalation.py
β βββ attack_4_lateral_movement.py
βββ defenses/
β βββ __init__.py
β βββ secure_agents.py
βββ demos/
β βββ __init__.py
β βββ demo_baseline.py
β βββ demo_full.py
βββ reports/
βββ .gitkeep
python run.py --fullpython run.py --baselinepython run.py --attack 1 # Direct injection
python run.py --attack 2 # Context poisoning
python run.py --attack 3 # Privilege escalation
python run.py --attack 4 # Lateral movementpython run.py --attack allEdit .env to configure security settings:
# Enable/disable actual API calls (for testing without API)
ENABLE_ACTUAL_API_CALLS=true
# Enable verbose logging
VERBOSE_LOGGING=true
# Log all interactions
LOG_ALL_INTERACTIONS=trueThe POC includes:
- Mock database with 4 test users
- Simulated agent interactions
- Attack detection mechanisms
- Comprehensive logging
For questions about this POC or responsible disclosure, contact: [your-email]
MIT License - For educational and research purposes only
This POC is based on research into Agent-to-Agent communication security vulnerabilities. It is intended to help security researchers and developers understand and mitigate these risks.