Skip to main content
Safe House is an optional pre-screening layer that sits in front of your AI agent and evaluates every inbound message. Where AIP integrity checkpoints analyze the agent’s reasoning, Safe House analyzes what is being sent to the agent. In enforce, a flagged message is caught before it reaches the model; in observe and nudge the message is forwarded and the verdict is recorded post-hoc (nudge surfaces an advisory on the next turn). The front door is not a once-per-turn gate. It runs on every inbound surface a request carries — the user message and each tool result travelling back to the model in that same request body — and every one of those runs happens before anything is forwarded upstream. See When the front door runs.

Where it runs

Safe House ships in two deployment shapes:
  • Managed (Mnemom-hosted) at gateway.mnemom.ai. The default path; the gateway terminates incoming requests, runs Safe House inspection, and proxies the cleaned request to your upstream LLM provider. See Gateway quickstart for setup.
  • Self-hosted. Deploy the gateway in your own infrastructure (VPC, on-prem, air-gapped) — same code, same verdict semantics, no traffic leaves your network. See Self-hosted quickstart for setup.
Both shapes use the same Safe House contract and the same headers; switching between them is a deployment decision, not an API contract change.

Why Safe House exists

Agents that operate in the open world face a threat class that alignment cards and integrity checks cannot address: malicious inputs crafted specifically to hijack the agent. These attacks do not look like boundary violations — they look like normal messages. By the time AIP flags the resulting behavior, the agent has already been manipulated. Safe House solves this by treating every inbound message as untrusted until it passes inspection — and a tool result is an inbound message, screened on the way back to the model rather than waved through because the agent asked for it. It does not replace AIP or enforcement modes — it extends them. A message or tool result that Safe House quarantines never reaches the model, so there is no behavior for AIP to analyze in the first place.
Safe House is off by default for all agents. Enabling it in observe mode first is strongly recommended — it gives you a picture of your threat landscape with zero operational impact before moving to nudge or enforce.
You can turn Safe House on and configure it per-agent from the dashboard’s Security tab, or via the API/CLI as shown in the quickstart — both read and write the same protection card, so either path is fully interchangeable and neither is more “canonical” than the other.

Modes

Safe House uses the canonical four-mode enum shared with the Protection Card and the Alignment Card master switches. Same words, same semantics, same UI picker.

Off

Detection is skipped entirely. No analysis, no telemetry, no headers. The agent’s traffic passes through unchanged.

Observe

Full evaluation runs, but the response is returned without being gated this turn; the verdict is recorded post-hoc and surfaced in the X-Mnemom-Verdict response header, while session-risk scores are logged to the Observatory (operator-dashboard only, not a response header). Zero operational impact on the transaction — no message is blocked, no advisory is injected. Use this to characterize your threat landscape before escalating.

Nudge

Detectors run; matches attach an advisory annotation to the agent’s prompt context (and an X-Mnemom-Advisory response header) but the request proceeds. The model sees the advisory as part of its context and can adjust behavior accordingly.

Enforce

Full synchronous analysis. Messages that score above the quarantine threshold are held in a review queue; messages above block are dropped entirely. This is the only mode that actively blocks the agent’s traffic.
Vocabulary canonicalization. Earlier releases of this page documented disabled / simulate / observe / enforce. The canonical vocabulary is off / observe / nudge / enforce — the same enum used by the Protection Card, the Alignment Card master switches, and the cross-tenant AEGIS Managed Rules. The legacy simulate mode has been merged into observe (full evaluation, no blocking); disabled has been renamed off. The new mode is nudge (advisory injection without blocking) between observe and enforce.

Three-layer detection

Safe House uses a layered approach that balances speed with accuracy: L1 runs first and can short-circuit the pipeline entirely for high-confidence detections. If L1 passes or returns a warn score, L2 runs. L3 operates continuously across the session, not per-message. The L1→L2 pipeline runs once per screened surface, not once per turn. A request that carries a user message plus two tool results runs it three times, each with its own surface label and its own verdict.

L2 and the org’s protected_surface

L2 reads the agent’s canonical protection card’s protected_surface — the org-owned, composed result of platform → org → team → agent — as its source of truth when evaluating whether an action touches a protected asset or matches a forbidden operation:
  • Coverage is workload-independent. An empty or naive agent still gets the org’s protected_surface enforced. The org floor does not depend on what the agent declared in its alignment card.
  • Org-defined, not agent-declared. The org authors protected_surface; the agent cannot narrow it.
  • Judge precedence. L2 evaluates the conjunction of action + protected asset + forbidden operation. Precedence: forbidden_operation > escalation_required > allow. An asset-scoped match is a sharper signal than a global one.

Threat categories

Safe House classifies detected threats into nine categories:

Multilingual coverage

L1 heuristics cover English, French, German, Italian, Spanish, Portuguese, Japanese, and Chinese. L2 (Haiku analysis) handles all languages — attacks in languages outside the L1 set are still caught, but only at the L2 stage with its additional ~80–100ms latency.

Response headers

Safe House adds headers to every gateway response so your application can inspect verdicts:
Legacy X-Safe-House-* headers were retired clean-break on 2026-05-08X-Safe-House-Verdict folds into X-Mnemom-Verdict.front/.back, X-Safe-House-Quarantine-Id folds into the X-Mnemom-Advisory entry’s id field, and X-Safe-House-Session-Risk (along with X-Safe-House-Mode and X-Safe-House-Simulated-Verdict) was an operator-dashboard-only signal that was never re-surfaced as a header — that data lives in the Observatory / sh_evaluations / audit_log, not in response headers. There is no dual-emit window. See What was retired for the complete legacy → canonical mapping.

Canary credentials

Safe House supports planting fake API keys and tokens inside agent context. If an attacker successfully exfiltrates agent context and attempts to use a canary credential, Safe House detects the usage with zero false positives — a real key would never be “used” in an inbound message. Configure canaries in the Safe House config:
Any inbound message containing a canary pattern triggers an automatic block verdict regardless of other scoring, and emits a safe_house.canary_triggered webhook event.

Source trust

trusted_sources on the protection card is a typed allowlist with three buckets. A match on any bucket short-circuits the detector pipeline for that message — no detector cycles spent, but every skip emits a low-priority sh_trusted_source_skip audit trace so reviewers can see exactly what was waved through.
Trust is binary — a match means “skip detection.” Earlier designs that exposed a graduated risk_multiplier were withdrawn during the schema unification; tuning sensitivity is the job of thresholds.{warn, quarantine, block}, not per-source weights. Composition across scopes follows the same intersection-then-union rule as the rest of the card: the platform list is the compliance ceiling (downstream cannot widen trust), and org + agent take the union within that ceiling. Security note: the validator’s deny-list is non-exhaustive — adding a publicly-routable IP range or a customer-controllable domain is a critical misconfiguration even if it passes the deny-list. Treat trusted_sources as a sharp tool. See the canonical schema at /specifications/protection-card-schema#trusted_sources.

When the front door runs

The front door is not a single pre-turn gate that input passes through once. It runs once per inbound surface carried by a request, and every one of those runs is turn-internal: the gateway awaits each verdict and acts on it before the request is forwarded to the provider. For a request that carries tool results back to the model, that means:
  1. The gateway extracts the tool results from the inbound body of that same request, when screen_surfaces.tool_responses is enabled. This extraction is not guaranteed to cover every tool result in a request that fans out to many tool calls in a single turn.
  2. Each one is screened on its own tool_result surface: its own L1 pass, its own L2 judgement, its own verdict. Synchronously, in the request path — not backgrounded, not queued.
  3. The per-tool verdicts act on this request, before dispatch. block and quarantine withhold the offending tool result — its content is replaced with a quarantine notice, so the model never sees the payload. warn decorates it: delivered, but annotated as untrusted. pass forwards it unchanged.
  4. Only then is the request body re-serialized and sent upstream. That re-serialization is the single choke point; whatever the front door decided is already baked into it.
This is a front-door check, not an AIP check. AIP is a response-side pass over the model’s reasoning — by the time it runs, the model has already read whatever the front door let through. Tool-result screening is not deferred to AIP and is not deferred to the agent’s next turn; AIP sits behind the front door as defense in depth, not in front of it as the primary control.
Verified against the gateway source. In mnemom/mnemom-platform at commit c8122e65, judgeShadowScreen() is defined at gateway/src/index.ts:7683 and is called with sourceType: "tool_result" at three sites:
  • gateway/src/index.ts:8088 — the synchronous acting chain. This is the call whose per-tool decisions the request path then applies (withhold / decorate) before the body is forwarded.
  • gateway/src/index.ts:7990 — the shadow chain, fired via waitUntil after the acting decision. Recording only; it can never change acting behaviour and adds no response-path latency.
  • gateway/src/index.ts:14977 — the observe recorder, which never modifies the message.
All three run inside the lifecycle of the request that carried the tool results.

Bidirectional screening

Safe House screens in both directions:
  • Inbound: Evaluates user messages and tool results before they reach the model — each on its own surface, in the request that carries it (the primary use case). See When the front door runs.
  • Outbound screening: Scans agent responses for data leaks — PII patterns, secret formats, or content that should not leave the agent’s context. In enforce, a flagged response is caught before it is returned to the caller (which adds latency); in observe and nudge the response is returned and the finding is recorded post-hoc.
Outbound screening is configured separately and applies regardless of inbound mode.

Integration with AIP

When Safe House is active, its threat context enriches the AIP conscience analysis. If a message passes Safe House but scored close to a threshold, that score is included in the conscience prompt so AIP can apply extra scrutiny to the resulting reasoning. The signal flows in both directions: a high AIP boundary-violation rate for a session elevates Safe House’s L3 session risk score. AIP is downstream of the front door, not a substitute for it. Injection carried in a tool result is intercepted at the front door in the request that carries the tool result; AIP catches what survives that, by reading the reasoning the model produced afterwards.

The four artifact types

Safe House’s runtime treatment is configured by two parallel cascades of named-object artifacts: Trust Posture vs. Cards covers in detail why these are parallel artifact types (postures don’t fold into cards; cards don’t fold into postures) and the two well-defined join points where they cooperate (detector input + carryover bridge).

Safe House and AEGIS

Safe House is the per-customer perimeter. AEGIS is the cross-tenant defensive network above it — connecting all Safe House customers, identifying signals that tie events across customers into single campaign signatures, and feeding signed Managed Rules back to every gateway in the network. Per-customer Safe Houses detect on what they can see; AEGIS sees across all of them. See Protection Network for the five-layer L0-L5 model AEGIS adds on top of Safe House, and Managed Rules for the signed rule pipeline AEGIS pushes to the Safe House gateway.

Publish your protection card

Safe House is configured via the agent’s protection card. Edit it visually from the dashboard’s Security tab, or author it as YAML and push it to the platform — save this as protection.card.yaml, fill in your agent_id, and publish:
Start with mode: observe — full detection, no blocking — then move to nudge or enforce once you have a picture of your threat landscape. See Protection Card Schema for all fields and composition rules. screen_surfaces.tool_responses is what enables the turn-internal tool-result screen described in When the front door runs. It ships false in this starter card so that a first observe rollout costs nothing on the tool path; with it off, tool results reach the model unscreened and indirect injection has an open lane. Turn it on before you rely on Safe House for indirect-injection coverage.

See also