card_version: "unified/2026-04-26")
SDK versions: agent-alignment-protocol (PyPI) 2.0.0 — @mnemom/agent-alignment-protocol (npm) 2.0.0
Status: Stable (breaking changes require a major version bump)
Earlier releases (AAP 0.5.0 and before) used a different card shape:
aap_version,
autonomy_envelope, audit_commitment. Both SDKs still accept the legacy field
names when reading a card for backward compatibility, but every example in this
document uses the current unified shape. See the migration note if you have cards issued before 2026-06.For which SDK/runtime versions are actually live on the hosted service today, see Protocol versions in production.Abstract
The Agent Alignment Protocol (AAP) defines a standard for autonomous agents to declare their alignment posture, produce auditable decision traces, and verify value coherence before inter-agent coordination. AAP extends existing agent coordination protocols (A2A, MCP) with an alignment layer that makes agent behavior observable to principals, auditors, and other agents. AAP is a transparency protocol, not a trust protocol. It makes agent behavior more observable, not more guaranteed.Table of contents
- Introduction
- Terminology
- Protocol Overview
- Alignment Card
- AP-Trace
- Value Coherence Handshake
- Verification
- Drift Detection
- Security Considerations
- Limitations
- Well-Known URI Convention
- References
- Appendix A: JSON Schemas
- Appendix B: Verification Algorithm
1. Introduction
1.1 Problem statement
The current agent protocol stack provides mechanisms for capability discovery (A2A Agent Cards), tool integration (MCP), and payment authorization (AP2). None of these protocols address a fundamental question: Is this agent serving its principal’s interests? As agent capabilities become symmetric—equal access to information, equal reasoning power, equal tool access—alignment becomes the primary differentiator. When you cannot reliably distinguish between human and agent communication, trust in alignment becomes essential infrastructure.1.2 Design goals
AAP is designed with the following goals:- Transparency over guarantee: Make agent decisions observable, not provably correct
- Composability: Extend existing protocols (A2A, MCP) rather than replace them
- Minimal overhead: Add alignment without significant performance cost
- Falsifiability: Enable third-party verification and audit
- Honest limits: Be explicit about what the protocol cannot provide
1.3 Non-goals
AAP explicitly does NOT attempt to:- Guarantee that agents will behave as declared
- Provide protection against sophisticated deception
- Replace human judgment in consequential decisions
- Certify that an agent is “safe” or “trustworthy”
- Solve the alignment problem in general
1.4 Document conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.2. Terminology
Agent: An autonomous software entity capable of taking actions on behalf of a principal. Principal: The human or organization whose interests the agent is meant to serve. Alignment Card: A structured declaration of an agent’s alignment posture, including values, autonomy envelope, and audit commitments. AP-Trace: An audit log entry recording an agent’s decision process, including alternatives considered and selection reasoning. Value Coherence: The degree to which two agents’ declared values are compatible for coordination. Autonomy Envelope: The set of actions an agent may take without escalation, and the conditions that trigger escalation. Escalation: The process of deferring a decision to a principal or higher-authority agent. Drift: Behavioral deviation from declared alignment posture over time. Verification: The process of checking whether observed behavior (AP-Trace) is consistent with declared alignment (Alignment Card). Strand: In multi-turn conversations, a participant’s sequence of messages. SSM (Self-Similarity Matrix): A computational structure measuring semantic similarity between messages across a conversation. Divergence: When conversation strands drift apart semantically, indicating potential misalignment.3. Protocol overview
3.1 Components
AAP consists of three interconnected components:- Alignment Card: Static declaration of alignment posture
- AP-Trace: Dynamic audit log of decisions
- Value Coherence Handshake: Pre-coordination compatibility check
3.2 Protocol flow
A typical AAP interaction proceeds as follows:3.3 Integration with existing protocols
AAP is designed to complement, not replace, existing protocols:- A2A Integration: Alignment Card extends the A2A Agent Card with an
alignmentblock - MCP Integration: AP-Trace entries MAY be generated for tool invocations
- HTTP Integration: Alignment Cards SHOULD be served at
/.well-known/alignment-card.json
4. Alignment Card
4.1 Overview
An Alignment Card is a structured document declaring an agent’s alignment posture. It MUST be machine-readable (JSON) and SHOULD be human-readable. This is the unified card shape — the same shape accepted bymnemom card validate and the Mnemom platform’s PUT /v1/agents/{agent_id}/alignment-card endpoint, so an agent can serve one card that satisfies both AAP and the platform.
4.2 Structure
An Alignment Card MUST contain the following top-level fields:autonomy_mode and integrity_mode are the two master switches introduced by the unified shape. autonomy_mode governs the AAP action-policing checks described in this document; integrity_mode governs the AIP per-turn conscience pipeline sharing this same card. Both accept the same four-value AlignmentMode enum (off, observe, nudge, enforce).
4.3 Principal block
Theprincipal block declares the agent’s relationship to its principal.
Relationship Types:
delegated_authority: Agent acts within bounds set by principaladvisory: Agent provides recommendations; principal makes decisionsautonomous: Agent operates independently within declared values
4.4 Values block
Thevalues block declares the agent’s operational values.
Standard Value Identifiers:
Implementations SHOULD use these standard identifiers where applicable:
Custom values MUST be defined in the
definitions block.
Note — what belongs indeclared:values.declaredis consulted by the AIP integrity monitor per turn during integrity checkpoint analysis. Only include values the agent will actually apply in its reasoning. Declaring a value the agent never applies producesUNDECLARED_VALUE-class verification warnings and degrades trust scoring. Role-specific operational principles that describe the agent’s job function rather than its ethical commitments belong inextensions, notvalues.declared. For example,fiduciary_precisionororganizational_claritydescribe what an agent IS in its role — they should be set inextensions.clpi.role. Values liketransparency,honesty,accuracy, andaccountabilitydescribe how an agent reasons — those belong indeclared.
4.5 Autonomy block
Theautonomy block defines what the agent may do independently. (Renamed from the legacy autonomy_envelope in the unified shape; semantics unchanged.)
Each escalation trigger MUST specify:
4.6 Condition expression language
Escalation conditions use a minimal expression language:purchase_value > 100action_type == "delete"shares_personal_data(boolean field check)
- Comparison operators:
>,<,>=,<=,==,!= - String literal comparison:
field == "value" - Numeric comparison:
field > 100 - Boolean field check:
field_name(evaluates to true if field is truthy)
- Logical expressions:
condition and condition,condition or condition contains(field, value)— substring or element containmentmatches(field, pattern)— regex matching
4.7 Audit block
Theaudit block declares how the agent logs decisions. (Renamed from the legacy audit_commitment in the unified shape; semantics unchanged. The legacy storage sub-object was removed in the 2.0.0 SDKs — there is no storage.type / storage.location.)
4.8 Extensions block
Theextensions block allows protocol-specific additions.
4.9 Complete example
4.10 Migrating from the legacy 0.5.0 card shape
SDK versions before 2.0.0 used a different top-level shape. Both fields carry identical semantics; only the names (and the addition of the two mode switches) changed:
Both the Python and TypeScript SDKs still read the legacy field names for backward compatibility when validating an old card, but
AlignmentCard.model_dump() / aap init always emit the unified shape. New cards SHOULD use the unified shape directly.
5. AP-Trace
5.1 Overview
An AP-Trace (Alignment Protocol Trace) is an audit log entry recording an agent’s decision process. AP-Traces enable verification that observed behavior is consistent with declared alignment.5.2 Design principles
- Sampling, not completeness: AP-Traces capture significant decisions, not every computation
- Structured reasoning: Decision rationale is machine-parseable
- Verifiable references: Traces reference the Alignment Card in effect
- Append-only: Traces MUST NOT be modified after creation
5.3 Structure
An AP-Trace entry MUST contain:5.4 Action block
Theaction block describes what action was taken or considered.
5.5 Decision block
Thedecision block records the decision process.
Each alternative MUST specify:
5.6 Escalation block
Theescalation block records escalation evaluation.
5.7 Context block
Thecontext block provides additional information.
5.8 Complete example
6. Value Coherence handshake
6.1 Overview
The Value Coherence Handshake is a pre-coordination protocol exchange that verifies whether two agents’ declared values are compatible for a proposed task.6.2 Protocol flow
6.3 Messages
6.3.1 alignment_card_request
Sent by initiator to request responder’s Alignment Card.6.3.2 alignment_card_response
Sent by responder with their Alignment Card.signature field is OPTIONAL but RECOMMENDED for high-stakes interactions.
6.3.3 value_coherence_check
Sent by initiator to perform coherence check.6.3.4 coherence_result
Sent by responder with coherence assessment.6.4 Coherence scoring
Value coherence score is computed as:[0.0, 1.0]. compatible is true only when there are zero value conflicts AND score >= MIN_COHERENCE_FOR_PROCEED (0.70); proceed mirrors compatible. Implementations MAY use more sophisticated scoring algorithms but MUST produce a score in the range [0.0, 1.0].
6.5 Conflict resolution
When conflicts are detected, implementations SHOULD follow this resolution order:- Automatic resolution: If one value strictly subsumes another
- Negotiated resolution: If agents can agree on modified scope
- Principal escalation: If agents cannot resolve autonomously
7. Verification
7.1 Overview
Verification is the process of checking whether observed behavior (AP-Trace entries) is consistent with declared alignment (Alignment Card).7.2 Verification scope
Verification operates at three levels:- Trace verification: Single AP-Trace against Alignment Card
- Session verification: Collection of traces from one session
- Longitudinal verification: Traces across multiple sessions (drift detection)
7.3 Verification algorithm
verify_trace provides structural verification only. It checks that a trace conforms to what an Alignment Card declares. It does NOT provide cryptographic integrity verification — traces are not signed or hash-chained by the reference SDKs. A malicious agent can produce a structurally valid trace for arbitrary behavior. For an integrity guarantee over the agent’s actual reasoning, pair AAP with AIP.verification_metadata.checks_performed:
card_reference: Doestrace.card_idmatchcard.card_id?card_expiration: Is the card still valid (not pastexpires_at)?autonomy: Isaction.nameinautonomy.bounded_actionswhenaction.category == "bounded"?forbidden: Isaction.nameNOT inautonomy.forbidden_actions?escalation: For every matched escalation trigger, wasescalation.requiredset?values: Is every value indecision.values_appliedpresent invalues.declared?behavioral_similarity: Is the trace semantically similar to the card’s declared alignment, per SSM analysis?
near_boundary warnings when a decision’s confidence or an alternative’s score falls below NEAR_BOUNDARY_THRESHOLD (0.35), even when no violation is found.
7.4 Verification result
A verification result MUST contain:recommended_action is derived mechanically: "deny" if any violation was found, else "review" if any warning was found, else "proceed". Prefer branching on recommended_action over verified alone — it distinguishes a clean pass from a warning-only pass.
The similarity_score measures semantic similarity between the trace behavior and declared alignment using SSM (Self-Similarity Matrix) analysis. A score of 1.0 indicates perfect alignment; lower scores indicate divergence.
Threshold: BEHAVIORAL_SIMILARITY_THRESHOLD = 0.50. If a trace passes all structural checks but has similarity_score < 0.50, a low_behavioral_similarity warning is generated.
similarity_details shape. The TypeScript SDK emits the {similarity_score, method, algorithm_version} shape shown above. The published Python SDK (2.0.0 and earlier) still emits a different, Python-only shape ({similarities, mean_similarity, trend}). The SDK changelog’s 2.0.1 entry aligns Python to the shape above, but no 2.0.1 package has been published to npm or PyPI yet. That change also alters the feature extractor, so similarity scores computed before it are not numerically comparable to scores computed after.7.5 Violation types
8. Drift detection
8.1 Overview
Drift detection identifies when an agent’s behavior deviates from its declared alignment posture over time. Unlike single-trace verification, drift detection requires longitudinal analysis.8.2 Detection methodology
Drift detection uses trace-to-baseline-centroid similarity to measure behavioral consistency (v1.2.0):- Feature extraction: Extract structural features from each trace (action types, values applied, escalation patterns, confidence)
- Chronological ordering: Sort all traces by timestamp before processing
- Baseline computation: Compute a baseline centroid from the first N traces, where N =
max(sustained_threshold, min(10, len(traces) // 4)) - Similarity computation: Compute cosine similarity between each subsequent trace’s feature vector and the baseline centroid
- Divergence tracking: Track similarity over time, alert on sustained divergence
card_id in drift alerts and for inferring drift direction (Section 8.5), but is no longer used as the comparison target for similarity scoring.
Important (v1.1.0, updated v1.2.0): Drift detection uses only structural features — not content features from reasoning text. Alignment Cards declare structural constraints (values, bounded actions, principal relationship) but contain no reasoning text. Including content tokens from trace reasoning dilutes cosine similarity without adding alignment signal. See calibration Section 3.5 for rationale.
Content features (TF-IDF from reasoning text) remain available for text-to-text comparison (e.g., SSM pairwise similarity between traces).
8.3 Calibration constants
The following thresholds are calibrated from empirical analysis:
The sustained-traces constant is named differently across the two SDKs:
DEFAULT_SUSTAINED_TURNS_THRESHOLD in the Python SDK, DEFAULT_SUSTAINED_CHECKS_THRESHOLD in the TypeScript SDK. Both default to 3.
Feature Extraction for Drift Detection (structural only):
60/30/10 TF-IDF Weighting (for text-to-text similarity, NOT drift detection):
These values were derived from analysis of approximately 50 multi-turn agent conversations totaling ~2,500 messages. See calibration for methodology and threshold derivation. Implementations MAY adjust thresholds based on their own calibration data but SHOULD document the methodology used.
8.4 Drift alert
When sustained divergence is detected:8.5 Drift categories
9. Security considerations
AAP’s threat model, trust boundaries, and cryptographic recommendations are specified in full on the dedicated Security page. In summary:- In scope: agents misrepresenting their alignment, agents failing to log decisions accurately, agents gaming coherence checks, man-in-the-middle attacks on handshakes.
- Out of scope: compromised agent runtime, adversarial principals, collusion between agents and verifiers.
- The reference SDKs’
verify_tracedoes not sign or hash-chain cards and traces — that is a recommended practice for implementers (Ed25519 signatures, append-only storage, TLS for handshake transport), not something the SDK provides by default. See Security for the concrete recommendations.
9.1 Known limitations
AAP cannot protect against:- Sophisticated deception: An agent can produce compliant traces while acting misaligned
- Trace omission: An agent can fail to log certain decisions
- Value gaming: An agent can declare values it does not hold
- Runtime compromise: If the agent runtime is compromised, all bets are off
10. Limitations
10.1 What AAP does not guarantee
This section is non-negotiable. Implementations MUST make these limitations clear to users. See Limitations for the full, worked-example treatment. 1. AAP does NOT ensure alignment—it provides visibility. AAP makes agent decisions observable. It does not make them correct, safe, or aligned. An agent can produce perfect AP-Traces while acting against its principal’s interests. 2. Verified does NOT equal safe. A verified trace means the trace is consistent with the declared alignment. It does not mean the declared alignment is good, the agent followed it in practice, or the outcome was beneficial. 3. AP-Trace is sampled, not complete. Traces capture decision points, not every computation. Significant reasoning may occur between traced decisions. The absence of a trace does not mean nothing happened. 4. Value coherence is relative to declared values. The handshake checks whether declared values are compatible. It does not verify that agents hold these values, will act on them, or that the values themselves are good. 5. Tested on transformer-based agents; unknown unknowns exist for other substrates. AAP was developed and tested with transformer-based language model agents. Agents built on different architectures (symbolic AI, neuromorphic computing, hybrid systems) may exhibit behaviors that AAP does not capture.10.2 Appropriate use
AAP is appropriate for:- Increasing observability of agent decisions
- Enabling audit and compliance workflows
- Facilitating agent coordination with transparency
- Detecting obvious misalignment or drift
- Certifying agents as “safe” or “trustworthy”
- Replacing human oversight for consequential decisions
- Providing security guarantees against adversarial agents
- Solving the general alignment problem
10.3 Recommendations
- Defense in depth: Use AAP as one layer of a multi-layer oversight system
- Human-in-the-loop: Maintain human oversight for consequential decisions
- Verification diversity: Use multiple verification approaches, not just AAP
- Continuous monitoring: Monitor for drift, don’t rely on point-in-time verification
11. Well-known URI convention
An agent MAY serve its current Alignment Card at/.well-known/alignment-card.json. This is a convention, not a registered media type or IANA well-known URI — there is no dedicated application/aap-*+json content type; implementations serve the card as plain application/json. Mnemom follows this convention for its own platform-scope card at https://www.mnemom.ai/.well-known/alignment-card.json.
12. References
12.1 Normative references
- [RFC2119] Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, March 1997.
- [RFC8174] Leiba, B., “Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words”, BCP 14, RFC 8174, May 2017.
- [RFC8259] Bray, T., “The JavaScript Object Notation (JSON) Data Interchange Format”, RFC 8259, December 2017.
- [RFC3339] Klyne, G. and C. Newman, “Date and Time on the Internet: Timestamps”, RFC 3339, July 2002.
12.2 Informative references
- A2A (Agent-to-Agent Protocol): https://google.github.io/A2A/
- MCP (Model Context Protocol): https://modelcontextprotocol.io/
- DID (Decentralized Identifiers): https://www.w3.org/TR/did-core/
12.3 Standards and regulatory references
- [ISO/IEC 42001:2023] ISO/IEC, “Information technology — Artificial Intelligence Management System”, 2023. https://www.iso.org/standard/42001
- [ISO/IEC 42005:2025] ISO/IEC, “Information technology — Artificial intelligence — AI system impact assessment”, 2025. https://www.iso.org/standard/42005
- [IEEE 7001-2021] IEEE, “Standard for Transparency of Autonomous Systems”, 2021. https://standards.ieee.org/ieee/7001/6929/
- [IEEE 3152-2024] IEEE, “Standard for Transparent Human and Machine Agency Identification”, 2024. https://standards.ieee.org/ieee/3152/11718/
- [IMDA MGF] IMDA Singapore, “Model AI Governance Framework for Agentic AI”, January 2026. https://www.imda.gov.sg/-/media/imda/files/about/emerging-tech-and-research/artificial-intelligence/mgf-for-agentic-ai.pdf
- [EU AI Act] European Union, “Regulation (EU) 2024/1689 — Artificial Intelligence Act”, Article 50 (Transparency obligations), enforcement August 2026. https://artificialintelligenceact.eu/article/50/
Appendix a: JSON schemas
A.1 Alignment Card schema
Seeschemas/alignment-card.schema.json for the complete, canonical unified JSON Schema.
A.2 AP-Trace schema
Seeschemas/ap-trace.schema.json for the complete JSON Schema.
A.3 Value Coherence messages schema
Seeschemas/value-coherence.schema.json for the complete JSON Schema.
Appendix b: Verification algorithm
B.1 Reference implementation
B.2 Drift detection algorithm
Appendix c: SDK version notes
This page describes the card shape and verification behavior shipped in SDK 2.0.0 (agent-alignment-protocol on PyPI, @mnemom/agent-alignment-protocol on npm). The headline change from 1.x is the migration to the unified card shape (Section 4.10). Other notable behavior changes:
- 2.0.1 (in the SDK changelog, not yet published to npm or PyPI) —
similarity_detailsshape unified across both SDKs (Section 7.4); Python’s card/trace feature extractor gains features to match TypeScript’s, sosimilarity_scorebecomes identical across languages for the same inputs. Scores computed before this change are not comparable to scores computed after. - 2.0.0 — Card shape migrated to unified (Section 4).
AutonomyEnvelope/AuditCommitmentSDK types renamed toAutonomy/Audit;AuditStorage/StorageTyperemoved;AlignmentMode(and theautonomy_mode/integrity_modecard fields) added. - 1.3.0 —
Decision.value_scoresadded: an optional, per-declared-value score (on_track/off_track/not_applicable) against a card’s catalogobserver_signals, keyed by value id. When present,values_appliedis derived from the entries scoredon_track. - 1.0.0 — Public API locked for stability; breaking changes now require a major version bump.
Agent Alignment Protocol Specification This document is released under CC BY 4.0