---
title: "Guardrail Digest"
method: GET
path: "/api/v1/memory/guardrails/digest"
tags: ["memory"]
---

# Guardrail Digest

`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

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>

## Query parameters

- `context_id` string, required: Context UUID whose tool guardrails to render
- `target` string: export (default): the AGENTS.md block as text/markdown; instructions: the exact MCP server instructions this credential would receive
- `profile` string, nullable: target=instructions only: the MCP URL's profile value (full | core)
- `tools` string, nullable: target=instructions only: the MCP URL's tools allowlist

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
