A2A Integration Guide
Time to integrate: ~10 minutes. This guide shows how to extend A2A Agent Cards with AAP alignment properties, enabling value coherence checks before agent-to-agent coordination. Examples in both Python and TypeScript.
Overview
A2A (Agent-to-Agent) protocol defines Agent Cards for capability discovery and task negotiation. AAP extends these cards with analignment block that declares:
- Who the agent serves (principal relationship)
- What values guide decisions (declared values and conflicts)
- What it can do autonomously (autonomy envelope)
- How decisions are audited (trace commitment)
Where A2A and AAP Fit
A2A and AAP are complementary protocols in the agentic AI stack, both part of the Agentic AI Foundation (AAIF):The Alignment Card as Superset of the A2A Agent Card
An A2A Agent Card tells other agents what you can do. An Alignment Card tells them why you do it and whose interests you serve.| A2A Agent Card | AAP Alignment Card | What AAP Adds |
|---|---|---|
id, name | agent_id, card_id | Stable identity for audit trails with issuance/expiry |
description | values.declared | Machine-verifiable intent, not just prose |
skills | autonomy_envelope.bounded_actions | Which skills are safe to execute autonomously |
capabilities | autonomy_envelope | Escalation triggers, forbidden actions, spending limits |
securitySchemes | (complementary) | A2A handles auth; AAP handles behavioral trust |
extensions | extensions.aap | URI-based extension linking to alignment metadata |
signature | issued_at, expires_at | Both support signed, time-bound artifacts |
| (no equivalent) | principal | Who the agent serves and their relationship |
| (no equivalent) | values.conflicts_with | Explicit declaration of incompatible values |
| (no equivalent) | audit_commitment | Trace format, retention, queryability guarantees |
Prerequisites
Step 1: Understand Your Current Agent Card
A standard A2A Agent Card (v0.3) declares capabilities:Step 2: Add the Alignment Block
Extend your Agent Card with analignment block and declare AAP support via the A2A extensions array:
Key Mapping: A2A Skills to AAP Actions
Your A2Askills map to AAP bounded_actions:
| A2A Skill | AAP Treatment | Rationale |
|---|---|---|
product-search | bounded_actions | Low risk, no state change |
compare-products | bounded_actions | Low risk, no state change |
purchase | escalation_triggers | Financial commitment, requires approval |
Step 3: Serve the Alignment Card
AAP specifies that Alignment Cards SHOULD be served at a well-known URL:required: true if you want to enforce that all coordinating agents must support AAP.
Step 4: Implement Value Coherence Handshake
Before your agent delegates work to another agent, verify value coherence. Python:Step 5: Generate AP-Traces for A2A Actions
When your agent performs actions (especially across agent boundaries), produce AP-Traces. Python:Step 6: Handle Incoming Coherence Checks
When another agent requests your alignment card or initiates a coherence check. Python (Flask):Complete Example: Two Agents Coordinating
Here’s a complete flow with a user agent delegating to a vendor agent:EU Compliance Shortcut
Both SDKs include presets for EU AI Act Article 50 compliance (enforcement August 2026): Python:Beyond Verification: Real-Time Monitoring with AIP
AAP provides post-hoc verification — checking whether actions matched declared alignment after they happen. The Agent Integrity Protocol (AIP) adds real-time integrity monitoring by analyzing agent reasoning (thinking blocks) as they occur. Both AAP and AIP share the same Alignment Card. An A2A agent with an alignment block gets both:- AAP: Did this agent do what it said it would? (
verify_trace,check_coherence,detect_drift) - AIP: Is this agent thinking clearly right now? (integrity checkpoints with
clear/review_needed/boundary_violationverdicts)
aap.verification.result, aap.verification.similarity_score, aip.integrity.verdict — compatible with Langfuse, Arize Phoenix, Datadog, and Grafana.
Integration Checklist
- Install AAP SDK (
pip install agent-alignment-protocol/npm install @mnemom/agent-alignment-protocol) - Audit your current A2A Agent Card
- Identify which skills are bounded vs. require escalation
- Define your principal relationship
- Declare your operational values and conflicts
- Add forbidden actions (things you’ll never do)
- Add the
alignmentblock to your Agent Card - Add AAP to A2A
extensionsarray (v0.3) - Serve alignment card at
/.well-known/alignment-card.json - Implement coherence check endpoint
- Add AP-Trace generation to skill implementations
- Test with
verify_trace()before deployment - Implement handling for non-AAP agents (graceful degradation)
- Consider AIP for real-time integrity monitoring
- Configure OTel exporter for observability
Handling Non-AAP Agents
Not all agents will support AAP. Define your policy: Python:Standard Value Identifiers
Use these standard identifiers where applicable:| Identifier | Description |
|---|---|
principal_benefit | Prioritize principal’s interests |
transparency | Disclose reasoning and limitations |
minimal_data | Collect only necessary information |
harm_prevention | Avoid actions causing harm |
honesty | Do not deceive or mislead |
user_control | Respect user autonomy and consent |
privacy | Protect personal information |
fairness | Avoid discriminatory outcomes |
definitions block of your alignment card.
What’s Next?
- quickstart — Core AAP concepts and API
- specification — Full protocol specification
- limitations — What AAP can and cannot guarantee
- EU compliance — EU AI Act Article 50 compliance guide
- examples — Working example code (Python + TypeScript)
Questions? See the specification or check the examples.