---
title: "List a guardrail's config versions"
method: GET
path: "/v1/projects/{project_id}/guardrails/{guardrail_id}/versions"
tags: ["Guardrails"]
---

# List a guardrail's config versions

`GET /v1/projects/{project_id}/guardrails/{guardrail_id}/versions`

## Request

- Base URL: `https://api.naturali.ai`
- URL: `https://api.naturali.ai/v1/projects/{project_id}/guardrails/{guardrail_id}/versions`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.naturali.ai/authorize`, token URL `https://api.naturali.ai/token`, scopes: `mcp:access`)

Returns the guardrail's archived configurations, newest first. A version is written on create and on every subsequent write that changes the policy `document` — through the REST API or a formation apply alike. Metadata-only edits (name, description, context binding) do not archive a version. See [Versioning](/docs/modules/guardrails#versioning).

## Path parameters

- `guardrail_id` string, required

## Query parameters

- `limit` integer
- `offset` integer

## Response `200`

List of guardrail versions, newest first

- object
  - `data` GuardrailVersion[], required
    - `id` string: Public ID of the archived version
    - `guardrail_id` string: Public ID of the guardrail this version belongs to
    - `version` integer: The archived version number
    - `config` object: The guardrail's versioned surface as it stood at this version. Today that is the policy `document` and nothing else: name, description and the context binding are metadata, and bumping the version when one of them changes would make two version numbers denote the same policy — which is exactly what an evaluation record cites. Deliberately open rather than a fixed schema: an archive written by an earlier release of the runtime reflects the guardrail surface **of its own time**, so it may carry fields the current API no longer documents.
      - `document` GuardrailDocument: The action-class document. `class` maps a call to an action class; `guard` gates class-B autonomy. Both are single JSON Logic expressions over the `args.*` / `context.*` / `runtime.*` namespaces.
        - `class` union, required: A class literal (`A` / `B` / `C` / `D`) or a JSON Logic expression returning one. An invalid result resolves to `default_class`.
          - 'A' | 'B' | 'C' | 'D'
          - object
        - `default_class` 'A' | 'B' | 'C' | 'D': Applied when the `class` expression returns anything other than a valid class. Defaults to `C` (fail-closed).
        - `guard` object: A single JSON Logic expression; when the call classifies as `B` it must evaluate truthy to execute autonomously. Compose multiple conditions with `{ "and": [...] }`.
        - `escalate` boolean: When `true`, a failing guard routes to approval instead of tripping fail-closed.
        - `expires_in` integer: Default approval window in seconds for a class-C approval this guardrail files. Omitted → the platform's 24h default. When several guardrails apply, the governing (strictest-matching) one's value is used.
    - `label` string, nullable: Optional human tag for this version, e.g. `pre-tightening`. Set from the `label` field of a restore, or generated for one.
    - `created_by_principal_type` 'user' | 'api_key' | 'agent' | 'automation' | 'approval' | 'system': What kind of principal acted. `user` and `api_key` are authenticated callers, and the id is the user's (`user_…`) or the key's own (`key_…`), so a record names which key acted rather than its owner. `agent` is an agent writing under its own identity (`agent_…`). `automation` is the task engine acting on a dispatch outcome and `approval` an approval resolution; neither carries an id. `system` is the platform itself, with an id naming the mechanism (`retention_sweep`, `zero_retention`).
    - `created_by_principal_id` string, nullable: Public id of that principal: the user (`user_…`), or for API key auth the key itself (`key_…`), so the record names which key acted.
    - `created_at` string, date-time
  - `total` integer, required
  - `limit` integer, required
  - `offset` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Guardrail not found

---

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