---
title: "Scaffold protection from a description"
method: POST
path: "/protection/scaffold"
tags: ["Protection"]
---

# Scaffold protection from a description

`POST /protection/scaffold`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/protection/scaffold`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`
  - API key in cookie `mnemom_session`

Calls an LLM (Claude Haiku by default; opt into Sonnet via `model: "sonnet"`) with the catalog and tools-registry context, returns a YAML manifest scaffold + care-framed reasoning prose + suggested catalog entries + coverage gaps. Never auto-commits — the caller reviews and edits before PUT. Cached by (model + scope + description + hints) hash; 24-hour TTL.

## Request body

- object
  - `description` string, required: Free-form description of the agent / scope. Untrusted input — the system prompt instructs the model not to follow embedded directives.
  - `scope` 'platform' | 'org' | 'team' | 'agent': Hint to the model about which scope the manifest will live at.
  - `hints` object: Free-form key/value hints (industry, risk_appetite, existing_tools, etc).
  - `model` 'haiku' | 'sonnet': Claude model to invoke. `haiku` is the default; `sonnet` for prose-heavy reasoning.

## Response `200`

Scaffold ready. Editable; never auto-commits.

- object
  - `ok` true, required
  - `resource` 'protection', required
  - `manifest` string, required: YAML body of the scaffolded manifest.
  - `reasoning` string, required: Care-framed prose explanation.
  - `suggested_catalog_entries` string[]
  - `coverage_gaps` object[]
    - `axis` string
    - `note` string, required
  - `parse_warnings` string[]
  - `cached` boolean, required: True when the response was served from the description-hash cache.
  - `model` string, required: Claude model id used for the call.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `413`: Request body exceeded the per-endpoint size cap. Cards-as-primitive sub-resource verbs cap each primitive body at 64 KiB; full-card PUTs cap at 128 KiB (alignment) / 64 KiB (protection).
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `502`: An upstream dependency returned an invalid response.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.
- `504`: An upstream dependency returned an invalid response.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
