Documentation Index
Fetch the complete documentation index at: https://mnemomllc-feat-aip-output-analysis-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AP-Traces
An AP-Trace (Alignment Protocol Trace) is a structured audit log entry that records an agent’s decision process — the action it took, the alternatives it considered, the reasoning behind its choice, and whether escalation was evaluated. AP-Traces are the behavioral evidence that makes Alignment Cards verifiable. Where an Alignment Card says “what I claim to be,” an AP-Trace says “what I actually did.”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:| Level | Scope | Question |
|---|---|---|
| Trace verification | Single decision | Did this action comply with the card? |
| Session verification | One session | Was the agent consistent throughout this session? |
| Longitudinal verification | Multiple sessions | Is the agent drifting from its declared alignment? |
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:| Field | Description |
|---|---|
type | Action type: recommend, execute, escalate, or deny |
name | Human-readable action name |
category | How the action relates to the autonomy envelope: bounded, escalation_trigger, or forbidden |
target | The resource affected (optional) |
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.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
| Type | Severity | Description |
|---|---|---|
UNBOUNDED_ACTION | HIGH | Action not in the bounded_actions list |
FORBIDDEN_ACTION | CRITICAL | Action in the forbidden_actions list |
MISSED_ESCALATION | HIGH | Escalation trigger matched but agent did not escalate |
UNDECLARED_VALUE | MEDIUM | Agent applied a value not in its declared values |
CARD_EXPIRED | HIGH | The referenced Alignment Card has expired |
CARD_MISMATCH | CRITICAL | Trace references a different card than the one provided |
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.
Further Reading
- Alignment Cards — The declarations that traces are verified against
- Drift Detection — How traces across sessions reveal behavioral drift
- Integrity Checkpoints — Real-time analysis that enriches traces
- AAP Specification — Full normative specification