memory

Guardrail Digest

Render a context's tool guardrails for clients without tool hooks (#1621).

The export target is the block a Codex cloud setup script (or any always-loaded-file recipe) writes into AGENTS.md:

<!-- kagura-memory:guardrails begin context=<uuid> tool_triggered_version=<hash> -->
- (<id8>) <summary>
<!-- kagura-memory:guardrails end -->

The instructions target previews the MCP instructions string lane (a) would serve this credential for this context — profile / tools reproduce the URL's tool view so the truncation suffix names the same tool. Same trusted-only read and binding filter as load_guardrails, same uniform 404 on a denied, unknown or other-workspace context; an external-tier or unmarked context is a 200 with an empty body (export) or the base text (instructions). With mcp_guardrail_digest_enabled off the preview is the base text for every context — exactly what lane (a) serves then. Never cached (private, no-store); the body is editor-authored text, so it is served with nosniff. Contract: MCP Tools › Server instructions.

Example: GET /api/v1/memory/guardrails/digest?context_id=<uuid> Authorization: Bearer <api_key>

get/api/v1/memory/guardrails/digest

Request

  • Base URL: https://memory.kagura-ai.com (the document declares no server; this is the origin it was published from)
  • URL: https://memory.kagura-ai.com/api/v1/memory/guardrails/digest
  • Auth: none declared

Query parameters

context_idstring required

Context UUID whose tool guardrails to render

targetstring

export (default): the AGENTS.md block as text/markdown; instructions: the exact MCP server instructions this credential would receive

profilestring nullable

target=instructions only: the MCP URL's profile value (full | core)

toolsstring nullable

target=instructions only: the MCP URL's tools allowlist

Headers

authorizationstring nullable

Response

Successful Response

Changes

No recorded changes to this operation across all 2 revisions of this API.