# Guardrails

> MCP tools for the Guardrails module. See the [Guardrails module docs](/docs/modules/guardrails) for permissions and data model.

# Guardrails

MCP tools for the Guardrails module. See the [Guardrails module docs](/docs/modules/guardrails) for permissions and data model.

### `create-guardrail`

Create a guardrail

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | no | Public ID of the project |
| `name` | `string` | yes | Human-readable name |
| `description` | `string \| null` | no | — |
| `document` | `object` | yes | 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. |
| `context_tool_id` | `string \| null` | no | — |
| `context_mode` | `string` | no | — |
| `version_label` | `string` | no | Optional tag for the config version this write archives (e.g. `initial`). Annotates the version only — it is not stored on the guardrail and is not part of the config, so labelling a change is never itself a change. |

### `list-guardrails`

List guardrails

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `project_id` | `string` | no | Project public ID to filter by |
| `limit` | `number` | no | Maximum number of results to return |
| `offset` | `number` | no | Number of results to skip |

### `get-guardrail`

Get a guardrail

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |

### `update-guardrail`

Update a guardrail

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |
| `name` | `string` | no | — |
| `description` | `string \| null` | no | — |
| `document` | `object` | no | 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. |
| `context_tool_id` | `string \| null` | no | — |
| `context_mode` | `string \| null` | no | — |
| `version_label` | `string` | no | Optional tag for the config version this write archives (e.g. `pre-tightening`). Annotates the version only — it is not stored on the guardrail and is not part of the config, so labelling a change is never itself a change. Ignored when the write changes no policy, since no version is created. |

### `delete-guardrail`

Delete a guardrail

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |

### `list-guardrail-versions`

List a guardrail's config versions

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |
| `limit` | `number` | no | Maximum number of results to return |
| `offset` | `number` | no | Number of results to skip |

### `get-guardrail-version`

Fetch an archived guardrail version

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |
| `version` | `number` | yes | — |

### `restore-guardrail-version`

Restore an archived guardrail config

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |
| `version` | `number` | yes | — |
| `label` | `string` | no | Optional tag for the version the restore creates. Defaults to `restored from v<version>`. |

### `evaluate-guardrail`

Dry-run evaluate a guardrail

#### Arguments

| Argument | Type | Required | Description |
| -------- | ---- | -------- | ----------- |
| `guardrail_id` | `string` | yes | — |
| `args` | `object` | no | The proposed call's arguments (the `args.*` namespace). |
| `guardrail_context` | `object` | no | The caller-supplied guardrail context (the `context.*` namespace), combined with the context tool per `context_mode`. |
| `tool_id` | `string` | no | Optional tool to resolve `runtime.tool.*` against. |
