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, 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.
Subcommands
list
List all guardrail imports in the account.
get <id>
Fetch one guardrail by ID.
create
Create a guardrail from JSON on stdin (adaptorType auto-set).
update <id>
Full replace from stdin (destructive PUT).
set <id> key=value …
Safe field edit: 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
Arguments
None.
Flags
None beyond the global flags (--format, --jq, --profile, --verbose).
Example
Corresponds to: GET /v1/imports (client-side filter on adaptorType)
celigo guardrails get
Fetch a single guardrail import by ID.
Signature
Arguments
<id>
string
Yes
Guardrail import _id.
Example
Corresponds to: GET /v1/imports/{_id}
celigo guardrails create
Create a guardrail import from a JSON body on stdin. The CLI forces adaptorType = "GuardrailImport" before posting, so you don't need to include it in the payload.
Signature
Arguments
None. Reads JSON on 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 ofpii,moderation,ai_agent.guardrail.confidenceThreshold— detection threshold (0–1, default0.7).guardrail.pii.entities[]/.mask— required forpii.guardrail.moderation.categories[]— required formoderation.guardrail.aiAgent— required forai_agent; same shape as anagentsconfig, including optional_connectionIdfor BYOK.
Example
Corresponds to: 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.
⚠️
PUTfully replaces the guardrail. Any field omitted from the payload is erased. Prefersetfor targeted edits, orget | jq | updateto preserve the rest of the document.
Signature
Arguments
<id>
string
Yes
Guardrail import _id.
Request body
The complete guardrail document. See the GuardrailImport schema.
Example
Corresponds to: PUT /v1/imports/{_id}
celigo guardrails set
Safe field edit: GET → apply one or more key=value assignments → PUT the full object back.
Signature
Arguments
<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
Corresponds to: GET /v1/imports/{_id} then PUT /v1/imports/{_id}
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
Arguments
<id>
string
Yes
Guardrail import _id.
Flags
-y, --yes
boolean
false
Skip the interactive confirmation prompt.
Example
Corresponds to: DELETE /v1/imports/{_id}
celigo guardrails invoke [id]
Run a guardrail without creating a job. Two modes:
With
<id>— invoke a saved guardrail against records piped on stdin; the response is the guardrail's evaluation for each record (POST /v1/imports/{_id}/invoke).Without
<id>— pipe a guardrail document on stdin to preview its evaluation without saving (POST /v1/imports/preview; the CLI setsadaptorType: GuardrailImport). Stdin is required in this mode.
Signature
Arguments
[id]
string
No
Guardrail import _id. Omit to preview a piped guardrail document.
Examples
Corresponds to: 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.
Signature
Arguments
<id>
string
Yes
Guardrail import _id.
Flags
--duration <minutes>
number
60
Debug duration in minutes. Capped at 60.
Example
Corresponds to: PATCH /v1/imports/{_id} (JSON Patch: replace /debugUntil)
celigo guardrails disable-debug
Clear debugUntil on a guardrail import, stopping debug log collection.
Signature
Arguments
<id>
string
Yes
Guardrail import _id.
Example
Corresponds to: 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, sincepiiandmoderationtypes don't require a connection), and submits the clone.Cross-env clone — pipe JSON on stdin with a
connectionMapthat maps source connection IDs to target connection IDs:{"connectionMap":{"sourceConnId":"targetConnId"},"name":"..."}.
Signature
Arguments
<id>
string
Yes
Source guardrail import _id.
Flags
--name <name>
string
"Clone - <source name>"
Name for the cloned guardrail. Defaults match the UI.
Example
Corresponds to: 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.
Signature
Arguments
<id>
string
Yes
Guardrail import _id.
<newConnectionId>
string
Yes
The replacement connection's _id.
Example
Corresponds to: PUT /v1/imports/{_id}/replaceConnection
Gotchas
Three guardrail types, three required sub-configs.
guardrail.type = "pii"needsguardrail.pii.entities[]with at least one entity.type = "moderation"needsguardrail.moderation.categories[]with at least one category.type = "ai_agent"needsguardrail.aiAgent(same shape asagents).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 theGuardrail.pii.entitiesenum 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.confidenceThresholddefaults to0.7. Lower values catch more potential issues but raise false positives; raise it when you're seeing noisy flags on benign records.No
_connectionIdrequired forpiiormoderation. The guardrail runs inside Celigo. Onlyai_agentguardrails may carry a BYOK_connectionId; usereplace-connectionto swap it.pii.mask: truerewrites the record on its way out — callers see redacted values instead of the raw input.mask: falseonly flags detections without modifying the record.invokedoesn't create a job. Evaluations are ephemeral; useenable-debug+ theimports debug-requestsflow (since guardrails are imports) to capture runs inside flows.API path is
/v1/imports, not/v1/guardrails. The CLI command is its own namespace, but every request is on the shared imports endpoint withadaptorType=GuardrailImportas the discriminator.
Related
ai-agents — LLM-powered import steps that generate or transform content. Guardrails screen; agents produce.
tools — reusable building blocks that can embed guardrail steps alongside exports, imports, and lookups.
mcp-servers — expose tools (and, transitively, guardrail-protected steps) to MCP clients.
imports — the parent resource type. Generic import commands also work on guardrail IDs.
Last updated
Was this helpful?