Mnemom Gateway
The Mnemom Gateway is a transparent AI gateway that sits between your application and any LLM provider. It provides the full Mnemom trust stack out of the box:- Verifiable AP-Traces
- Real-time AIP integrity checks
- Policy enforcement from the alignment card’s
capabilitiesandenforcementsections - Safe House protection configured via the protection card
- Verification against the agent’s alignment card
Authenticate
Log in to your Mnemom account:This opens a browser-based login flow and stores your auth token in
~/.mnemom/auth.json.Your provider API keys are not sent to Mnemom. Only SHA-256 hashes are used to identify your agent. The hash cannot be reversed to recover your key.
Make an API call
Use the gateway URL instead of the provider’s direct URL. Include the The gateway supports all three providers at their standard paths:
x-mnemom-agent header to name your agent — it will be auto-created on first call in the Mnemom Sandbox with no owner. Before the read commands (mnemom status, logs, integrity, card show) can resolve it, you must claim the agent to your account (next step). Use -i to print response headers so you can capture the X-Mnemom-Agent id you’ll need for the claim.| Provider | Gateway Path | Direct Equivalent |
|---|---|---|
| Anthropic | gateway.mnemom.ai/anthropic/* | api.anthropic.com/* |
| OpenAI | gateway.mnemom.ai/openai/* | api.openai.com/* |
| Gemini | gateway.mnemom.ai/gemini/* | generativelanguage.googleapis.com/* |
What you'll want to read on the way back
The gateway adds response headers that carry the Safe House verdict, support-correlation metadata, and advisory entries. A compliant integration should parse and observe these — at minimum surface them when something goes wrong.
Quick parse:See the Headers reference for the full canonical set + per-language parsers, and the Errors reference for the verdict-to-status mapping (when
| Header | When emitted | What to do with it |
|---|---|---|
X-Mnemom-Request-Id | Always | UUIDv4 per request. Always log this. Paste into a support ticket and we can pull every log line for the request. |
X-Mnemom-Verdict | Always (gateway) | Structured front=…; autonomy=…; integrity=…; back=… with each value in {pass | observed | nudged | enforced}. Parse it; the four-checkpoint state tells you what Safe House observed (front+back), what CLPI did on tool calls (autonomy), and what AIP did on reasoning (integrity). |
X-Mnemom-Advisory | When the gateway has advisories | Compact JSON [{source, text, severity?, id?}, …]. Surface entries to your operator UI / logs. Omitted entirely when empty. |
X-Mnemom-Agent | When the request is bound to a named agent | The agent identifier the gateway resolved your request to (e.g., mnm-a1b2c3d4…). Useful for cross-referencing dashboard rows. |
X-Mnemom-Session | On multi-turn sessions | Stable session correlation token. Echo it back on the next turn to maintain session continuity. |
Retry-After | On 429 and some 503 | Seconds to wait before retrying. Honor it. |
enforced becomes a 422 quarantine or 403 block).Claim your agent
The gateway created your agent in the shared Mnemom Sandbox (no owner). Claiming it proves you hold the provider key and moves it into your account so all read commands can resolve it.Copy the Replace
X-Mnemom-Agent value from the response headers above, then run:mnm-550e8400-e29b-41d4-a716-446655440000 with the actual id from your X-Mnemom-Agent header.- Pass
--namematching thex-mnemom-agentvalue you sent on the gateway call (omit--nameif you made that call without the header). If the id,--name, or--keydon’t resolve to a real agent, the claim returns404— re-check theX-Mnemom-Agentid and that--name/--keymatch the gateway call. - The key is hashed locally (SHA-256) and never sent to Mnemom.
- The agent lands in your personal org by default; pass
--org <slug>to claim into a shared org. - The operation is idempotent — safe to run more than once.
A
503 response means your personal org is still being provisioned. Wait a few seconds and retry. For 403 cross-tenant or not-a-member errors, see the Agent claim flow guide.View traces
After making API calls through the gateway, view what was traced:Use
Output
mnemom logs --agent my-agent -l 20 to show more entries.View your alignment card
See the alignment card assigned to your agent:Customize it by publishing your own card:
Explore the dashboard
Your agent’s data is available at mnemom.ai/dashboard once you are logged in. The dashboard shows:
- Conscience timeline — A chronological view of every trace, integrity checkpoint, and enforcement action
- Alignment card — Your agent’s declared values and boundaries
- Integrity scores — AIP verdict history and trend analysis
- Drift alerts — Notifications when behavior diverges from declared alignment
- Enforcement log — Records of nudges and blocks (if enforcement is enabled)
Named agents
If you run multiple agents behind the same API key, use thex-mnemom-agent header to give each one a distinct identity. The provider path stays unchanged — the gateway hashes SHA256(apiKey + '|' + agentName) to derive a unique agent ID. See Agent Identity for the full ID derivation, the auto-create vs programmatic registration paths, and how key rotation interacts with agent identity.
Supported providers
| Provider | Models | Thinking / AIP Support | Auth Header |
|---|---|---|---|
| Anthropic | Claude Opus 4.7, Sonnet 4.6, Haiku 4.5 | Full (thinking blocks analyzed directly) | x-api-key |
| OpenAI | GPT-5.2, GPT-5.2 Pro, GPT-5 | Via reasoning summaries (reduced confidence) | Authorization: Bearer |
| Gemini | Gemini 2.5 Pro, Gemini 3 Pro | Full (thought parts analyzed directly) | x-goog-api-key |
AIP compatibility
| Provider / Model | AIP Support | Method |
|---|---|---|
| Anthropic reasoning models (Opus, Sonnet) | Full | Thinking blocks analyzed directly |
| OpenAI GPT-5 Thinking series | Partial | Reasoning summaries (reduced confidence) |
| Gemini 2.5/3 with thinking | Full | Thought parts analyzed directly |
| Non-reasoning models | Tracing only | Synthetic clear verdict |
| Legacy OpenAI (o3/o4-mini) | Unsupported | Reasoning encrypted |
Thinking elements in proxied responses. Safe House / AIP enables extended thinking to analyze the agent’s reasoning in real time. Proxied responses therefore include a
thinking content element in the content array alongside the standard text block. Clients that assume text-only content arrays should be updated to handle or ignore thinking blocks. Thinking output tokens are billed as standard output tokens — this behavior is intentional and cannot be disabled.What gets traced
The Mnemom Gateway builds AP-Traces that record:- Action — What the agent did (type, name, category)
- Decision — What alternatives were considered and why one was selected
- Escalation — Whether the agent escalated to a human and why
- Verification — Whether the trace is consistent with the agent’s declared Alignment Card
- Integrity — Real-time AIP analysis of thinking blocks, with verdict (
clear/review_needed/boundary_violation)
What is NOT stored
Enforcement modes
The Mnemom Gateway supports three enforcement modes when an integrity violation is detected:| Mode | Behavior |
|---|---|
observe | Detect violations, record them, take no action (default) |
nudge | Detect violations, inject feedback into the agent’s next request via system prompt. The agent sees it and can self-correct. |
enforce | Hard block with HTTP 403 for non-streaming requests. Falls back to nudge for streaming. |
integrity_mode and autonomy_mode are top-level fields on the alignment card; the legacy /v1/agents/{id}/enforcement endpoint was retired 2026-05-14.
Three paths, pick the one that fits your workflow:
- Dashboard: open
https://mnemom.ai/dashboard/agents/{your-agent-id}/card, toggleintegrity_mode, save. Easiest path. - CLI:
mnemom card editopens the current alignment-card YAML in$EDITOR; changeintegrity_mode: nudge, save, the CLI publishes + recomposes. - Programmatic:
PUT /v1/alignment/agent/{agent_id}with the full canonical card. See the Card Management guide for the read-modify-write flow and the alignment-card schema for field requirements.
Next steps
- View protocol overview to understand how AAP, AIP, and CLPI work together
- Set up policy enforcement to define governance rules for your agent’s tool usage
- Explore concepts to understand Alignment Cards, traces, and integrity
- CLPI overview to understand the governance layer (policy enforcement, trust recovery, on-chain anchoring)
- Read about enforcement for detailed enforcement mode documentation
- Self-host if you need full data residency control