> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/guardrails.md).

# guardrails

Safety and compliance checks (`adaptorType: GuardrailImport`) that validate data flowing through integrations — PII detection, content moderation, and custom AI-based evaluation. Unlike [`ai-agents`](https://developer.celigo.com/cli/commands/ai-agents.md), which produce content with LLMs, guardrails screen content: they flag, reject, or mask records that violate policy.

**REST API**: Guardrails are a specialized import adaptor (`GuardrailImport`). Schemas live in the imports spec — see the `Guardrail` and `GuardrailImport` components. The CLI filters and auto-tags `/v1/imports` so every call targets a guardrail-shaped record.

```
celigo guardrails <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                                  | Purpose                                                                                               |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `list`                                      | List all guardrail imports in the account.                                                            |
| `get <id>`                                  | Fetch one guardrail by ID.                                                                            |
| `create`                                    | Create a guardrail from a JSON body (`--file <path>` or stdin; `adaptorType` auto-set).               |
| `update <id>`                               | Full replace from a JSON body (`--file <path>` or stdin); destructive `PUT`.                          |
| `set <id> key=value …`                      | Safe field edit: whitelisted fields as one atomic `PATCH`, others through `GET` → modify → `PUT`.     |
| `delete <id>`                               | Delete a guardrail.                                                                                   |
| `invoke [id]`                               | Invoke a saved guardrail against piped records, or preview a piped guardrail doc when no id is given. |
| `enable-debug <id>`                         | Enable debug logging via `PATCH` on `debugUntil`.                                                     |
| `disable-debug <id>`                        | Clear `debugUntil`.                                                                                   |
| `clone <id>`                                | Clone the guardrail (same-env or cross-env).                                                          |
| `replace-connection <id> <newConnectionId>` | Replace the underlying connection (BYOK `ai_agent` guardrails only).                                  |

***

## `celigo guardrails list`

List every guardrail import in the account. The CLI fetches `/v1/imports` and filters client-side to rows where `adaptorType === "GuardrailImport"`.

**Signature**

```bash
celigo guardrails list [--fields <spec>]
```

**Arguments**

None.

**Flags**

| Flag              | Type   | Default   | Description                                                                                                                                                                                                                                                                                                                                                        |
| ----------------- | ------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--fields <spec>` | string | `default` | Fields to request per row: `default` (`_id`, `name`, and the table columns), `all` (complete documents), or a comma-separated field list (dot notation allowed). `adaptorType` is always requested too, because the CLI filters on it. See [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md#field-projection-on-list-commands). |

Table columns: `_id`, `name`, `guardrail.type`, `lastModified`. Since celigo-cli 2026.11.2, `--fields a,b,…` with `--format table` draws `_id`, `name`, and the fields you name instead. There is no `--limit`: the filter runs client-side over every import.

**Example**

```bash
celigo guardrails list --format table
```

**Corresponds to**: [`GET /v1/imports`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#get-v1-imports) (client-side filter on `adaptorType`)

***

## `celigo guardrails get`

Fetch a single guardrail import by ID.

**Signature**

```bash
celigo guardrails get <id>
```

**Arguments**

| Argument | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| `<id>`   | string | Yes      | Guardrail import `_id`. |

**Example**

```bash
celigo guardrails get 65f1a7b2c3d4e5f6a7b8c9d0
```

**Corresponds to**: [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#get-v1-imports-_id)

***

## `celigo guardrails create`

Create a guardrail import from a JSON body — read from a file with `-f, --file`, or piped on stdin. The CLI sets `adaptorType = "GuardrailImport"` before posting, so you don't need to include it in the payload. Since celigo-cli 2026.10.1, a body whose `adaptorType` names another import type is refused instead of overwritten:

```
Refusing to create a guardrail: the body's adaptorType is HTTPImport, not GuardrailImport — this group never changes an import's type; `celigo imports` writes other import types.
```

Since celigo-cli 2026.10.1, the body is also checked as `imports create` checks one: a body that is not a JSON object, masked `"******"` credential placeholders, and a `responseMapping` object wrapper are refused before any request, with no override, and the body is validated against the published API schemas — findings print as `warning` lines on stderr and never block.

**Signature**

```bash
celigo guardrails create --file <path>
celigo guardrails create < guardrail.json     # or pipe on stdin
```

**Arguments**

None.

**Flags**

| Flag                | Type   | Default | Description                                                                    |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). |

**Request body**

See the `Guardrail` and `GuardrailImport` schemas for the full payload shape (type, confidence threshold, and the `pii` / `moderation` / `aiAgent` sub-configurations). Key fields:

* `guardrail.type` — one of `pii`, `moderation`, `ai_agent`.
* `guardrail.confidenceThreshold` — detection threshold (0–1, default `0.7`).
* `guardrail.pii.entities[]` / `.mask` — required for `pii`.
* `guardrail.moderation.categories[]` — required for `moderation`.
* `guardrail.aiAgent` — required for `ai_agent`; same shape as an `agents` config, including optional `_connectionId` for BYOK.

**Example**

```bash
celigo guardrails create < guardrail.json
```

**Corresponds to**: [`POST /v1/imports`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#post-v1-imports) (with `adaptorType=GuardrailImport` injected)

***

## `celigo guardrails update`

Replace a guardrail import with the JSON body on stdin. Destructive — any field omitted from the payload is erased. Prefer `set` for targeted edits.

> ⚠️ **`PUT` fully replaces the guardrail.** Any field omitted from the payload is erased. Prefer `set` for targeted edits, or `get | jq | update` to preserve the rest of the document.

Since celigo-cli 2026.10.1, `update` runs the checks `imports update` runs, after its read of the guardrail (which refuses an import of another type): a body that is not a JSON object, a body whose `adaptorType` names another import type, masked `"******"` credential placeholders (unless `--force`), and a `responseMapping` object wrapper or `null` are refused before the PUT. The body is checked against the published API schemas, with the copy just read as evidence, and findings are stderr warnings that never block. On an Integration App's guardrail (`_connectorId` set), each field the update changed whose reply still holds the previous value is named on stderr, and the command exits `1`.

**Signature**

```bash
celigo guardrails update <id> --file <path>
celigo guardrails update <id> < guardrail.json     # or pipe on stdin
```

**Arguments**

| Argument | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| `<id>`   | string | Yes      | Guardrail import `_id`. |

**Flags**

| Flag                | Type    | Default | Description                                                                                                                                                       |
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin).                                                                                    |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`"******"`, four or more asterisks and nothing else) copied from a GET. Added in celigo-cli 2026.10.1. |

**Request body**

The complete guardrail document, on stdin or from `--file`. See the `GuardrailImport` schema.

**Example**

```bash
celigo guardrails get 65f1a7b2c3d4e5f6a7b8c9d0 \
  | jq '.guardrail.confidenceThreshold = 0.85' \
  | celigo guardrails update 65f1a7b2c3d4e5f6a7b8c9d0
```

**Corresponds to**: [`PUT /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#put-v1-imports-_id)

***

## `celigo guardrails set`

Safe field edit: `GET` → apply one or more `key=value` assignments → `PUT` the full object back — except when every assigned field is on the import `PATCH` whitelist: those go as one atomic `PATCH`, as `imports set` sends them. The whitelist is `debugUntil` (since celigo-cli 2026.10.1) and `guardrail.aiAgent.attachedKnowledgeBaseIds` (since celigo-cli 2026.11.2). A `set` sent as one `PATCH` prints the `PATCH`'s answer; when that answer has no body, stdout stays empty, stderr says `Updated guardrail <id>.`, and the exit code is `0`.

`guardrail.aiAgent.attachedKnowledgeBaseIds` is the list of [knowledge bases](https://developer.celigo.com/cli/commands/knowledge-bases.md) an `ai_agent` guardrail retrieves from. An assignment replaces the whole list. An AI agent lists its knowledge bases at another path, `aiAgent.attachedKnowledgeBaseIds`. The platform accepts that path on a guardrail and stores nothing, so `set` refuses it before any request:

```
Refusing to set aiAgent.attachedKnowledgeBaseIds on guardrail 65f1a7b2c3d4e5f6a7b8c9d0: aiAgent.attachedKnowledgeBaseIds is where an AI agent lists its knowledge bases — the platform accepts it here and stores nothing. A guardrail lists them at guardrail.aiAgent.attachedKnowledgeBaseIds.
```

Since celigo-cli 2026.10.1, `set` holds the rules `imports set` holds:

* In `operate` mode it takes only `debugUntil`; any other field needs `full` mode. See [permission modes](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).
* An assignment that would change the import's type — another `adaptorType`, or `adaptorType=null` — is refused.
* A `GET` + `PUT` is refused when the guardrail the server returned carries a masked `"******"` value, which the `PUT` would write back over the secret; use `update` with the real value.
* The assigned values (`PATCH`) or the document it would `PUT` are checked against the published API schemas, as stderr warnings that never block, and a `responseMapping` object wrapper or `null` is refused.
* After a `GET` + `PUT`, a field the server's reply still holds at its previous value prints `not stored <field> the server answered the PUT but still holds its previous value …` on stderr, and the command exits `1`; on an Integration App's guardrail, one line names the fields the app kept instead.

Since celigo-cli 2026.11.2, `set` also holds two rules `imports set` has held since celigo-cli 2026.10.2. A bare rules array for `filter` is refused before any request. On the `GET` + `PUT` route, a value that reads as a JSON object or array is sent as text where the published spec types the field as a string.

**Signature**

```bash
celigo guardrails set <id> <assignments...>
```

**Arguments**

| Argument           | Type   | Required | Description                                                                                                                                                                          |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `<id>`             | string | Yes      | Guardrail import `_id`.                                                                                                                                                              |
| `<assignments...>` | string | Yes (≥1) | One or more `key=value` pairs. Values are JSON-parsed (`disabled=false` → boolean). Dot + bracket notation supported (e.g. `guardrail.pii.mask=true`). `key=null` removes the field. |

**Example**

```bash
celigo guardrails set 65f1a7b2c3d4e5f6a7b8c9d0 \
  name="Block PII in support messages" \
  guardrail.confidenceThreshold=0.9

# Attach a knowledge base to an ai_agent guardrail: the assignment replaces the whole list
celigo guardrails set 65f1a7b2c3d4e5f6a7b8c9d0 \
  'guardrail.aiAgent.attachedKnowledgeBaseIds=["66a1b2c3d4e5f6a7b8c9d0e1"]'
```

**Corresponds to**: [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#get-v1-imports-_id) then [`PUT /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#put-v1-imports-_id); when every assigned field is `debugUntil` or `guardrail.aiAgent.attachedKnowledgeBaseIds`, the `GET` then [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports)

***

## `celigo guardrails delete`

Delete a guardrail import by ID. Prompts for confirmation unless `-y` is passed.

> ⚠️ **Deleting a guardrail is destructive.** Any flow or tool that references it loses the guardrail step. Confirm it is unused before deleting.

**Signature**

```bash
celigo guardrails delete <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| `<id>`   | string | Yes      | Guardrail import `_id`. |

**Flags**

| Flag          | Type    | Default | Description                               |
| ------------- | ------- | ------- | ----------------------------------------- |
| `-y`, `--yes` | boolean | `false` | Skip the interactive confirmation prompt. |

**Example**

```bash
celigo guardrails delete 65f1a7b2c3d4e5f6a7b8c9d0 -y
```

**Corresponds to**: [`DELETE /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#delete-v1-imports-_id)

***

## `celigo guardrails invoke [id]`

Run a guardrail without creating a job. An `ai_agent` guardrail is a real, billed run in either form: its model is called for every record. `pii` and `moderation` guardrails run local classifiers, and no guardrail runs tools.

Two modes:

* **With `<id>`** — invoke a *saved* guardrail against records piped on stdin or passed with `--file`; the response is the guardrail's evaluation for each record (`POST /v1/imports/{_id}/invoke`). The API answers HTTP 200 whatever happened to each record, so check each result's `statusCode` and `errors`. Since celigo-cli 2026.10.1, a count prints on stderr, and since celigo-cli 2026.10.2 it counts each record by cause — `2 record(s): 1 accepted, 1 rejected by the destination, 0 failed before sending, 0 failed after sending (the destination may already hold them), 0 ignored and never sent.` (see [`imports invoke`](https://developer.celigo.com/cli/commands/imports.md#celigo-imports-invoke-id) for what each cause means). The records are optional in this mode; since celigo-cli 2026.10.1, a body piped without `--file` gets one second to start arriving and is then read to its end (use `--file -` behind a slower producer). Since celigo-cli 2026.11.2, a piped `{"import": …}` document is refused in this mode, because the platform ignores it and runs the records through the saved guardrail: `With an <id> the saved guardrail runs as stored and the piped body is its records: the platform ignores an "import" document there and runs the records through the saved guardrail. Pipe only the records ([{...}, ...]), or leave the <id> out to preview the edited document.`
* **Without `<id>`** — preview a *guardrail document*'s evaluation without saving (`POST /v1/imports/preview`): pipe `{"import": <guardrail document>, "data": [{...}]}`, or the bare document to preview it with one empty record. The preview runs only the first record of `data` and sends none of the others. The CLI sets `adaptorType: GuardrailImport` on the document. Stdin is required in this mode. Since celigo-cli 2026.10.1, the CLI sends the `{import, data}` envelope the endpoint requires, and refuses before any request a body that is not a JSON object, an envelope whose `import` is not a document or whose `data` is not an array, and a document of another import type (`celigo imports invoke` previews those).

Since celigo-cli 2026.11.1, in either mode, a credential the result carries prints as `********`: the value of each credential header, and a captured request URL's userinfo and credential query parameters. See [Credentials in a run's result](https://developer.celigo.com/cli/using-the-cli/output-formats.md#credentials-in-a-runs-result).

**Signature**

```bash
celigo guardrails invoke [id] [-f <path>]
```

**Arguments**

| Argument | Type   | Required | Description                                                         |
| -------- | ------ | -------- | ------------------------------------------------------------------- |
| `[id]`   | string | No       | Guardrail import `_id`. Omit to preview a piped guardrail document. |

**Flags**

| Flag                | Type   | Default | Description                                                                                                                |
| ------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string | stdin   | Read the records or the guardrail document from a file instead of stdin (`-` also means stdin, and waits for it to close). |

**Request body**

| Form           | Body                                                                                                                                                            |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| With `<id>`    | The records to evaluate: `[{...}, ...]`. Optional.                                                                                                              |
| Without `<id>` | `{"import": <guardrail document>, "data": [{...}]}`, or the bare guardrail document (previewed against one empty record). Only the first record of `data` runs. |

**Examples**

```bash
# Invoke a saved guardrail against records (the count prints on stderr)
echo '[{"message":"Contact me at jdoe@example.com or 555-1212"}]' \
  | celigo guardrails invoke 65f1a7b2c3d4e5f6a7b8c9d0

# Preview an unsaved guardrail document against a record of your own
celigo guardrails invoke --file preview.json    # {"import": {...}, "data": [{"message": "..."}]}

# Preview the bare document against one empty record
celigo guardrails invoke < guardrail.json
```

**Corresponds to**: [`POST /v1/imports/{_id}/invoke`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#post-v1-imports-_id-invoke) (with `id`) or `POST /v1/imports/preview` (without).

***

## `celigo guardrails enable-debug`

Enable debug logging on a guardrail by setting `debugUntil` via `PATCH`. Debug windows are capped at 60 minutes. Fetch the captures from the flow, API, or tool that runs the guardrail, with `flows debug-requests <flowId> <guardrailId>` (or `apis`/`tools debug-requests`). Requires `operate` mode.

Since celigo-cli 2026.10.1, the import is read first and one of another type is refused before the `PATCH`:

```
Import 5f8d43a1b9e5a80011a35f2c is not a guardrail (adaptorType=HTTPImport). Use `celigo imports` for non-guardrail imports.
```

**Signature**

```bash
celigo guardrails enable-debug <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| `<id>`   | string | Yes      | Guardrail import `_id`. |

**Flags**

| Flag                   | Type   | Default | Description                                                                                                                                                                     |
| ---------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--duration <minutes>` | number | `60`    | Debug duration in minutes. Capped at 60. Since celigo-cli 2026.10.1, a value that is not a positive whole number is refused instead of setting a window that has already ended. |

**Example**

```bash
celigo guardrails enable-debug 65f1a7b2c3d4e5f6a7b8c9d0 --duration 30
```

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#patch-v1-imports-_id) (JSON Patch: `replace /debugUntil`)

***

## `celigo guardrails disable-debug`

Clear `debugUntil` on a guardrail import, stopping debug log collection. Requires `operate` mode. Since celigo-cli 2026.10.1, the import is read first and one of another type is refused, as `enable-debug` refuses it.

**Signature**

```bash
celigo guardrails disable-debug <id>
```

**Arguments**

| Argument | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| `<id>`   | string | Yes      | Guardrail import `_id`. |

**Example**

```bash
celigo guardrails disable-debug 65f1a7b2c3d4e5f6a7b8c9d0
```

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#patch-v1-imports-_id) (JSON Patch: `remove /debugUntil`)

***

## `celigo guardrails clone`

Clone a guardrail import. Two modes:

* **Same-env clone** — no stdin. The CLI reads the source guardrail, builds a self-map from its `_connectionId` (empty map for non-BYOK guardrails, since `pii` and `moderation` types don't require a connection), and submits the clone.
* **Cross-env clone** — pipe JSON on stdin, or pass it with `--file`, with a `connectionMap` that maps source connection IDs to target connection IDs: `{"connectionMap":{"sourceConnId":"targetConnId"}}`. The clone's name comes from `--name`.

Since celigo-cli 2026.10.1, a body piped without `--file` must start arriving within one second and is then read to its end; behind a slower producer, use `--file -`. A body that is not a JSON object is refused before any request.

**Signature**

```bash
celigo guardrails clone <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description                    |
| -------- | ------ | -------- | ------------------------------ |
| `<id>`   | string | Yes      | Source guardrail import `_id`. |

**Flags**

| Flag                | Type   | Default                   | Description                                                                                                                     |
| ------------------- | ------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `--name <name>`     | string | `"Clone - <source name>"` | Name for the cloned guardrail. Defaults match the UI. Since celigo-cli 2026.11.2, a blank value is refused before any request.  |
| `-f, --file <path>` | string | —                         | Read the `connectionMap` body from a file instead of stdin. `--file -` waits until stdin closes. Added in celigo-cli 2026.10.1. |

**Example**

```bash
# Same-env clone
celigo guardrails clone 65f1a7b2c3d4e5f6a7b8c9d0 --name "Copy of PII blocker"

# Cross-env clone (BYOK ai_agent guardrail)
echo '{"connectionMap":{"63abc...":"71xyz..."}}' \
  | celigo guardrails clone 65f1a7b2c3d4e5f6a7b8c9d0 --name "PII blocker (prod)"
```

**Corresponds to**: [`POST /v1/imports/{_id}/clone`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#post-v1-imports-_id-clone)

***

## `celigo guardrails replace-connection`

Replace the connection referenced by a guardrail — only meaningful for `ai_agent` guardrails with a BYOK `_connectionId`. `pii` and `moderation` guardrails don't carry a connection. Since celigo-cli 2026.10.1, the import is read first and one of another type is refused before the swap — an HTTP import's connection can no longer be replaced through this command.

**Signature**

```bash
celigo guardrails replace-connection <id> <newConnectionId>
```

**Arguments**

| Argument            | Type   | Required | Description                         |
| ------------------- | ------ | -------- | ----------------------------------- |
| `<id>`              | string | Yes      | Guardrail import `_id`.             |
| `<newConnectionId>` | string | Yes      | The replacement connection's `_id`. |

**Example**

```bash
celigo guardrails replace-connection 65f1a7b2c3d4e5f6a7b8c9d0 71xyz456...
```

**Corresponds to**: [`PUT /v1/imports/{_id}/replaceConnection`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#put-v1-imports-_id-replaceconnection)

***

## Gotchas

* **Three guardrail types, three required sub-configs.** `guardrail.type = "pii"` needs `guardrail.pii.entities[]` with at least one entity. `type = "moderation"` needs `guardrail.moderation.categories[]` with at least one category. `type = "ai_agent"` needs `guardrail.aiAgent` (same shape as `agents`).
* **PII detection example entities**: `email_address`, `phone_number`, `us_social_security_number`, `credit_card_number`, `persons_name`, `ip_address`, and a long list of country-specific IDs. See the `Guardrail.pii.entities` enum for the full list.
* **Moderation categories** cover `hate`, `harassment`, `self_harm`, `sexual`, `violence`, `illicit`, and their intensified variants (`*_threatening`, `*_graphic`, `*_minors`, etc.). Pick only what you intend to enforce — every category adds latency.
* **`confidenceThreshold` defaults to `0.7`.** Lower values catch more potential issues but raise false positives; raise it when you're seeing noisy flags on benign records.
* **No `_connectionId` required for `pii` or `moderation`.** The guardrail runs inside Celigo. Only `ai_agent` guardrails may carry a BYOK `_connectionId`; use `replace-connection` to swap it.
* **`pii.mask: true` rewrites the record** on its way out — callers see redacted values instead of the raw input. `mask: false` only flags detections without modifying the record.
* **`invoke` doesn't create a job.** Evaluations are ephemeral; use `enable-debug` and then `flows debug-requests <flowId> <guardrailId>` (since guardrails are imports) to capture runs inside flows. An `ai_agent` guardrail's invoke is still a real, billed run: its model is called for every record.
* **A guardrail's model can be refused or deprecated.** [`ai-agents model-health`](https://developer.celigo.com/cli/commands/ai-agents.md#celigo-ai-agents-model-health) lists the guardrails on an affected model beside the AI agents, with the models the platform suggests instead. A refused model blocks the guardrail on save and on run; a deprecated one works until its retirement date. This group has no `model-health` command of its own.
* **An `ai_agent` guardrail can retrieve from knowledge bases.** It lists them in `guardrail.aiAgent.attachedKnowledgeBaseIds`, and since celigo-cli 2026.11.2 `set` replaces that list with one `PATCH`. [`knowledge-bases`](https://developer.celigo.com/cli/commands/knowledge-bases.md) manages the knowledge bases and their files.
* **API path is `/v1/imports`, not `/v1/guardrails`.** The CLI command is its own namespace, but every request is on the shared imports endpoint with `adaptorType=GuardrailImport` as the discriminator.
* **Per-ID ops are type-guarded.** Every command that takes an id reads the import first and refuses one whose `adaptorType` is not `GuardrailImport`, since `/v1/imports/{id}` serves every import type. Since celigo-cli 2026.10.1, that includes `enable-debug`, `disable-debug`, and `replace-connection`, which used to write to whatever import the id named, and `create`, `update`, and `set` refuse a body or assignment naming another import type (or `adaptorType=null`); `celigo imports` writes other import types.
* **`create`, `clone`, and `invoke` are sent once.** Since celigo-cli 2026.10.1, a timeout or a 5xx on any of them is reported and never retried, and since celigo-cli 2026.11.1 neither is a `429`, which earlier releases retried: the request may have reached the server, so check for the result before you run the command again.
* **Permission modes.** `list` and `get` work in `read` mode. `invoke` (with or without an id), `enable-debug`, `disable-debug`, and `set <id> debugUntil=…` need `operate`. `create`, `update`, `delete`, `clone`, `replace-connection`, and any other `set` need `full`. Since celigo-cli 2026.10.1, `read` mode refuses the `operate` verbs before any request, and `operate` mode's `set` takes only `debugUntil`. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

## Related

* [ai-agents](https://developer.celigo.com/cli/commands/ai-agents.md) — LLM-powered import steps that generate or transform content. Guardrails screen; agents produce. Its `model-health` command lists the guardrails on an affected model too.
* [knowledge-bases](https://developer.celigo.com/cli/commands/knowledge-bases.md) — the indexed PDF collections an `ai_agent` guardrail retrieves from; attach them with `set`.
* [tools](https://developer.celigo.com/cli/commands/tools.md) — reusable building blocks that can embed guardrail steps alongside exports, imports, and lookups.
* [mcp-servers](https://developer.celigo.com/cli/commands/mcp-servers.md) — expose tools (and, transitively, guardrail-protected steps) to MCP clients.
* [imports](https://developer.celigo.com/cli/commands/imports.md) — the parent resource type. Generic import commands also work on guardrail IDs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/guardrails.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
