Skip to main content
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 an alignment 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)
This extension enables agents to verify value coherence before delegating tasks, rather than discovering conflicts mid-execution.

Where A2A and AAP fit

A2A and AAP are complementary protocols in the agentic AI stack, both part of the Agentic AI Foundation (AAIF):
MCP + A2A + AAP/AIP = the complete trust stack. MCP connects agents to tools. A2A connects agents to each other. AAP verifies that coordinating agents share compatible values and produces auditable decision trails. AIP adds real-time integrity monitoring of agent reasoning.

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. The Alignment Card doesn’t replace the A2A Agent Card — it extends it:

Prerequisites

Step 1: Understand your current Agent Card

A standard A2A Agent Card (v0.3) declares capabilities:
This tells other agents what your agent can do, but not how it makes decisions or whose interests it serves.

Step 2: Add the Alignment block

Extend your Agent Card with an alignment block and declare AAP support via the A2A extensions array:

Key mapping: A2A skills to AAP actions

Your A2A skills map to AAP bounded_actions:

Step 3: Serve the Alignment Card

AAP specifies that Alignment Cards SHOULD be served at a well-known URL:
You can either: Option A: Embed in Agent Card (recommended for A2A)
Option B: Reference External Card
Option C: A2A v0.3 Extensions (declare support, serve separately)
With Option C, AAP-aware agents fetch the alignment card from the well-known URL. Non-AAP agents ignore the extension. Set 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:
TypeScript:

Step 5: Generate AP-Traces for A2A actions

When your agent performs actions (especially across agent boundaries), produce AP-Traces. Python:
TypeScript:

Step 6: Handle incoming coherence checks

When another agent requests your alignment card or initiates a coherence check. Python (Flask):
TypeScript (Express):

Complete example: Two agents coordinating

Here’s a complete flow with a user agent delegating to a vendor agent:
For a comprehensive example with multiple vendors, coherence checks, delegation traces, and verification, see the working example code (available in both Python and TypeScript).

EU compliance shortcut

Both SDKs include presets for EU AI Act Article 50 compliance (enforcement August 2026): Python:
TypeScript:
See the EU compliance for full field-level Article 50 mapping.

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_violation verdicts)
To make AAP/AIP signals visible in your existing observability stack, use the OpenTelemetry exporters:
These emit standard OTel spans with attributes like 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 alignment block to your Agent Card
  • Add AAP to A2A extensions array (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:
TypeScript:

Standard value identifiers

Use these standard identifiers where applicable: Custom values MUST be defined in the definitions block of your alignment card.

Reputation in A2A Agent Cards

Beyond value coherence, agents can advertise their Mnemom Trust Rating directly in A2A Agent Cards. This enables programmatic trust decisions before delegation — an agent can refuse to work with peers below a certain trust rating threshold.

The trust block

Add a trust block to your A2A Agent Card:
The score and grade in the trust block are snapshots. Always verify via verified_url for real-time scores before making high-stakes delegation decisions. The badge URL always serves the current score.

Programmatic trust thresholds

Agents can use the trust block to enforce minimum reputation requirements before accepting delegation: Python:
TypeScript:

ReputationGate middleware

For agents that process many delegation requests, implement a ReputationGate middleware that checks reputation before any task execution: Python (Flask):
TypeScript (Express):

SDK helper: getA2AReputationExtension()

Both SDKs provide a helper to generate the trust block for your Agent Card: Python:
TypeScript:
The getA2AReputationExtension() helper fetches the latest score from the API, so the trust block always contains current data. Call it when serving your Agent Card, not just once at startup.

Next steps


Questions? See the specification or check the examples.