Skip to main content
This page is the canonical reference for everything a client integration needs to know about Mnemom API errors: which status codes the API emits, what each one means, the named error codes (Stripe-style) clients should branch on, retry semantics, and the Safe House verdict-to-status mapping.

Response shape

Every error response carries the same body shape:
Plus three response headers that are always set on errors:
  • X-Mnemom-Request-Id — UUIDv4. Paste this into a support ticket and we can pull every log line for the request.
  • X-Mnemom-Verdict — structured per-checkpoint verdict (see headers). Even on 4xx, the verdict reflects what Safe House observed before the error fired.
  • Retry-After — present on 429 and some 503 responses. The number of seconds to wait before retrying.
Branch on error.code, not on error.message. Messages are human-facing and may evolve; codes are stable contract.

Status codes at a glance

400 Bad Request — high-frequency codes

The most common 400 codes a client integration will encounter: The full taxonomy is auto-generated from mnemom-api/src/index.ts’s errorResponse(...) call sites and gates the CI contract — every emitted message corresponds to a documented code. If you see an unfamiliar 400 message, capture the X-Mnemom-Request-Id and open a support ticket; we treat that as a contract bug.

401 / 403 / 404 — auth and ownership

422 — Safe House quarantine

A 422 Unprocessable Entity is the dedicated status code for Safe House quarantine verdicts: the inbound message was structurally valid (so not 400) and you were authorized (so not 403), but the content tripped the quarantine threshold and the gateway is holding it for review instead of forwarding it to the upstream provider.
Use quarantine_id to fetch the held message via GET /v1/safe-house/quarantine/{quarantine_id} or, with operator role, to release it via POST /v1/safe-house/quarantine/{quarantine_id}/release.

429 — rate limits

429 responses always carry a Retry-After header. The value is seconds (integer per RFC 9110 §10.2.3):
Per-endpoint limits are documented on each endpoint’s reference page. The gateway-wide free-tier limits are documented in the pricing overview. Idempotent retries. When retrying after a 429, include an Idempotency-Key header — if the request actually went through and the gateway is reporting back the 429 (rare but possible mid-failure), the second attempt is idempotent on key match.

5xx / 529 — server-side and saturation

The distinction between 503 (downstream unhealthy) and 529 (gateway-saturated) matters for your fallback strategy: 503 means the gateway is fine but the LLM provider isn’t; 529 means the gateway itself is shedding load. A client that has a backup provider should switch on 503 but not on 529.

Safe House verdict-to-status mapping

The Safe House front-door inspects every inbound message and emits a verdict (pass | observed | nudged | enforced). When the agent’s protection.mode is enforce, the verdict drives the HTTP response: The same mapping applies symmetrically on the back-door (outbound screening) — though enforced outbound replaces or redacts content rather than dropping the response, so the customer-visible status is still 200 with a modified body. The X-Mnemom-Verdict response header reflects the full per-checkpoint state even on error responses — useful for distinguishing “front-door blocked” (front=enforced) from “agent’s own integrity intervention” (integrity=enforced).
integrity=unverified does not get its own status code. Unlike the Safe House front/back door, the integrity checkpoint has a fifth value, unverified — the analyzer timed out, errored, or the circuit breaker was open, so no trustworthy verdict was produced. This is never reported as pass. In integrity_mode: enforce, the response is withheld and replaced same-turn (fail-closed), the same way an enforced intervention is — still a 2xx, not a dedicated 4xx/5xx, since the intervention is delivered as the response body rather than as an error. In observe/nudge, the response is forwarded unmodified and the unverified state is recorded for post-hoc review. See X-Mnemom-Verdict for the full semantics.

Retry semantics summary

Idempotency-Key semantics + the Idempotent-Replay: true response echo are documented in the Headers reference.

See also

  • Headers — request-id, verdict structure, retry headers.
  • Safe House — the four-mode protection contract and three-layer detection model.
  • API Versioning Policy — what we will (and won’t) change about the error surface across versions.
  • API Overview — base URL, auth, rate-limit headers.