AP-Traces capture significant decisions, not every computation. They use a sampling approach: each trace records a decision point where the agent chose between alternatives, applied values, and evaluated escalation triggers. The absence of a trace does not mean nothing happened.
Why AP-Traces exist
Alignment Cards are declarations. Without evidence, they are just promises. AP-Traces provide the evidence layer — structured records that can be programmatically checked against the card to determine whether the agent’s behavior matches its declarations. This enables three verification levels:Trace structure
An AP-Trace contains four required blocks and one optional block:Identity fields
Every trace begins with identity fields that link it to a specific agent and Alignment Card:card_id is critical: it binds the trace to the specific Alignment Card in effect when the decision was made. Verification always checks the trace against this referenced card, not the agent’s current card.
Action block
The action block describes what the agent did or considered doing:
The
category field is what verification checks first. A bounded action must appear in the card’s bounded_actions list. A forbidden category should never appear in a compliant trace.
Decision block
The decision block records the agent’s reasoning process — the alternatives it evaluated, how it scored them, which it selected, and why:- alternatives_considered: At least one alternative must be present. Each includes a description, optional score, and optional flags (concerns about that option).
- selected: Which alternative was chosen.
- selection_reasoning: Human-readable explanation of why this option was selected.
- values_applied: Which declared values influenced the decision. These are checked against the card during verification.
- confidence: Decision confidence from 0.0 to 1.0 (optional).
Escalation block
The escalation block records whether escalation triggers were evaluated and what happened: When no escalation is needed:MISSED_ESCALATION violation.
Context block
The context block provides optional session and environment metadata:How traces are generated
AP-Traces can be generated through two mechanisms:Gateway-level generation
In a Mnemom deployment, the Gateway Worker routes requests and the Observer Worker processes logs asynchronously. The Observer extracts trace data from gateway logs, builds AP-Trace structures, and stores them. This happens automatically, with no SDK integration required from the agent developer.Unclaimed agents: gateway-level AP-Traces are best-effort only. The Observer depends on Cloudflare metadata surviving to the observer layer; this is not guaranteed for gateway-auto-provisioned agents that have not been claimed. Additionally, AP-Traces reference a
card_id — unclaimed agents have no canonical alignment card, so traces cannot be verified against one. Full guaranteed trace generation starts after the agent is claimed. See integrity during the unclaimed phase.SDK-level generation
Agents using the AAP SDK can generate traces directly:Verification
Verification checks a trace against its referenced Alignment Card. The algorithm performs five checks:- Autonomy compliance: Is the action’s
categoryconsistent with the autonomy envelope? Bounded actions must be inbounded_actions. - Forbidden action compliance: Is the action name absent from
forbidden_actions? - Escalation compliance: Were all matched escalation triggers properly escalated?
- Value consistency: Are all
values_appliedin the card’sdeclaredvalues? - Behavioral similarity: Is the trace’s behavioral fingerprint semantically similar to the card?
Violation types
Behavioral similarity
Beyond structural checks, verification computes a behavioral similarity score using SSM (Self-Similarity Matrix) analysis. This catches cases where a trace passes all structural checks but the overall behavior pattern diverges from what the card describes. The threshold is0.50. A trace that passes structural checks but scores below 0.50 on behavioral similarity receives a low_behavioral_similarity warning — not a violation, but a signal for investigation.
Trace storage and querying
Traces are append-only: once created, they must not be modified. Storage options are declared in the Alignment Card’saudit_commitment block.
If queryable is true, the agent exposes a query endpoint where principals and auditors can retrieve traces:
Complete example
Design principles
- Sampling, not completeness. Traces capture significant decisions, not every internal computation. This keeps overhead manageable while providing meaningful audit data.
- Structured reasoning. Decision rationale is machine-parseable, not free-form text. This enables automated verification at scale.
-
Verifiable references. Every trace references the Alignment Card in effect via
card_id. This makes verification unambiguous. - Append-only. Traces must not be modified after creation. This ensures audit trail integrity.
See also
- Alignment Cards — The declarations that traces are verified against
- Drift Detection — How traces across sessions reveal behavioral drift
- Integrity Checkpoints — Per-turn analysis that enriches traces
- AAP Specification — Full normative specification