> 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/api/api-reference/ai-and-mcp/guardrails.md).

# Guardrails

Guardrails are safety and compliance checks that evaluate data flowing through integrations — detecting PII, moderating content, or applying custom AI-powered rules.

Guardrails are import resources with `adaptorType: GuardrailImport`. All CRUD operations use the `/v1/imports` endpoints. The `guardrail` object holds the type-specific configuration.

A guardrail returns a verdict for each record and never changes the record. The verdict fields are at the top level of the result: `flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or `reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved guardrail is invoked by id. In a flow, the guardrail step's response mapping copies them onto the record (`{"extract": "masked", "generate": "description"}`), and routers branch on the mapped `flagged`.

### Guardrail schema

## The Guardrail object

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"components":{"schemas":{"Guardrail":{"type":"object","description":"Guardrail import object as returned by the API.","required":["_id","name","adaptorType","guardrail","apiIdentifier","lookups","createdAt","lastModified"],"allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"$ref":"#/components/schemas/IAResourceResponse"},{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail. May be empty if created without one."},"description":{"type":"string","maxLength":5120,"description":"Free-text note describing the guardrail's purpose."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Always `GuardrailImport` for guardrails."},"_connectionId":{"type":"string","format":"objectId","description":"BYOK connection backing an `ai_agent` guardrail. Absent when a built-in provider runs on platform-managed credentials."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source guardrail this one was cloned from. Present only on clones."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 input mapping that selects what is evaluated: a field mapped\nto `text`, or an object mapped to `record` (evaluated as its JSON).\nServed only when populated — a guardrail created without one has no\n`mapping` in responses, and evaluates the whole record (or the\nrecord's own top-level `text` field, when it has one).","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (typically `text`).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Input shape for the guardrail's processing pipeline. Present when set; absence means `record`."},"apiIdentifier":{"type":"string","readOnly":true,"description":"Ten-character hex identifier used to invoke the guardrail over HTTP."},"lookups":{"type":"array","description":"Static lookup configurations. Guardrail (AI agent) imports support static lookups only; defaults to an empty array.","items":{"type":"object"}},"mappings":{"type":"array","description":"Import field mappings. Each entry requires a `status` field. Typically empty for guardrails.","items":{"type":"object"}},"mockResponse":{"type":"array","description":"Sample evaluation results stored with the guardrail. The UI populates these from a\npreview run; accepted on create and update. Each item has the shape of the result a\nrun produces for one record, with the verdict fields (`flagged`, `masked`,\n`reasoning`) at the top level.","items":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP-style status code of the sample evaluation."},"flagged":{"type":"boolean","description":"When true, the sample input tripped the guardrail."},"reasoning":{"type":"string","description":"The model's explanation of the verdict. Returned by `ai_agent` guardrails,\nwhatever output format the guardrail stores."},"_json":{"type":"object","description":"Empty (`{}`) in the result of a saved guardrail invoked by id. A preview's result\ncarries the raw verdict under `_json.data`: `flagged`, `reasoning` and\n`confidence` for `ai_agent`, or `flagged`, `masked` and `entities_detected`\nfor `pii`. Read the top-level fields, not `_json`.","additionalProperties":true},"ignored":{"type":"boolean","description":"When true, the result fell below `confidenceThreshold` and was disregarded."},"masked":{"type":"string","description":"Sample input with detected values masked. Populated for `pii` guardrails with masking enabled."},"dataURI":{"type":"string","description":"Data URI of any artifact produced by the sample evaluation."},"errors":{"type":"array","description":"Errors raised during the sample evaluation.","items":{"type":"object"}}}}},"aiDescription":{"$ref":"#/components/schemas/AIDescription"}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"IAResourceResponse":{"type":"object","description":"Integration app response fields for resources that are part of integration apps","properties":{"_integrationId":{"type":"string","format":"objectId","readOnly":true,"description":"Reference to the specific integration instance that contains this resource.\n\nThis field is only populated for resources that are part of an integration app\ninstallation. It contains the unique identifier (_id) of the integration\nresource that was installed in the account.\n\nThe integration instance represents a specific installed instance of an\nintegration app, with its own configuration, settings, and runtime environment.\n\nThis reference enables:\n- Tracing the resource back to its parent integration instance\n- Permission and access control based on integration ownership\n- Lifecycle management (enabling/disabling, updating, or uninstalling)\n"},"_connectorId":{"type":"string","format":"objectId","readOnly":true,"description":"Integration App (connector) that defines this resource. Present only on resources an\nIntegration App owns. The app locks parts of these documents, and a PUT that changes a\nlocked field answers 200 but keeps the stored value, so read the document back to confirm\na change."}}},"GuardrailConfig":{"type":"object","description":"Selects the check a guardrail applies and carries its settings. `type` picks the check\nand the matching sub-object (`pii`, `moderation`, or `aiAgent`) configures it.\nResponses echo the active sub-object with `confidenceThreshold` defaulted and also\nreturn the inactive `pii` / `moderation` siblings as empty stubs\n(`pii: {entities: [], mask: false}`, `moderation: {categories: []}`) — only the active\ntype's sub-object is meaningful. Guardrails created before the AI-agent stub was\nstripped on write may still return an inert `aiAgent` on `pii` / `moderation` guardrails.","properties":{"type":{"type":"string","enum":["ai_agent","pii","moderation"],"description":"The type of guardrail to apply. Each type requires its corresponding\nsub-configuration object (`aiAgent`, `pii`, or `moderation`)."},"confidenceThreshold":{"type":"number","minimum":0,"maximum":1,"default":0.7,"description":"Confidence threshold (0 to 1). Detections below this threshold are\nignored. Lower values catch more issues but increase false positives."},"aiAgent":{"type":"object","description":"LLM configuration for the check; set when `type` is `ai_agent` and validated\nagainst `GuardrailAiAgentConfig`. On `pii` / `moderation` guardrails a legacy\nserver-written stub may appear here — it is inert, and current servers strip it on\nwrite."},"pii":{"type":"object","required":["entities"],"description":"PII detection configuration. Required when `type` is `pii`.","properties":{"entities":{"type":"array","description":"PII entity types to detect. When `type` is `pii`, at least one\nentry is required; the inactive sibling on other guardrail types\nmay be served with an empty list.","items":{"type":"string","enum":["credit_card_number","card_security_code_cvv_cvc","cryptocurrency_wallet_address","date_and_time","email_address","iban_code","bic_swift_bank_identifier_code","ip_address","location","medical_license_number","national_registration_number","persons_name","phone_number","url","us_bank_account_number","us_drivers_license","us_itin","us_passport_number","us_social_security_number","uk_nhs_number","uk_national_insurance_number","spanish_nif","spanish_nie","italian_fiscal_code","italian_drivers_license","italian_vat_code","italian_passport","italian_identity_card","polish_pesel","finnish_personal_identity_code","singapore_nric_fin","singapore_uen","australian_abn","australian_acn","australian_tfn","australian_medicare","indian_pan","indian_aadhaar","indian_vehicle_registration","indian_voter_id","indian_passport","korean_resident_registration_number"]}},"mask":{"type":"boolean","default":false,"description":"When true, the result also carries `masked`: the evaluated input with each detected\nvalue replaced by asterisks. The record itself is unchanged. With whole-record input\n(no `mapping`, and no top-level `text` field on the record), `masked` is the record\nserialized as one JSON string. When false, PII is flagged only."}}},"moderation":{"type":"object","required":["categories"],"description":"Content moderation configuration. Required when `type` is `moderation`.","properties":{"categories":{"type":"array","description":"Content moderation categories to check. When `type` is\n`moderation`, at least one entry is required; the inactive\nsibling on other guardrail types may be served with an empty\nlist.","items":{"type":"string","enum":["sexual","sexual_minors","hate","hate_threatening","harassment","harassment_threatening","self_harm","self_harm_intent","self_harm_instructions","violence","violence_graphic","illicit","illicit_violent"]}}}}},"required":["type","confidenceThreshold"],"if":{"required":["type"],"properties":{"type":{"const":"pii"}}},"then":{"required":["pii"],"properties":{"pii":{"required":["entities"],"properties":{"entities":{"minItems":1}}}}},"else":{"if":{"required":["type"],"properties":{"type":{"const":"moderation"}}},"then":{"required":["moderation"],"properties":{"moderation":{"required":["categories"],"properties":{"categories":{"minItems":1}}}}},"else":{"required":["aiAgent"],"properties":{"aiAgent":{"$ref":"#/components/schemas/GuardrailAiAgentConfig"}}}}},"GuardrailAiAgentConfig":{"type":"object","description":"LLM configuration for an `ai_agent` guardrail — which provider and model evaluate each\nrecord, with instructions, parameter tuning, and output format. Guardrails never invoke\ntools, so unlike an AI agent import no block here accepts a `tools` array. MCP `prompts`\nand `resources` are accepted on save but never used at run time, so put the policy the\nguardrail must apply in its instructions. Providers come in two families with two\nconfiguration formats:\n\n- **Built-in providers** — each has its own configuration block.\n  - **openai**: OpenAI models (GPT-4.1, GPT-5, etc.). Configure via the `openai` object.\n  - **gemini**: Google Gemini models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.gemini`.\n  - **anthropic**: Anthropic Claude models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.anthropic`.\n- **Catalog providers** — `mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`. Added\n  as catalog data rather than platform code, they share one generic flat format:\n  `model`, `modelOptions`, `instructions`, `output`, and the `prompts` / `resources`\n  arrays directly on this object.\n\nA `_connectionId` on the parent import selects bring-your-own-key (BYOK)\ncredentials. Without one, built-in providers run on platform-managed\ncredentials; catalog providers have no platform-managed credentials, so the\nsave requires one — without it the guardrail fails to save with 422\n`connection_required` on `_connectionId`.\n","required":["provider"],"properties":{"provider":{"type":"string","enum":["openai","gemini","anthropic","mistral","xai","huggingface","deepseek","cohere","groq"],"description":"AI provider to use."},"model":{"type":"string","description":"Model identifier for a catalog provider (generic flat format) — for example\n`grok-4.6`. Built-in providers set the model inside their own block\n(`openai.model`, `litellm.model`) instead."},"modelOptions":{"type":"object","description":"Model tuning for a catalog provider (generic flat format). Which keys, values, and\nranges are accepted is defined per catalog model and validated on save when the\nmodel is a catalog entry.","properties":{"maxOutputTokens":{"type":"number","description":"Maximum number of tokens the model may generate."},"temperature":{"type":"number","description":"Sampling temperature."},"topP":{"type":"number","description":"Nucleus sampling threshold."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Reasoning depth for models that expose it."}}},"instructions":{"type":"string","description":"System prompt for a catalog provider (generic flat format). Built-in providers\nset it inside their own block (`openai.instructions`,\n`litellm._overrides.anthropic.systemInstruction`)."},"output":{"type":"object","description":"Output format for a catalog provider (generic flat format). Built-in providers\nconfigure it inside their own block (`openai.output`, `litellm.responseFormat`).","properties":{"format":{"type":"object","description":"Controls the structure of the model's output.","properties":{"type":{"type":"string","enum":["text","json_schema"],"description":"Output type."},"name":{"type":"string","description":"Name of the JSON schema, for `json_schema` output."},"strict":{"type":"boolean","description":"When true, the model must conform exactly to `jsonSchema`."},"jsonSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema the structured output must conform to, for `json_schema` output."}}},"verbose":{"type":"string","description":"Level of detail in the model's response, for models that expose it."}}},"prompts":{"type":"array","description":"MCP prompt entries saved with a catalog-provider guardrail (generic flat format).\nEach entry references one MCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the prompts."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"openai":{"type":"object","description":"OpenAI-specific configuration. Used when `provider` is \"openai\".\n","required":["model","instructions"],"properties":{"instructions":{"type":"string","maxLength":1000000,"description":"System prompt that defines the check's behavior, goals, and constraints.\n"},"model":{"type":"string","description":"OpenAI model identifier. Open string (not an enum) — model names change frequently."},"reasoning":{"type":"object","description":"Controls depth of reasoning for complex tasks.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"How much reasoning effort the model should invest"},"summary":{"type":"string","enum":["concise","auto","detailed"],"description":"Level of detail in reasoning summaries"}}},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature. Higher values (e.g. 1.5) produce more creative output,\nlower values (e.g. 0.2) produce more focused and deterministic output.\n"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"topLogprobs":{"type":"number","minimum":0,"maximum":20,"description":"Number of most likely tokens to return log probabilities for at each output position."},"maxOutputTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the model's response. Unlike an AI agent import, a guardrail does not receive a server-written value when this is omitted."},"serviceTier":{"type":"string","enum":["auto","default","priority"],"description":"OpenAI service tier. \"priority\" provides higher rate limits and\nlower latency at increased cost."},"output":{"type":"object","description":"Output format configuration. A guardrail stores `format` but doesn't use it: the\nrequest to the model always carries the guardrail's own `validation_result` JSON\nschema (`flagged`, `reasoning`, `confidence`), and the result returns `flagged` and\n`reasoning` whatever `format` holds.","properties":{"format":{"type":"object","description":"Stored output structure. The request to the model uses the guardrail's own\nverdict schema instead (see `output`).\n","properties":{"type":{"type":"string","enum":["text","json_schema","blob"],"description":"Output format type, as stored."},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in. Stored and echoed on\nguardrails for parity with the AI-agent format block — the guardrail form\ndoes not set it today, and neither view changes the model request."},"name":{"type":"string","description":"Name for the output format (used with json_schema)"},"strict":{"type":"boolean","description":"Stored strict-validation flag for `jsonSchema`. A guardrail's model request uses its own verdict schema, so this doesn't apply there."},"jsonSchema":{"type":"object","description":"Stored JSON Schema. Required when `format.type` is \"json_schema\". A guardrail\ndoesn't send it to the model; the request carries the `validation_result`\nverdict schema instead.\n","properties":{"type":{"type":"string","description":"Root type of the stored JSON Schema.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"Field definitions in the stored JSON Schema."},"required":{"type":"array","description":"Property names the stored JSON Schema marks as required.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"Whether the stored JSON Schema allows properties beyond those in `properties`."}}},"schema":{"type":"object","readOnly":true,"additionalProperties":true,"description":"Server-written copy of `jsonSchema`, present in responses once `jsonSchema`\nis set. Send `jsonSchema`, not this field."}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"verbose":{"type":"string","enum":["low","medium","high"],"description":"Level of detail in the model's response"}}},"prompts":{"type":"array","description":"MCP prompt entries saved with the guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}},"litellm":{"type":"object","description":"LiteLLM proxy configuration. Used when `provider` is \"gemini\" or \"anthropic\".\n\nLiteLLM provides a unified interface to multiple AI providers. Gemini-specific\nsettings are in `_overrides.gemini`; Claude-specific settings are in\n`_overrides.anthropic`.\n\n`model` is required when litellm is the active provider path.\n","properties":{"model":{"type":"string","description":"LiteLLM model identifier. For Gemini, models are stored without the `gemini/`\nprefix; for Anthropic, use the Claude model id (e.g. `claude-sonnet-4-6`)."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature"},"maxCompletionTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the response"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"seed":{"type":"number","description":"Random seed for reproducible outputs"},"responseFormat":{"type":"object","description":"Output format configuration","properties":{"type":{"type":"string","description":"Output format type.","enum":["text","json_schema","blob"]},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in; the schema sent to the provider\nis the same either way. Stored and echoed on guardrails for parity with the\nAI-agent format block — the guardrail form does not set it today."},"name":{"type":"string","description":"Name for the output format (used with json_schema)."},"strict":{"type":"boolean","description":"When true, enforces strict schema validation on output."},"jsonSchema":{"type":"object","description":"JSON Schema for structured output. Required when `responseFormat.type` is \"json_schema\".","properties":{"type":{"type":"string","description":"Root JSON Schema type of the structured output; use \"object\" for record-shaped results.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"JSON Schema definitions for each field the structured output may contain."},"required":{"type":"array","description":"Property names the model must include in the structured output.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"When true, the structured output may include properties beyond those defined in `properties`."}}}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"_overrides":{"type":"object","description":"Provider-specific overrides","properties":{"gemini":{"type":"object","description":"Gemini-specific configuration overrides.\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Gemini models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"prompts":{"type":"array","description":"MCP prompt entries saved with a Gemini guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"responseModalities":{"type":"array","description":"Response output modalities","items":{"type":"string","enum":["text","image"]}},"topK":{"type":"number","description":"Top-K sampling parameter for Gemini"},"thinkingConfig":{"type":"object","description":"Controls Gemini's extended thinking capabilities","properties":{"includeThoughts":{"type":"boolean","description":"When true, includes the model's thinking steps in the response."},"thinkingBudget":{"type":"number","minimum":100,"maximum":4000,"description":"Maximum tokens allocated for thinking"},"thinkingLevel":{"type":"string","description":"Controls how much thinking effort the model applies; use higher levels for complex, multi-step tasks at the cost of latency and tokens.","enum":["minimal","low","medium","high"]}}},"imageConfig":{"type":"object","description":"Gemini image generation configuration","properties":{"aspectRatio":{"type":"string","description":"Aspect ratio of generated images; choose a ratio matching the intended display format.","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"]},"imageSize":{"type":"string","description":"Output resolution of generated images; higher resolutions increase detail and file size.","enum":["1K","2K","4K"]}}},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Resolution for media inputs (images, video)"}}},"anthropic":{"type":"object","description":"Claude-specific configuration overrides. Used when `provider` is \"anthropic\".\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Claude models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"topK":{"type":"number","minimum":0,"description":"Top-K sampling parameter. Deprecated on Claude models released after Claude Opus\n4.6, which reject any value at runtime; set it only on older models."},"thinkingConfig":{"type":"object","description":"Controls Claude's extended thinking capabilities.","properties":{"type":{"type":"string","enum":["enabled","disabled","adaptive"],"description":"Extended thinking mode."},"budgetTokens":{"type":"number","minimum":1024,"description":"Maximum tokens allocated for thinking. Required when `type` is \"enabled\" —\nomitting it fails the save with 422 `invalid_thinking_config`."},"display":{"type":"string","enum":["summarized","omitted"],"description":"How thinking output is surfaced in the response."},"effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"How much thinking effort the model applies; use with `type` \"adaptive\". Higher\nvalues (`xhigh`, `max`) may be gated to specific Claude models by the provider."}},"if":{"properties":{"type":{"const":"enabled"}},"required":["type"]},"then":{"required":["budgetTokens"]}},"serviceTier":{"type":"string","enum":["auto","standard_only"],"description":"Anthropic service tier for the request."},"prompts":{"type":"array","description":"MCP prompt entries saved with a Claude guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}}}}}}},"if":{"properties":{"provider":{"const":"openai"}},"required":["provider"]},"then":{"required":["openai"],"properties":{"openai":{"required":["model","instructions"]}}},"else":{"if":{"properties":{"provider":{"enum":["gemini","anthropic"]}},"required":["provider"]},"then":{"required":["litellm"],"properties":{"litellm":{"required":["model"]}}},"else":{"if":{"properties":{"provider":{"enum":["mistral","xai","huggingface","deepseek","cohere","groq"]}},"required":["provider"]},"then":{"required":["model"]}}}},"McpResources":{"type":"array","description":"Governed MCP resources — read-only reference content (policies, schemas, documentation)\npulled from connected MCP servers and made available to the agent as a consistent source\nof truth. Each entry references one MCP connection and the specific resources allowed from it.","items":{"type":"object","required":["type","mcp"],"properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of resource entry. Always \"mcp\"."},"mcp":{"type":"object","required":["_mcpConnectionId","allowedResources"],"description":"MCP server resource configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the resources."},"allowedResources":{"type":"array","minItems":1,"description":"Resources to expose to the agent from the MCP server. Must contain at least one\nentry; each entry identifies one resource by name and URI.","items":{"type":"object","required":["name","uri"],"properties":{"name":{"type":"string","description":"Display name of the MCP resource."},"uri":{"type":"string","description":"URI that identifies the resource on the MCP server."}}}}}}}}},"MappingField":{"type":"object","description":"One Mapper 1.0 field-mapping entry.","properties":{"generate":{"type":"string","description":"Target field path to write on the destination record."},"extract":{"type":"string","description":"Source expression. Accepts:\n- A dot path from the record root (e.g. `email`, `address.city`), read from the\n  incoming record. A path that matches no field writes nothing.\n- Handlebars template (contains `{{`) for concatenation /\n  formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,\n  `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the\n  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`\n  render nothing, so the field is left out even when the record has the value.\n\nA `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare\nstring is read as a field path, not a constant: set constants in `hardCodedValue`.\nOmit when using `hardCodedValue`.\n"},"hardCodedValue":{"type":["string","null"],"description":"Static value written to `generate` instead of extracting from the source record."},"dataType":{"type":"string","enum":["string","number","boolean","numberarray","stringarray","json"],"description":"Data type coercion applied to the mapped value."},"discardIfEmpty":{"type":"boolean","description":"When true, the field is omitted from the output when the extracted value is empty."},"immutable":{"type":"boolean","description":"When true, the mapped value cannot be overwritten by later mapping steps."},"lookupName":{"type":"string","description":"Name of an entry in the import's `lookups` array (`http.lookups` on an HTTP import) used to translate the value."},"default":{"type":["string","null"],"description":"Fallback value written when the source value is an empty string, null or\nmissing. Without a default, an empty string and null are written as they are\nand a missing field is left out."},"extractDateFormat":{"type":"string","description":"Date format of the source value, used to parse it before conversion."},"extractDateTimezone":{"type":"string","description":"Timezone applied when parsing the source date value."},"generateDateFormat":{"type":"string","description":"Date format applied to the value written to the destination."},"generateDateTimezone":{"type":"string","description":"Timezone applied when formatting the destination date value."},"conditional":{"type":"object","description":"Only apply this mapping entry when the given condition is satisfied.\n","properties":{"when":{"type":"string","enum":["record_created","record_updated","extract_not_empty","lookup_not_empty","lookup_empty","expression"],"description":"Condition that gates whether this mapping entry is applied.\n`lookup_not_empty` / `lookup_empty` evaluate the lookup named by the\nsibling `lookupName`; `expression` evaluates the sibling `expression`.\n"},"lookupName":{"type":"string","description":"Lookup to evaluate for the `lookup_not_empty` / `lookup_empty`\nconditions.\n"},"expression":{"type":"string","description":"Expression evaluated when `when` is `expression`.\n"}}}}},"AIDescription":{"type":"object","description":"AI-generated descriptions and documentation for the resource.\n\nThis object contains automatically generated content that helps users\nunderstand the purpose, behavior, and configuration of the resource without\nrequiring them to analyze the technical details. The AI-generated content\nis sanitized and safe for display in the UI.\n","properties":{"summary":{"type":["string","null"],"description":"Brief AI-generated summary of the resource's purpose and functionality.\n\nThis concise description provides a quick overview of what the resource does,\nwhat systems it interacts with, and its primary role in the integration.\nThe summary is suitable for display in list views, dashboards, and other\ncontexts where space is limited.\n\nMaximum length: 10KB\n"},"detailed":{"type":["string","null"],"description":"Comprehensive AI-generated description of the resource's functionality.\n\nThis detailed explanation covers the resource's purpose, configuration details,\ndata flow patterns, filtering logic, and other technical aspects. It provides\nin-depth information suitable for documentation, tooltips, or detailed views\nin the administration interface.\n\nThe content may include HTML formatting for improved readability.\n\nMaximum length: 10KB\n"},"generatedOn":{"type":["string","null"],"format":"date-time","description":"Timestamp indicating when the AI description was generated.\n\nThis field helps track the freshness of the AI-generated content and\ndetermine when it might need to be regenerated due to changes in the\nresource's configuration or behavior.\n\nThe timestamp is recorded in ISO 8601 format with UTC timezone (Z suffix).\n"}}}}}}
```

## List guardrails

> Returns all imports in the account, not just guardrails. Filter\
> client-side by \`adaptorType: "GuardrailImport"\` to isolate\
> guardrails.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"Include":{"name":"include","in":"query","required":false,"description":"Comma-separated list of fields to project into each returned record.\nTriggers summary projection: the response contains a minimal identity\nset (`_id`, `name`, plus resource-specific fields) with the requested\nfields added on top. Supports dot notation for nested fields.\nMutually exclusive with `exclude`.","schema":{"type":"string"}},"Exclude":{"name":"exclude","in":"query","required":false,"description":"Comma-separated list of fields to strip from the default response.\nUnlike `include`, does not trigger summary projection — returns the\nfull record with the named fields removed. Protected identity fields\n(e.g. `name`) cannot be stripped. Mutually exclusive with `include`.","schema":{"type":"string"}}},"schemas":{"Guardrail":{"type":"object","description":"Guardrail import object as returned by the API.","required":["_id","name","adaptorType","guardrail","apiIdentifier","lookups","createdAt","lastModified"],"allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"$ref":"#/components/schemas/IAResourceResponse"},{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail. May be empty if created without one."},"description":{"type":"string","maxLength":5120,"description":"Free-text note describing the guardrail's purpose."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Always `GuardrailImport` for guardrails."},"_connectionId":{"type":"string","format":"objectId","description":"BYOK connection backing an `ai_agent` guardrail. Absent when a built-in provider runs on platform-managed credentials."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source guardrail this one was cloned from. Present only on clones."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 input mapping that selects what is evaluated: a field mapped\nto `text`, or an object mapped to `record` (evaluated as its JSON).\nServed only when populated — a guardrail created without one has no\n`mapping` in responses, and evaluates the whole record (or the\nrecord's own top-level `text` field, when it has one).","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (typically `text`).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Input shape for the guardrail's processing pipeline. Present when set; absence means `record`."},"apiIdentifier":{"type":"string","readOnly":true,"description":"Ten-character hex identifier used to invoke the guardrail over HTTP."},"lookups":{"type":"array","description":"Static lookup configurations. Guardrail (AI agent) imports support static lookups only; defaults to an empty array.","items":{"type":"object"}},"mappings":{"type":"array","description":"Import field mappings. Each entry requires a `status` field. Typically empty for guardrails.","items":{"type":"object"}},"mockResponse":{"type":"array","description":"Sample evaluation results stored with the guardrail. The UI populates these from a\npreview run; accepted on create and update. Each item has the shape of the result a\nrun produces for one record, with the verdict fields (`flagged`, `masked`,\n`reasoning`) at the top level.","items":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP-style status code of the sample evaluation."},"flagged":{"type":"boolean","description":"When true, the sample input tripped the guardrail."},"reasoning":{"type":"string","description":"The model's explanation of the verdict. Returned by `ai_agent` guardrails,\nwhatever output format the guardrail stores."},"_json":{"type":"object","description":"Empty (`{}`) in the result of a saved guardrail invoked by id. A preview's result\ncarries the raw verdict under `_json.data`: `flagged`, `reasoning` and\n`confidence` for `ai_agent`, or `flagged`, `masked` and `entities_detected`\nfor `pii`. Read the top-level fields, not `_json`.","additionalProperties":true},"ignored":{"type":"boolean","description":"When true, the result fell below `confidenceThreshold` and was disregarded."},"masked":{"type":"string","description":"Sample input with detected values masked. Populated for `pii` guardrails with masking enabled."},"dataURI":{"type":"string","description":"Data URI of any artifact produced by the sample evaluation."},"errors":{"type":"array","description":"Errors raised during the sample evaluation.","items":{"type":"object"}}}}},"aiDescription":{"$ref":"#/components/schemas/AIDescription"}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"IAResourceResponse":{"type":"object","description":"Integration app response fields for resources that are part of integration apps","properties":{"_integrationId":{"type":"string","format":"objectId","readOnly":true,"description":"Reference to the specific integration instance that contains this resource.\n\nThis field is only populated for resources that are part of an integration app\ninstallation. It contains the unique identifier (_id) of the integration\nresource that was installed in the account.\n\nThe integration instance represents a specific installed instance of an\nintegration app, with its own configuration, settings, and runtime environment.\n\nThis reference enables:\n- Tracing the resource back to its parent integration instance\n- Permission and access control based on integration ownership\n- Lifecycle management (enabling/disabling, updating, or uninstalling)\n"},"_connectorId":{"type":"string","format":"objectId","readOnly":true,"description":"Integration App (connector) that defines this resource. Present only on resources an\nIntegration App owns. The app locks parts of these documents, and a PUT that changes a\nlocked field answers 200 but keeps the stored value, so read the document back to confirm\na change."}}},"GuardrailConfig":{"type":"object","description":"Selects the check a guardrail applies and carries its settings. `type` picks the check\nand the matching sub-object (`pii`, `moderation`, or `aiAgent`) configures it.\nResponses echo the active sub-object with `confidenceThreshold` defaulted and also\nreturn the inactive `pii` / `moderation` siblings as empty stubs\n(`pii: {entities: [], mask: false}`, `moderation: {categories: []}`) — only the active\ntype's sub-object is meaningful. Guardrails created before the AI-agent stub was\nstripped on write may still return an inert `aiAgent` on `pii` / `moderation` guardrails.","properties":{"type":{"type":"string","enum":["ai_agent","pii","moderation"],"description":"The type of guardrail to apply. Each type requires its corresponding\nsub-configuration object (`aiAgent`, `pii`, or `moderation`)."},"confidenceThreshold":{"type":"number","minimum":0,"maximum":1,"default":0.7,"description":"Confidence threshold (0 to 1). Detections below this threshold are\nignored. Lower values catch more issues but increase false positives."},"aiAgent":{"type":"object","description":"LLM configuration for the check; set when `type` is `ai_agent` and validated\nagainst `GuardrailAiAgentConfig`. On `pii` / `moderation` guardrails a legacy\nserver-written stub may appear here — it is inert, and current servers strip it on\nwrite."},"pii":{"type":"object","required":["entities"],"description":"PII detection configuration. Required when `type` is `pii`.","properties":{"entities":{"type":"array","description":"PII entity types to detect. When `type` is `pii`, at least one\nentry is required; the inactive sibling on other guardrail types\nmay be served with an empty list.","items":{"type":"string","enum":["credit_card_number","card_security_code_cvv_cvc","cryptocurrency_wallet_address","date_and_time","email_address","iban_code","bic_swift_bank_identifier_code","ip_address","location","medical_license_number","national_registration_number","persons_name","phone_number","url","us_bank_account_number","us_drivers_license","us_itin","us_passport_number","us_social_security_number","uk_nhs_number","uk_national_insurance_number","spanish_nif","spanish_nie","italian_fiscal_code","italian_drivers_license","italian_vat_code","italian_passport","italian_identity_card","polish_pesel","finnish_personal_identity_code","singapore_nric_fin","singapore_uen","australian_abn","australian_acn","australian_tfn","australian_medicare","indian_pan","indian_aadhaar","indian_vehicle_registration","indian_voter_id","indian_passport","korean_resident_registration_number"]}},"mask":{"type":"boolean","default":false,"description":"When true, the result also carries `masked`: the evaluated input with each detected\nvalue replaced by asterisks. The record itself is unchanged. With whole-record input\n(no `mapping`, and no top-level `text` field on the record), `masked` is the record\nserialized as one JSON string. When false, PII is flagged only."}}},"moderation":{"type":"object","required":["categories"],"description":"Content moderation configuration. Required when `type` is `moderation`.","properties":{"categories":{"type":"array","description":"Content moderation categories to check. When `type` is\n`moderation`, at least one entry is required; the inactive\nsibling on other guardrail types may be served with an empty\nlist.","items":{"type":"string","enum":["sexual","sexual_minors","hate","hate_threatening","harassment","harassment_threatening","self_harm","self_harm_intent","self_harm_instructions","violence","violence_graphic","illicit","illicit_violent"]}}}}},"required":["type","confidenceThreshold"],"if":{"required":["type"],"properties":{"type":{"const":"pii"}}},"then":{"required":["pii"],"properties":{"pii":{"required":["entities"],"properties":{"entities":{"minItems":1}}}}},"else":{"if":{"required":["type"],"properties":{"type":{"const":"moderation"}}},"then":{"required":["moderation"],"properties":{"moderation":{"required":["categories"],"properties":{"categories":{"minItems":1}}}}},"else":{"required":["aiAgent"],"properties":{"aiAgent":{"$ref":"#/components/schemas/GuardrailAiAgentConfig"}}}}},"GuardrailAiAgentConfig":{"type":"object","description":"LLM configuration for an `ai_agent` guardrail — which provider and model evaluate each\nrecord, with instructions, parameter tuning, and output format. Guardrails never invoke\ntools, so unlike an AI agent import no block here accepts a `tools` array. MCP `prompts`\nand `resources` are accepted on save but never used at run time, so put the policy the\nguardrail must apply in its instructions. Providers come in two families with two\nconfiguration formats:\n\n- **Built-in providers** — each has its own configuration block.\n  - **openai**: OpenAI models (GPT-4.1, GPT-5, etc.). Configure via the `openai` object.\n  - **gemini**: Google Gemini models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.gemini`.\n  - **anthropic**: Anthropic Claude models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.anthropic`.\n- **Catalog providers** — `mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`. Added\n  as catalog data rather than platform code, they share one generic flat format:\n  `model`, `modelOptions`, `instructions`, `output`, and the `prompts` / `resources`\n  arrays directly on this object.\n\nA `_connectionId` on the parent import selects bring-your-own-key (BYOK)\ncredentials. Without one, built-in providers run on platform-managed\ncredentials; catalog providers have no platform-managed credentials, so the\nsave requires one — without it the guardrail fails to save with 422\n`connection_required` on `_connectionId`.\n","required":["provider"],"properties":{"provider":{"type":"string","enum":["openai","gemini","anthropic","mistral","xai","huggingface","deepseek","cohere","groq"],"description":"AI provider to use."},"model":{"type":"string","description":"Model identifier for a catalog provider (generic flat format) — for example\n`grok-4.6`. Built-in providers set the model inside their own block\n(`openai.model`, `litellm.model`) instead."},"modelOptions":{"type":"object","description":"Model tuning for a catalog provider (generic flat format). Which keys, values, and\nranges are accepted is defined per catalog model and validated on save when the\nmodel is a catalog entry.","properties":{"maxOutputTokens":{"type":"number","description":"Maximum number of tokens the model may generate."},"temperature":{"type":"number","description":"Sampling temperature."},"topP":{"type":"number","description":"Nucleus sampling threshold."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Reasoning depth for models that expose it."}}},"instructions":{"type":"string","description":"System prompt for a catalog provider (generic flat format). Built-in providers\nset it inside their own block (`openai.instructions`,\n`litellm._overrides.anthropic.systemInstruction`)."},"output":{"type":"object","description":"Output format for a catalog provider (generic flat format). Built-in providers\nconfigure it inside their own block (`openai.output`, `litellm.responseFormat`).","properties":{"format":{"type":"object","description":"Controls the structure of the model's output.","properties":{"type":{"type":"string","enum":["text","json_schema"],"description":"Output type."},"name":{"type":"string","description":"Name of the JSON schema, for `json_schema` output."},"strict":{"type":"boolean","description":"When true, the model must conform exactly to `jsonSchema`."},"jsonSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema the structured output must conform to, for `json_schema` output."}}},"verbose":{"type":"string","description":"Level of detail in the model's response, for models that expose it."}}},"prompts":{"type":"array","description":"MCP prompt entries saved with a catalog-provider guardrail (generic flat format).\nEach entry references one MCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the prompts."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"openai":{"type":"object","description":"OpenAI-specific configuration. Used when `provider` is \"openai\".\n","required":["model","instructions"],"properties":{"instructions":{"type":"string","maxLength":1000000,"description":"System prompt that defines the check's behavior, goals, and constraints.\n"},"model":{"type":"string","description":"OpenAI model identifier. Open string (not an enum) — model names change frequently."},"reasoning":{"type":"object","description":"Controls depth of reasoning for complex tasks.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"How much reasoning effort the model should invest"},"summary":{"type":"string","enum":["concise","auto","detailed"],"description":"Level of detail in reasoning summaries"}}},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature. Higher values (e.g. 1.5) produce more creative output,\nlower values (e.g. 0.2) produce more focused and deterministic output.\n"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"topLogprobs":{"type":"number","minimum":0,"maximum":20,"description":"Number of most likely tokens to return log probabilities for at each output position."},"maxOutputTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the model's response. Unlike an AI agent import, a guardrail does not receive a server-written value when this is omitted."},"serviceTier":{"type":"string","enum":["auto","default","priority"],"description":"OpenAI service tier. \"priority\" provides higher rate limits and\nlower latency at increased cost."},"output":{"type":"object","description":"Output format configuration. A guardrail stores `format` but doesn't use it: the\nrequest to the model always carries the guardrail's own `validation_result` JSON\nschema (`flagged`, `reasoning`, `confidence`), and the result returns `flagged` and\n`reasoning` whatever `format` holds.","properties":{"format":{"type":"object","description":"Stored output structure. The request to the model uses the guardrail's own\nverdict schema instead (see `output`).\n","properties":{"type":{"type":"string","enum":["text","json_schema","blob"],"description":"Output format type, as stored."},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in. Stored and echoed on\nguardrails for parity with the AI-agent format block — the guardrail form\ndoes not set it today, and neither view changes the model request."},"name":{"type":"string","description":"Name for the output format (used with json_schema)"},"strict":{"type":"boolean","description":"Stored strict-validation flag for `jsonSchema`. A guardrail's model request uses its own verdict schema, so this doesn't apply there."},"jsonSchema":{"type":"object","description":"Stored JSON Schema. Required when `format.type` is \"json_schema\". A guardrail\ndoesn't send it to the model; the request carries the `validation_result`\nverdict schema instead.\n","properties":{"type":{"type":"string","description":"Root type of the stored JSON Schema.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"Field definitions in the stored JSON Schema."},"required":{"type":"array","description":"Property names the stored JSON Schema marks as required.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"Whether the stored JSON Schema allows properties beyond those in `properties`."}}},"schema":{"type":"object","readOnly":true,"additionalProperties":true,"description":"Server-written copy of `jsonSchema`, present in responses once `jsonSchema`\nis set. Send `jsonSchema`, not this field."}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"verbose":{"type":"string","enum":["low","medium","high"],"description":"Level of detail in the model's response"}}},"prompts":{"type":"array","description":"MCP prompt entries saved with the guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}},"litellm":{"type":"object","description":"LiteLLM proxy configuration. Used when `provider` is \"gemini\" or \"anthropic\".\n\nLiteLLM provides a unified interface to multiple AI providers. Gemini-specific\nsettings are in `_overrides.gemini`; Claude-specific settings are in\n`_overrides.anthropic`.\n\n`model` is required when litellm is the active provider path.\n","properties":{"model":{"type":"string","description":"LiteLLM model identifier. For Gemini, models are stored without the `gemini/`\nprefix; for Anthropic, use the Claude model id (e.g. `claude-sonnet-4-6`)."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature"},"maxCompletionTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the response"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"seed":{"type":"number","description":"Random seed for reproducible outputs"},"responseFormat":{"type":"object","description":"Output format configuration","properties":{"type":{"type":"string","description":"Output format type.","enum":["text","json_schema","blob"]},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in; the schema sent to the provider\nis the same either way. Stored and echoed on guardrails for parity with the\nAI-agent format block — the guardrail form does not set it today."},"name":{"type":"string","description":"Name for the output format (used with json_schema)."},"strict":{"type":"boolean","description":"When true, enforces strict schema validation on output."},"jsonSchema":{"type":"object","description":"JSON Schema for structured output. Required when `responseFormat.type` is \"json_schema\".","properties":{"type":{"type":"string","description":"Root JSON Schema type of the structured output; use \"object\" for record-shaped results.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"JSON Schema definitions for each field the structured output may contain."},"required":{"type":"array","description":"Property names the model must include in the structured output.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"When true, the structured output may include properties beyond those defined in `properties`."}}}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"_overrides":{"type":"object","description":"Provider-specific overrides","properties":{"gemini":{"type":"object","description":"Gemini-specific configuration overrides.\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Gemini models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"prompts":{"type":"array","description":"MCP prompt entries saved with a Gemini guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"responseModalities":{"type":"array","description":"Response output modalities","items":{"type":"string","enum":["text","image"]}},"topK":{"type":"number","description":"Top-K sampling parameter for Gemini"},"thinkingConfig":{"type":"object","description":"Controls Gemini's extended thinking capabilities","properties":{"includeThoughts":{"type":"boolean","description":"When true, includes the model's thinking steps in the response."},"thinkingBudget":{"type":"number","minimum":100,"maximum":4000,"description":"Maximum tokens allocated for thinking"},"thinkingLevel":{"type":"string","description":"Controls how much thinking effort the model applies; use higher levels for complex, multi-step tasks at the cost of latency and tokens.","enum":["minimal","low","medium","high"]}}},"imageConfig":{"type":"object","description":"Gemini image generation configuration","properties":{"aspectRatio":{"type":"string","description":"Aspect ratio of generated images; choose a ratio matching the intended display format.","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"]},"imageSize":{"type":"string","description":"Output resolution of generated images; higher resolutions increase detail and file size.","enum":["1K","2K","4K"]}}},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Resolution for media inputs (images, video)"}}},"anthropic":{"type":"object","description":"Claude-specific configuration overrides. Used when `provider` is \"anthropic\".\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Claude models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"topK":{"type":"number","minimum":0,"description":"Top-K sampling parameter. Deprecated on Claude models released after Claude Opus\n4.6, which reject any value at runtime; set it only on older models."},"thinkingConfig":{"type":"object","description":"Controls Claude's extended thinking capabilities.","properties":{"type":{"type":"string","enum":["enabled","disabled","adaptive"],"description":"Extended thinking mode."},"budgetTokens":{"type":"number","minimum":1024,"description":"Maximum tokens allocated for thinking. Required when `type` is \"enabled\" —\nomitting it fails the save with 422 `invalid_thinking_config`."},"display":{"type":"string","enum":["summarized","omitted"],"description":"How thinking output is surfaced in the response."},"effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"How much thinking effort the model applies; use with `type` \"adaptive\". Higher\nvalues (`xhigh`, `max`) may be gated to specific Claude models by the provider."}},"if":{"properties":{"type":{"const":"enabled"}},"required":["type"]},"then":{"required":["budgetTokens"]}},"serviceTier":{"type":"string","enum":["auto","standard_only"],"description":"Anthropic service tier for the request."},"prompts":{"type":"array","description":"MCP prompt entries saved with a Claude guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}}}}}}},"if":{"properties":{"provider":{"const":"openai"}},"required":["provider"]},"then":{"required":["openai"],"properties":{"openai":{"required":["model","instructions"]}}},"else":{"if":{"properties":{"provider":{"enum":["gemini","anthropic"]}},"required":["provider"]},"then":{"required":["litellm"],"properties":{"litellm":{"required":["model"]}}},"else":{"if":{"properties":{"provider":{"enum":["mistral","xai","huggingface","deepseek","cohere","groq"]}},"required":["provider"]},"then":{"required":["model"]}}}},"McpResources":{"type":"array","description":"Governed MCP resources — read-only reference content (policies, schemas, documentation)\npulled from connected MCP servers and made available to the agent as a consistent source\nof truth. Each entry references one MCP connection and the specific resources allowed from it.","items":{"type":"object","required":["type","mcp"],"properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of resource entry. Always \"mcp\"."},"mcp":{"type":"object","required":["_mcpConnectionId","allowedResources"],"description":"MCP server resource configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the resources."},"allowedResources":{"type":"array","minItems":1,"description":"Resources to expose to the agent from the MCP server. Must contain at least one\nentry; each entry identifies one resource by name and URI.","items":{"type":"object","required":["name","uri"],"properties":{"name":{"type":"string","description":"Display name of the MCP resource."},"uri":{"type":"string","description":"URI that identifies the resource on the MCP server."}}}}}}}}},"MappingField":{"type":"object","description":"One Mapper 1.0 field-mapping entry.","properties":{"generate":{"type":"string","description":"Target field path to write on the destination record."},"extract":{"type":"string","description":"Source expression. Accepts:\n- A dot path from the record root (e.g. `email`, `address.city`), read from the\n  incoming record. A path that matches no field writes nothing.\n- Handlebars template (contains `{{`) for concatenation /\n  formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,\n  `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the\n  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`\n  render nothing, so the field is left out even when the record has the value.\n\nA `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare\nstring is read as a field path, not a constant: set constants in `hardCodedValue`.\nOmit when using `hardCodedValue`.\n"},"hardCodedValue":{"type":["string","null"],"description":"Static value written to `generate` instead of extracting from the source record."},"dataType":{"type":"string","enum":["string","number","boolean","numberarray","stringarray","json"],"description":"Data type coercion applied to the mapped value."},"discardIfEmpty":{"type":"boolean","description":"When true, the field is omitted from the output when the extracted value is empty."},"immutable":{"type":"boolean","description":"When true, the mapped value cannot be overwritten by later mapping steps."},"lookupName":{"type":"string","description":"Name of an entry in the import's `lookups` array (`http.lookups` on an HTTP import) used to translate the value."},"default":{"type":["string","null"],"description":"Fallback value written when the source value is an empty string, null or\nmissing. Without a default, an empty string and null are written as they are\nand a missing field is left out."},"extractDateFormat":{"type":"string","description":"Date format of the source value, used to parse it before conversion."},"extractDateTimezone":{"type":"string","description":"Timezone applied when parsing the source date value."},"generateDateFormat":{"type":"string","description":"Date format applied to the value written to the destination."},"generateDateTimezone":{"type":"string","description":"Timezone applied when formatting the destination date value."},"conditional":{"type":"object","description":"Only apply this mapping entry when the given condition is satisfied.\n","properties":{"when":{"type":"string","enum":["record_created","record_updated","extract_not_empty","lookup_not_empty","lookup_empty","expression"],"description":"Condition that gates whether this mapping entry is applied.\n`lookup_not_empty` / `lookup_empty` evaluate the lookup named by the\nsibling `lookupName`; `expression` evaluates the sibling `expression`.\n"},"lookupName":{"type":"string","description":"Lookup to evaluate for the `lookup_not_empty` / `lookup_empty`\nconditions.\n"},"expression":{"type":"string","description":"Expression evaluated when `when` is `expression`.\n"}}}}},"AIDescription":{"type":"object","description":"AI-generated descriptions and documentation for the resource.\n\nThis object contains automatically generated content that helps users\nunderstand the purpose, behavior, and configuration of the resource without\nrequiring them to analyze the technical details. The AI-generated content\nis sanitized and safe for display in the UI.\n","properties":{"summary":{"type":["string","null"],"description":"Brief AI-generated summary of the resource's purpose and functionality.\n\nThis concise description provides a quick overview of what the resource does,\nwhat systems it interacts with, and its primary role in the integration.\nThe summary is suitable for display in list views, dashboards, and other\ncontexts where space is limited.\n\nMaximum length: 10KB\n"},"detailed":{"type":["string","null"],"description":"Comprehensive AI-generated description of the resource's functionality.\n\nThis detailed explanation covers the resource's purpose, configuration details,\ndata flow patterns, filtering logic, and other technical aspects. It provides\nin-depth information suitable for documentation, tooltips, or detailed views\nin the administration interface.\n\nThe content may include HTML formatting for improved readability.\n\nMaximum length: 10KB\n"},"generatedOn":{"type":["string","null"],"format":"date-time","description":"Timestamp indicating when the AI description was generated.\n\nThis field helps track the freshness of the AI-generated content and\ndetermine when it might need to be regenerated due to changes in the\nresource's configuration or behavior.\n\nThe timestamp is recorded in ISO 8601 format with UTC timezone (Z suffix).\n"}}}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/imports":{"get":{"summary":"List guardrails","description":"Returns all imports in the account, not just guardrails. Filter\nclient-side by `adaptorType: \"GuardrailImport\"` to isolate\nguardrails.","operationId":"listGuardrails","tags":["Guardrails"],"parameters":[{"$ref":"#/components/parameters/Include"},{"$ref":"#/components/parameters/Exclude"}],"responses":{"200":{"description":"Successfully retrieved list of imports","headers":{"Link":{"description":"RFC-5988 pagination links. When more pages remain, includes a `<...>; rel=\"next\"` entry;\nabsent on the final page.\n","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Guardrail"}}}}},"204":{"description":"No imports exist in the account"},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```

## Create a guardrail

> Creates a new guardrail import. \`\_connectionId\` is only needed for\
> BYOK \`ai\_agent\` guardrails.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Request":{"type":"object","description":"Configuration for a guardrail import. `_connectionId` is only\nrequired for BYOK `ai_agent` guardrails.","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail."},"description":{"type":"string","maxLength":5120,"description":"Optional description of the guardrail's purpose."},"_connectionId":{"type":"string","format":"objectId","description":"Connection for BYOK (bring your own key) — only meaningful for `ai_agent` type\nguardrails. Optional for the built-in providers (`openai`, `gemini`, `anthropic`),\nwhich run on platform-managed credentials when it is omitted; catalog providers\n(`mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`) have no platform-managed\ncredentials and need it to run."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Must be `GuardrailImport`."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 mapping that selects the guardrail's input from the\nincoming record. The UI writes a single field entry that maps a\nrecord field to the `text` input (e.g.\n`{\"fields\": [{\"extract\": \"employeeSummary\", \"generate\": \"text\"}]}`);\nonly that field is evaluated, and fields outside it are neither\nscanned nor masked. A mapping can also generate `record`, an object\nevaluated as its JSON. Optional — when omitted the whole record is\nevaluated, serialized as JSON, unless the record has its own\ntop-level `text` field, which is then evaluated alone. The server\nserves this field only when populated.","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (`text`, or `record` for an object).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Controls the shape of the input passed to the guardrail's\nprocessing pipeline, exactly as on other imports. The UI writes\n`record` explicitly on new guardrails; when the field is absent\nthe platform behaves as `record`."}},"required":["name","adaptorType","guardrail"]},"GuardrailConfig":{"type":"object","description":"Selects the check a guardrail applies and carries its settings. `type` picks the check\nand the matching sub-object (`pii`, `moderation`, or `aiAgent`) configures it.\nResponses echo the active sub-object with `confidenceThreshold` defaulted and also\nreturn the inactive `pii` / `moderation` siblings as empty stubs\n(`pii: {entities: [], mask: false}`, `moderation: {categories: []}`) — only the active\ntype's sub-object is meaningful. Guardrails created before the AI-agent stub was\nstripped on write may still return an inert `aiAgent` on `pii` / `moderation` guardrails.","properties":{"type":{"type":"string","enum":["ai_agent","pii","moderation"],"description":"The type of guardrail to apply. Each type requires its corresponding\nsub-configuration object (`aiAgent`, `pii`, or `moderation`)."},"confidenceThreshold":{"type":"number","minimum":0,"maximum":1,"default":0.7,"description":"Confidence threshold (0 to 1). Detections below this threshold are\nignored. Lower values catch more issues but increase false positives."},"aiAgent":{"type":"object","description":"LLM configuration for the check; set when `type` is `ai_agent` and validated\nagainst `GuardrailAiAgentConfig`. On `pii` / `moderation` guardrails a legacy\nserver-written stub may appear here — it is inert, and current servers strip it on\nwrite."},"pii":{"type":"object","required":["entities"],"description":"PII detection configuration. Required when `type` is `pii`.","properties":{"entities":{"type":"array","description":"PII entity types to detect. When `type` is `pii`, at least one\nentry is required; the inactive sibling on other guardrail types\nmay be served with an empty list.","items":{"type":"string","enum":["credit_card_number","card_security_code_cvv_cvc","cryptocurrency_wallet_address","date_and_time","email_address","iban_code","bic_swift_bank_identifier_code","ip_address","location","medical_license_number","national_registration_number","persons_name","phone_number","url","us_bank_account_number","us_drivers_license","us_itin","us_passport_number","us_social_security_number","uk_nhs_number","uk_national_insurance_number","spanish_nif","spanish_nie","italian_fiscal_code","italian_drivers_license","italian_vat_code","italian_passport","italian_identity_card","polish_pesel","finnish_personal_identity_code","singapore_nric_fin","singapore_uen","australian_abn","australian_acn","australian_tfn","australian_medicare","indian_pan","indian_aadhaar","indian_vehicle_registration","indian_voter_id","indian_passport","korean_resident_registration_number"]}},"mask":{"type":"boolean","default":false,"description":"When true, the result also carries `masked`: the evaluated input with each detected\nvalue replaced by asterisks. The record itself is unchanged. With whole-record input\n(no `mapping`, and no top-level `text` field on the record), `masked` is the record\nserialized as one JSON string. When false, PII is flagged only."}}},"moderation":{"type":"object","required":["categories"],"description":"Content moderation configuration. Required when `type` is `moderation`.","properties":{"categories":{"type":"array","description":"Content moderation categories to check. When `type` is\n`moderation`, at least one entry is required; the inactive\nsibling on other guardrail types may be served with an empty\nlist.","items":{"type":"string","enum":["sexual","sexual_minors","hate","hate_threatening","harassment","harassment_threatening","self_harm","self_harm_intent","self_harm_instructions","violence","violence_graphic","illicit","illicit_violent"]}}}}},"required":["type","confidenceThreshold"],"if":{"required":["type"],"properties":{"type":{"const":"pii"}}},"then":{"required":["pii"],"properties":{"pii":{"required":["entities"],"properties":{"entities":{"minItems":1}}}}},"else":{"if":{"required":["type"],"properties":{"type":{"const":"moderation"}}},"then":{"required":["moderation"],"properties":{"moderation":{"required":["categories"],"properties":{"categories":{"minItems":1}}}}},"else":{"required":["aiAgent"],"properties":{"aiAgent":{"$ref":"#/components/schemas/GuardrailAiAgentConfig"}}}}},"GuardrailAiAgentConfig":{"type":"object","description":"LLM configuration for an `ai_agent` guardrail — which provider and model evaluate each\nrecord, with instructions, parameter tuning, and output format. Guardrails never invoke\ntools, so unlike an AI agent import no block here accepts a `tools` array. MCP `prompts`\nand `resources` are accepted on save but never used at run time, so put the policy the\nguardrail must apply in its instructions. Providers come in two families with two\nconfiguration formats:\n\n- **Built-in providers** — each has its own configuration block.\n  - **openai**: OpenAI models (GPT-4.1, GPT-5, etc.). Configure via the `openai` object.\n  - **gemini**: Google Gemini models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.gemini`.\n  - **anthropic**: Anthropic Claude models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.anthropic`.\n- **Catalog providers** — `mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`. Added\n  as catalog data rather than platform code, they share one generic flat format:\n  `model`, `modelOptions`, `instructions`, `output`, and the `prompts` / `resources`\n  arrays directly on this object.\n\nA `_connectionId` on the parent import selects bring-your-own-key (BYOK)\ncredentials. Without one, built-in providers run on platform-managed\ncredentials; catalog providers have no platform-managed credentials, so the\nsave requires one — without it the guardrail fails to save with 422\n`connection_required` on `_connectionId`.\n","required":["provider"],"properties":{"provider":{"type":"string","enum":["openai","gemini","anthropic","mistral","xai","huggingface","deepseek","cohere","groq"],"description":"AI provider to use."},"model":{"type":"string","description":"Model identifier for a catalog provider (generic flat format) — for example\n`grok-4.6`. Built-in providers set the model inside their own block\n(`openai.model`, `litellm.model`) instead."},"modelOptions":{"type":"object","description":"Model tuning for a catalog provider (generic flat format). Which keys, values, and\nranges are accepted is defined per catalog model and validated on save when the\nmodel is a catalog entry.","properties":{"maxOutputTokens":{"type":"number","description":"Maximum number of tokens the model may generate."},"temperature":{"type":"number","description":"Sampling temperature."},"topP":{"type":"number","description":"Nucleus sampling threshold."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Reasoning depth for models that expose it."}}},"instructions":{"type":"string","description":"System prompt for a catalog provider (generic flat format). Built-in providers\nset it inside their own block (`openai.instructions`,\n`litellm._overrides.anthropic.systemInstruction`)."},"output":{"type":"object","description":"Output format for a catalog provider (generic flat format). Built-in providers\nconfigure it inside their own block (`openai.output`, `litellm.responseFormat`).","properties":{"format":{"type":"object","description":"Controls the structure of the model's output.","properties":{"type":{"type":"string","enum":["text","json_schema"],"description":"Output type."},"name":{"type":"string","description":"Name of the JSON schema, for `json_schema` output."},"strict":{"type":"boolean","description":"When true, the model must conform exactly to `jsonSchema`."},"jsonSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema the structured output must conform to, for `json_schema` output."}}},"verbose":{"type":"string","description":"Level of detail in the model's response, for models that expose it."}}},"prompts":{"type":"array","description":"MCP prompt entries saved with a catalog-provider guardrail (generic flat format).\nEach entry references one MCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the prompts."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"openai":{"type":"object","description":"OpenAI-specific configuration. Used when `provider` is \"openai\".\n","required":["model","instructions"],"properties":{"instructions":{"type":"string","maxLength":1000000,"description":"System prompt that defines the check's behavior, goals, and constraints.\n"},"model":{"type":"string","description":"OpenAI model identifier. Open string (not an enum) — model names change frequently."},"reasoning":{"type":"object","description":"Controls depth of reasoning for complex tasks.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"How much reasoning effort the model should invest"},"summary":{"type":"string","enum":["concise","auto","detailed"],"description":"Level of detail in reasoning summaries"}}},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature. Higher values (e.g. 1.5) produce more creative output,\nlower values (e.g. 0.2) produce more focused and deterministic output.\n"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"topLogprobs":{"type":"number","minimum":0,"maximum":20,"description":"Number of most likely tokens to return log probabilities for at each output position."},"maxOutputTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the model's response. Unlike an AI agent import, a guardrail does not receive a server-written value when this is omitted."},"serviceTier":{"type":"string","enum":["auto","default","priority"],"description":"OpenAI service tier. \"priority\" provides higher rate limits and\nlower latency at increased cost."},"output":{"type":"object","description":"Output format configuration. A guardrail stores `format` but doesn't use it: the\nrequest to the model always carries the guardrail's own `validation_result` JSON\nschema (`flagged`, `reasoning`, `confidence`), and the result returns `flagged` and\n`reasoning` whatever `format` holds.","properties":{"format":{"type":"object","description":"Stored output structure. The request to the model uses the guardrail's own\nverdict schema instead (see `output`).\n","properties":{"type":{"type":"string","enum":["text","json_schema","blob"],"description":"Output format type, as stored."},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in. Stored and echoed on\nguardrails for parity with the AI-agent format block — the guardrail form\ndoes not set it today, and neither view changes the model request."},"name":{"type":"string","description":"Name for the output format (used with json_schema)"},"strict":{"type":"boolean","description":"Stored strict-validation flag for `jsonSchema`. A guardrail's model request uses its own verdict schema, so this doesn't apply there."},"jsonSchema":{"type":"object","description":"Stored JSON Schema. Required when `format.type` is \"json_schema\". A guardrail\ndoesn't send it to the model; the request carries the `validation_result`\nverdict schema instead.\n","properties":{"type":{"type":"string","description":"Root type of the stored JSON Schema.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"Field definitions in the stored JSON Schema."},"required":{"type":"array","description":"Property names the stored JSON Schema marks as required.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"Whether the stored JSON Schema allows properties beyond those in `properties`."}}},"schema":{"type":"object","readOnly":true,"additionalProperties":true,"description":"Server-written copy of `jsonSchema`, present in responses once `jsonSchema`\nis set. Send `jsonSchema`, not this field."}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"verbose":{"type":"string","enum":["low","medium","high"],"description":"Level of detail in the model's response"}}},"prompts":{"type":"array","description":"MCP prompt entries saved with the guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}},"litellm":{"type":"object","description":"LiteLLM proxy configuration. Used when `provider` is \"gemini\" or \"anthropic\".\n\nLiteLLM provides a unified interface to multiple AI providers. Gemini-specific\nsettings are in `_overrides.gemini`; Claude-specific settings are in\n`_overrides.anthropic`.\n\n`model` is required when litellm is the active provider path.\n","properties":{"model":{"type":"string","description":"LiteLLM model identifier. For Gemini, models are stored without the `gemini/`\nprefix; for Anthropic, use the Claude model id (e.g. `claude-sonnet-4-6`)."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature"},"maxCompletionTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the response"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"seed":{"type":"number","description":"Random seed for reproducible outputs"},"responseFormat":{"type":"object","description":"Output format configuration","properties":{"type":{"type":"string","description":"Output format type.","enum":["text","json_schema","blob"]},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in; the schema sent to the provider\nis the same either way. Stored and echoed on guardrails for parity with the\nAI-agent format block — the guardrail form does not set it today."},"name":{"type":"string","description":"Name for the output format (used with json_schema)."},"strict":{"type":"boolean","description":"When true, enforces strict schema validation on output."},"jsonSchema":{"type":"object","description":"JSON Schema for structured output. Required when `responseFormat.type` is \"json_schema\".","properties":{"type":{"type":"string","description":"Root JSON Schema type of the structured output; use \"object\" for record-shaped results.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"JSON Schema definitions for each field the structured output may contain."},"required":{"type":"array","description":"Property names the model must include in the structured output.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"When true, the structured output may include properties beyond those defined in `properties`."}}}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"_overrides":{"type":"object","description":"Provider-specific overrides","properties":{"gemini":{"type":"object","description":"Gemini-specific configuration overrides.\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Gemini models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"prompts":{"type":"array","description":"MCP prompt entries saved with a Gemini guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"responseModalities":{"type":"array","description":"Response output modalities","items":{"type":"string","enum":["text","image"]}},"topK":{"type":"number","description":"Top-K sampling parameter for Gemini"},"thinkingConfig":{"type":"object","description":"Controls Gemini's extended thinking capabilities","properties":{"includeThoughts":{"type":"boolean","description":"When true, includes the model's thinking steps in the response."},"thinkingBudget":{"type":"number","minimum":100,"maximum":4000,"description":"Maximum tokens allocated for thinking"},"thinkingLevel":{"type":"string","description":"Controls how much thinking effort the model applies; use higher levels for complex, multi-step tasks at the cost of latency and tokens.","enum":["minimal","low","medium","high"]}}},"imageConfig":{"type":"object","description":"Gemini image generation configuration","properties":{"aspectRatio":{"type":"string","description":"Aspect ratio of generated images; choose a ratio matching the intended display format.","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"]},"imageSize":{"type":"string","description":"Output resolution of generated images; higher resolutions increase detail and file size.","enum":["1K","2K","4K"]}}},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Resolution for media inputs (images, video)"}}},"anthropic":{"type":"object","description":"Claude-specific configuration overrides. Used when `provider` is \"anthropic\".\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Claude models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"topK":{"type":"number","minimum":0,"description":"Top-K sampling parameter. Deprecated on Claude models released after Claude Opus\n4.6, which reject any value at runtime; set it only on older models."},"thinkingConfig":{"type":"object","description":"Controls Claude's extended thinking capabilities.","properties":{"type":{"type":"string","enum":["enabled","disabled","adaptive"],"description":"Extended thinking mode."},"budgetTokens":{"type":"number","minimum":1024,"description":"Maximum tokens allocated for thinking. Required when `type` is \"enabled\" —\nomitting it fails the save with 422 `invalid_thinking_config`."},"display":{"type":"string","enum":["summarized","omitted"],"description":"How thinking output is surfaced in the response."},"effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"How much thinking effort the model applies; use with `type` \"adaptive\". Higher\nvalues (`xhigh`, `max`) may be gated to specific Claude models by the provider."}},"if":{"properties":{"type":{"const":"enabled"}},"required":["type"]},"then":{"required":["budgetTokens"]}},"serviceTier":{"type":"string","enum":["auto","standard_only"],"description":"Anthropic service tier for the request."},"prompts":{"type":"array","description":"MCP prompt entries saved with a Claude guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}}}}}}},"if":{"properties":{"provider":{"const":"openai"}},"required":["provider"]},"then":{"required":["openai"],"properties":{"openai":{"required":["model","instructions"]}}},"else":{"if":{"properties":{"provider":{"enum":["gemini","anthropic"]}},"required":["provider"]},"then":{"required":["litellm"],"properties":{"litellm":{"required":["model"]}}},"else":{"if":{"properties":{"provider":{"enum":["mistral","xai","huggingface","deepseek","cohere","groq"]}},"required":["provider"]},"then":{"required":["model"]}}}},"McpResources":{"type":"array","description":"Governed MCP resources — read-only reference content (policies, schemas, documentation)\npulled from connected MCP servers and made available to the agent as a consistent source\nof truth. Each entry references one MCP connection and the specific resources allowed from it.","items":{"type":"object","required":["type","mcp"],"properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of resource entry. Always \"mcp\"."},"mcp":{"type":"object","required":["_mcpConnectionId","allowedResources"],"description":"MCP server resource configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the resources."},"allowedResources":{"type":"array","minItems":1,"description":"Resources to expose to the agent from the MCP server. Must contain at least one\nentry; each entry identifies one resource by name and URI.","items":{"type":"object","required":["name","uri"],"properties":{"name":{"type":"string","description":"Display name of the MCP resource."},"uri":{"type":"string","description":"URI that identifies the resource on the MCP server."}}}}}}}}},"MappingField":{"type":"object","description":"One Mapper 1.0 field-mapping entry.","properties":{"generate":{"type":"string","description":"Target field path to write on the destination record."},"extract":{"type":"string","description":"Source expression. Accepts:\n- A dot path from the record root (e.g. `email`, `address.city`), read from the\n  incoming record. A path that matches no field writes nothing.\n- Handlebars template (contains `{{`) for concatenation /\n  formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,\n  `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the\n  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`\n  render nothing, so the field is left out even when the record has the value.\n\nA `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare\nstring is read as a field path, not a constant: set constants in `hardCodedValue`.\nOmit when using `hardCodedValue`.\n"},"hardCodedValue":{"type":["string","null"],"description":"Static value written to `generate` instead of extracting from the source record."},"dataType":{"type":"string","enum":["string","number","boolean","numberarray","stringarray","json"],"description":"Data type coercion applied to the mapped value."},"discardIfEmpty":{"type":"boolean","description":"When true, the field is omitted from the output when the extracted value is empty."},"immutable":{"type":"boolean","description":"When true, the mapped value cannot be overwritten by later mapping steps."},"lookupName":{"type":"string","description":"Name of an entry in the import's `lookups` array (`http.lookups` on an HTTP import) used to translate the value."},"default":{"type":["string","null"],"description":"Fallback value written when the source value is an empty string, null or\nmissing. Without a default, an empty string and null are written as they are\nand a missing field is left out."},"extractDateFormat":{"type":"string","description":"Date format of the source value, used to parse it before conversion."},"extractDateTimezone":{"type":"string","description":"Timezone applied when parsing the source date value."},"generateDateFormat":{"type":"string","description":"Date format applied to the value written to the destination."},"generateDateTimezone":{"type":"string","description":"Timezone applied when formatting the destination date value."},"conditional":{"type":"object","description":"Only apply this mapping entry when the given condition is satisfied.\n","properties":{"when":{"type":"string","enum":["record_created","record_updated","extract_not_empty","lookup_not_empty","lookup_empty","expression"],"description":"Condition that gates whether this mapping entry is applied.\n`lookup_not_empty` / `lookup_empty` evaluate the lookup named by the\nsibling `lookupName`; `expression` evaluates the sibling `expression`.\n"},"lookupName":{"type":"string","description":"Lookup to evaluate for the `lookup_not_empty` / `lookup_empty`\nconditions.\n"},"expression":{"type":"string","description":"Expression evaluated when `when` is `expression`.\n"}}}}},"Guardrail":{"type":"object","description":"Guardrail import object as returned by the API.","required":["_id","name","adaptorType","guardrail","apiIdentifier","lookups","createdAt","lastModified"],"allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"$ref":"#/components/schemas/IAResourceResponse"},{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail. May be empty if created without one."},"description":{"type":"string","maxLength":5120,"description":"Free-text note describing the guardrail's purpose."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Always `GuardrailImport` for guardrails."},"_connectionId":{"type":"string","format":"objectId","description":"BYOK connection backing an `ai_agent` guardrail. Absent when a built-in provider runs on platform-managed credentials."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source guardrail this one was cloned from. Present only on clones."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 input mapping that selects what is evaluated: a field mapped\nto `text`, or an object mapped to `record` (evaluated as its JSON).\nServed only when populated — a guardrail created without one has no\n`mapping` in responses, and evaluates the whole record (or the\nrecord's own top-level `text` field, when it has one).","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (typically `text`).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Input shape for the guardrail's processing pipeline. Present when set; absence means `record`."},"apiIdentifier":{"type":"string","readOnly":true,"description":"Ten-character hex identifier used to invoke the guardrail over HTTP."},"lookups":{"type":"array","description":"Static lookup configurations. Guardrail (AI agent) imports support static lookups only; defaults to an empty array.","items":{"type":"object"}},"mappings":{"type":"array","description":"Import field mappings. Each entry requires a `status` field. Typically empty for guardrails.","items":{"type":"object"}},"mockResponse":{"type":"array","description":"Sample evaluation results stored with the guardrail. The UI populates these from a\npreview run; accepted on create and update. Each item has the shape of the result a\nrun produces for one record, with the verdict fields (`flagged`, `masked`,\n`reasoning`) at the top level.","items":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP-style status code of the sample evaluation."},"flagged":{"type":"boolean","description":"When true, the sample input tripped the guardrail."},"reasoning":{"type":"string","description":"The model's explanation of the verdict. Returned by `ai_agent` guardrails,\nwhatever output format the guardrail stores."},"_json":{"type":"object","description":"Empty (`{}`) in the result of a saved guardrail invoked by id. A preview's result\ncarries the raw verdict under `_json.data`: `flagged`, `reasoning` and\n`confidence` for `ai_agent`, or `flagged`, `masked` and `entities_detected`\nfor `pii`. Read the top-level fields, not `_json`.","additionalProperties":true},"ignored":{"type":"boolean","description":"When true, the result fell below `confidenceThreshold` and was disregarded."},"masked":{"type":"string","description":"Sample input with detected values masked. Populated for `pii` guardrails with masking enabled."},"dataURI":{"type":"string","description":"Data URI of any artifact produced by the sample evaluation."},"errors":{"type":"array","description":"Errors raised during the sample evaluation.","items":{"type":"object"}}}}},"aiDescription":{"$ref":"#/components/schemas/AIDescription"}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"IAResourceResponse":{"type":"object","description":"Integration app response fields for resources that are part of integration apps","properties":{"_integrationId":{"type":"string","format":"objectId","readOnly":true,"description":"Reference to the specific integration instance that contains this resource.\n\nThis field is only populated for resources that are part of an integration app\ninstallation. It contains the unique identifier (_id) of the integration\nresource that was installed in the account.\n\nThe integration instance represents a specific installed instance of an\nintegration app, with its own configuration, settings, and runtime environment.\n\nThis reference enables:\n- Tracing the resource back to its parent integration instance\n- Permission and access control based on integration ownership\n- Lifecycle management (enabling/disabling, updating, or uninstalling)\n"},"_connectorId":{"type":"string","format":"objectId","readOnly":true,"description":"Integration App (connector) that defines this resource. Present only on resources an\nIntegration App owns. The app locks parts of these documents, and a PUT that changes a\nlocked field answers 200 but keeps the stored value, so read the document back to confirm\na change."}}},"AIDescription":{"type":"object","description":"AI-generated descriptions and documentation for the resource.\n\nThis object contains automatically generated content that helps users\nunderstand the purpose, behavior, and configuration of the resource without\nrequiring them to analyze the technical details. The AI-generated content\nis sanitized and safe for display in the UI.\n","properties":{"summary":{"type":["string","null"],"description":"Brief AI-generated summary of the resource's purpose and functionality.\n\nThis concise description provides a quick overview of what the resource does,\nwhat systems it interacts with, and its primary role in the integration.\nThe summary is suitable for display in list views, dashboards, and other\ncontexts where space is limited.\n\nMaximum length: 10KB\n"},"detailed":{"type":["string","null"],"description":"Comprehensive AI-generated description of the resource's functionality.\n\nThis detailed explanation covers the resource's purpose, configuration details,\ndata flow patterns, filtering logic, and other technical aspects. It provides\nin-depth information suitable for documentation, tooltips, or detailed views\nin the administration interface.\n\nThe content may include HTML formatting for improved readability.\n\nMaximum length: 10KB\n"},"generatedOn":{"type":["string","null"],"format":"date-time","description":"Timestamp indicating when the AI description was generated.\n\nThis field helps track the freshness of the AI-generated content and\ndetermine when it might need to be regenerated due to changes in the\nresource's configuration or behavior.\n\nThe timestamp is recorded in ISO 8601 format with UTC timezone (Z suffix).\n"}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/imports":{"post":{"summary":"Create a guardrail","description":"Creates a new guardrail import. `_connectionId` is only needed for\nBYOK `ai_agent` guardrails.","operationId":"createGuardrail","tags":["Guardrails"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"201":{"description":"Guardrail created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guardrail"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Get a guardrail

> Returns the complete configuration of a specific guardrail import.\
> The \`\_id\` is from the imports collection — the same ID used for any\
> import type.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Guardrail":{"type":"object","description":"Guardrail import object as returned by the API.","required":["_id","name","adaptorType","guardrail","apiIdentifier","lookups","createdAt","lastModified"],"allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"$ref":"#/components/schemas/IAResourceResponse"},{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail. May be empty if created without one."},"description":{"type":"string","maxLength":5120,"description":"Free-text note describing the guardrail's purpose."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Always `GuardrailImport` for guardrails."},"_connectionId":{"type":"string","format":"objectId","description":"BYOK connection backing an `ai_agent` guardrail. Absent when a built-in provider runs on platform-managed credentials."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source guardrail this one was cloned from. Present only on clones."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 input mapping that selects what is evaluated: a field mapped\nto `text`, or an object mapped to `record` (evaluated as its JSON).\nServed only when populated — a guardrail created without one has no\n`mapping` in responses, and evaluates the whole record (or the\nrecord's own top-level `text` field, when it has one).","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (typically `text`).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Input shape for the guardrail's processing pipeline. Present when set; absence means `record`."},"apiIdentifier":{"type":"string","readOnly":true,"description":"Ten-character hex identifier used to invoke the guardrail over HTTP."},"lookups":{"type":"array","description":"Static lookup configurations. Guardrail (AI agent) imports support static lookups only; defaults to an empty array.","items":{"type":"object"}},"mappings":{"type":"array","description":"Import field mappings. Each entry requires a `status` field. Typically empty for guardrails.","items":{"type":"object"}},"mockResponse":{"type":"array","description":"Sample evaluation results stored with the guardrail. The UI populates these from a\npreview run; accepted on create and update. Each item has the shape of the result a\nrun produces for one record, with the verdict fields (`flagged`, `masked`,\n`reasoning`) at the top level.","items":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP-style status code of the sample evaluation."},"flagged":{"type":"boolean","description":"When true, the sample input tripped the guardrail."},"reasoning":{"type":"string","description":"The model's explanation of the verdict. Returned by `ai_agent` guardrails,\nwhatever output format the guardrail stores."},"_json":{"type":"object","description":"Empty (`{}`) in the result of a saved guardrail invoked by id. A preview's result\ncarries the raw verdict under `_json.data`: `flagged`, `reasoning` and\n`confidence` for `ai_agent`, or `flagged`, `masked` and `entities_detected`\nfor `pii`. Read the top-level fields, not `_json`.","additionalProperties":true},"ignored":{"type":"boolean","description":"When true, the result fell below `confidenceThreshold` and was disregarded."},"masked":{"type":"string","description":"Sample input with detected values masked. Populated for `pii` guardrails with masking enabled."},"dataURI":{"type":"string","description":"Data URI of any artifact produced by the sample evaluation."},"errors":{"type":"array","description":"Errors raised during the sample evaluation.","items":{"type":"object"}}}}},"aiDescription":{"$ref":"#/components/schemas/AIDescription"}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"IAResourceResponse":{"type":"object","description":"Integration app response fields for resources that are part of integration apps","properties":{"_integrationId":{"type":"string","format":"objectId","readOnly":true,"description":"Reference to the specific integration instance that contains this resource.\n\nThis field is only populated for resources that are part of an integration app\ninstallation. It contains the unique identifier (_id) of the integration\nresource that was installed in the account.\n\nThe integration instance represents a specific installed instance of an\nintegration app, with its own configuration, settings, and runtime environment.\n\nThis reference enables:\n- Tracing the resource back to its parent integration instance\n- Permission and access control based on integration ownership\n- Lifecycle management (enabling/disabling, updating, or uninstalling)\n"},"_connectorId":{"type":"string","format":"objectId","readOnly":true,"description":"Integration App (connector) that defines this resource. Present only on resources an\nIntegration App owns. The app locks parts of these documents, and a PUT that changes a\nlocked field answers 200 but keeps the stored value, so read the document back to confirm\na change."}}},"GuardrailConfig":{"type":"object","description":"Selects the check a guardrail applies and carries its settings. `type` picks the check\nand the matching sub-object (`pii`, `moderation`, or `aiAgent`) configures it.\nResponses echo the active sub-object with `confidenceThreshold` defaulted and also\nreturn the inactive `pii` / `moderation` siblings as empty stubs\n(`pii: {entities: [], mask: false}`, `moderation: {categories: []}`) — only the active\ntype's sub-object is meaningful. Guardrails created before the AI-agent stub was\nstripped on write may still return an inert `aiAgent` on `pii` / `moderation` guardrails.","properties":{"type":{"type":"string","enum":["ai_agent","pii","moderation"],"description":"The type of guardrail to apply. Each type requires its corresponding\nsub-configuration object (`aiAgent`, `pii`, or `moderation`)."},"confidenceThreshold":{"type":"number","minimum":0,"maximum":1,"default":0.7,"description":"Confidence threshold (0 to 1). Detections below this threshold are\nignored. Lower values catch more issues but increase false positives."},"aiAgent":{"type":"object","description":"LLM configuration for the check; set when `type` is `ai_agent` and validated\nagainst `GuardrailAiAgentConfig`. On `pii` / `moderation` guardrails a legacy\nserver-written stub may appear here — it is inert, and current servers strip it on\nwrite."},"pii":{"type":"object","required":["entities"],"description":"PII detection configuration. Required when `type` is `pii`.","properties":{"entities":{"type":"array","description":"PII entity types to detect. When `type` is `pii`, at least one\nentry is required; the inactive sibling on other guardrail types\nmay be served with an empty list.","items":{"type":"string","enum":["credit_card_number","card_security_code_cvv_cvc","cryptocurrency_wallet_address","date_and_time","email_address","iban_code","bic_swift_bank_identifier_code","ip_address","location","medical_license_number","national_registration_number","persons_name","phone_number","url","us_bank_account_number","us_drivers_license","us_itin","us_passport_number","us_social_security_number","uk_nhs_number","uk_national_insurance_number","spanish_nif","spanish_nie","italian_fiscal_code","italian_drivers_license","italian_vat_code","italian_passport","italian_identity_card","polish_pesel","finnish_personal_identity_code","singapore_nric_fin","singapore_uen","australian_abn","australian_acn","australian_tfn","australian_medicare","indian_pan","indian_aadhaar","indian_vehicle_registration","indian_voter_id","indian_passport","korean_resident_registration_number"]}},"mask":{"type":"boolean","default":false,"description":"When true, the result also carries `masked`: the evaluated input with each detected\nvalue replaced by asterisks. The record itself is unchanged. With whole-record input\n(no `mapping`, and no top-level `text` field on the record), `masked` is the record\nserialized as one JSON string. When false, PII is flagged only."}}},"moderation":{"type":"object","required":["categories"],"description":"Content moderation configuration. Required when `type` is `moderation`.","properties":{"categories":{"type":"array","description":"Content moderation categories to check. When `type` is\n`moderation`, at least one entry is required; the inactive\nsibling on other guardrail types may be served with an empty\nlist.","items":{"type":"string","enum":["sexual","sexual_minors","hate","hate_threatening","harassment","harassment_threatening","self_harm","self_harm_intent","self_harm_instructions","violence","violence_graphic","illicit","illicit_violent"]}}}}},"required":["type","confidenceThreshold"],"if":{"required":["type"],"properties":{"type":{"const":"pii"}}},"then":{"required":["pii"],"properties":{"pii":{"required":["entities"],"properties":{"entities":{"minItems":1}}}}},"else":{"if":{"required":["type"],"properties":{"type":{"const":"moderation"}}},"then":{"required":["moderation"],"properties":{"moderation":{"required":["categories"],"properties":{"categories":{"minItems":1}}}}},"else":{"required":["aiAgent"],"properties":{"aiAgent":{"$ref":"#/components/schemas/GuardrailAiAgentConfig"}}}}},"GuardrailAiAgentConfig":{"type":"object","description":"LLM configuration for an `ai_agent` guardrail — which provider and model evaluate each\nrecord, with instructions, parameter tuning, and output format. Guardrails never invoke\ntools, so unlike an AI agent import no block here accepts a `tools` array. MCP `prompts`\nand `resources` are accepted on save but never used at run time, so put the policy the\nguardrail must apply in its instructions. Providers come in two families with two\nconfiguration formats:\n\n- **Built-in providers** — each has its own configuration block.\n  - **openai**: OpenAI models (GPT-4.1, GPT-5, etc.). Configure via the `openai` object.\n  - **gemini**: Google Gemini models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.gemini`.\n  - **anthropic**: Anthropic Claude models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.anthropic`.\n- **Catalog providers** — `mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`. Added\n  as catalog data rather than platform code, they share one generic flat format:\n  `model`, `modelOptions`, `instructions`, `output`, and the `prompts` / `resources`\n  arrays directly on this object.\n\nA `_connectionId` on the parent import selects bring-your-own-key (BYOK)\ncredentials. Without one, built-in providers run on platform-managed\ncredentials; catalog providers have no platform-managed credentials, so the\nsave requires one — without it the guardrail fails to save with 422\n`connection_required` on `_connectionId`.\n","required":["provider"],"properties":{"provider":{"type":"string","enum":["openai","gemini","anthropic","mistral","xai","huggingface","deepseek","cohere","groq"],"description":"AI provider to use."},"model":{"type":"string","description":"Model identifier for a catalog provider (generic flat format) — for example\n`grok-4.6`. Built-in providers set the model inside their own block\n(`openai.model`, `litellm.model`) instead."},"modelOptions":{"type":"object","description":"Model tuning for a catalog provider (generic flat format). Which keys, values, and\nranges are accepted is defined per catalog model and validated on save when the\nmodel is a catalog entry.","properties":{"maxOutputTokens":{"type":"number","description":"Maximum number of tokens the model may generate."},"temperature":{"type":"number","description":"Sampling temperature."},"topP":{"type":"number","description":"Nucleus sampling threshold."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Reasoning depth for models that expose it."}}},"instructions":{"type":"string","description":"System prompt for a catalog provider (generic flat format). Built-in providers\nset it inside their own block (`openai.instructions`,\n`litellm._overrides.anthropic.systemInstruction`)."},"output":{"type":"object","description":"Output format for a catalog provider (generic flat format). Built-in providers\nconfigure it inside their own block (`openai.output`, `litellm.responseFormat`).","properties":{"format":{"type":"object","description":"Controls the structure of the model's output.","properties":{"type":{"type":"string","enum":["text","json_schema"],"description":"Output type."},"name":{"type":"string","description":"Name of the JSON schema, for `json_schema` output."},"strict":{"type":"boolean","description":"When true, the model must conform exactly to `jsonSchema`."},"jsonSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema the structured output must conform to, for `json_schema` output."}}},"verbose":{"type":"string","description":"Level of detail in the model's response, for models that expose it."}}},"prompts":{"type":"array","description":"MCP prompt entries saved with a catalog-provider guardrail (generic flat format).\nEach entry references one MCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the prompts."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"openai":{"type":"object","description":"OpenAI-specific configuration. Used when `provider` is \"openai\".\n","required":["model","instructions"],"properties":{"instructions":{"type":"string","maxLength":1000000,"description":"System prompt that defines the check's behavior, goals, and constraints.\n"},"model":{"type":"string","description":"OpenAI model identifier. Open string (not an enum) — model names change frequently."},"reasoning":{"type":"object","description":"Controls depth of reasoning for complex tasks.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"How much reasoning effort the model should invest"},"summary":{"type":"string","enum":["concise","auto","detailed"],"description":"Level of detail in reasoning summaries"}}},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature. Higher values (e.g. 1.5) produce more creative output,\nlower values (e.g. 0.2) produce more focused and deterministic output.\n"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"topLogprobs":{"type":"number","minimum":0,"maximum":20,"description":"Number of most likely tokens to return log probabilities for at each output position."},"maxOutputTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the model's response. Unlike an AI agent import, a guardrail does not receive a server-written value when this is omitted."},"serviceTier":{"type":"string","enum":["auto","default","priority"],"description":"OpenAI service tier. \"priority\" provides higher rate limits and\nlower latency at increased cost."},"output":{"type":"object","description":"Output format configuration. A guardrail stores `format` but doesn't use it: the\nrequest to the model always carries the guardrail's own `validation_result` JSON\nschema (`flagged`, `reasoning`, `confidence`), and the result returns `flagged` and\n`reasoning` whatever `format` holds.","properties":{"format":{"type":"object","description":"Stored output structure. The request to the model uses the guardrail's own\nverdict schema instead (see `output`).\n","properties":{"type":{"type":"string","enum":["text","json_schema","blob"],"description":"Output format type, as stored."},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in. Stored and echoed on\nguardrails for parity with the AI-agent format block — the guardrail form\ndoes not set it today, and neither view changes the model request."},"name":{"type":"string","description":"Name for the output format (used with json_schema)"},"strict":{"type":"boolean","description":"Stored strict-validation flag for `jsonSchema`. A guardrail's model request uses its own verdict schema, so this doesn't apply there."},"jsonSchema":{"type":"object","description":"Stored JSON Schema. Required when `format.type` is \"json_schema\". A guardrail\ndoesn't send it to the model; the request carries the `validation_result`\nverdict schema instead.\n","properties":{"type":{"type":"string","description":"Root type of the stored JSON Schema.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"Field definitions in the stored JSON Schema."},"required":{"type":"array","description":"Property names the stored JSON Schema marks as required.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"Whether the stored JSON Schema allows properties beyond those in `properties`."}}},"schema":{"type":"object","readOnly":true,"additionalProperties":true,"description":"Server-written copy of `jsonSchema`, present in responses once `jsonSchema`\nis set. Send `jsonSchema`, not this field."}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"verbose":{"type":"string","enum":["low","medium","high"],"description":"Level of detail in the model's response"}}},"prompts":{"type":"array","description":"MCP prompt entries saved with the guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}},"litellm":{"type":"object","description":"LiteLLM proxy configuration. Used when `provider` is \"gemini\" or \"anthropic\".\n\nLiteLLM provides a unified interface to multiple AI providers. Gemini-specific\nsettings are in `_overrides.gemini`; Claude-specific settings are in\n`_overrides.anthropic`.\n\n`model` is required when litellm is the active provider path.\n","properties":{"model":{"type":"string","description":"LiteLLM model identifier. For Gemini, models are stored without the `gemini/`\nprefix; for Anthropic, use the Claude model id (e.g. `claude-sonnet-4-6`)."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature"},"maxCompletionTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the response"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"seed":{"type":"number","description":"Random seed for reproducible outputs"},"responseFormat":{"type":"object","description":"Output format configuration","properties":{"type":{"type":"string","description":"Output format type.","enum":["text","json_schema","blob"]},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in; the schema sent to the provider\nis the same either way. Stored and echoed on guardrails for parity with the\nAI-agent format block — the guardrail form does not set it today."},"name":{"type":"string","description":"Name for the output format (used with json_schema)."},"strict":{"type":"boolean","description":"When true, enforces strict schema validation on output."},"jsonSchema":{"type":"object","description":"JSON Schema for structured output. Required when `responseFormat.type` is \"json_schema\".","properties":{"type":{"type":"string","description":"Root JSON Schema type of the structured output; use \"object\" for record-shaped results.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"JSON Schema definitions for each field the structured output may contain."},"required":{"type":"array","description":"Property names the model must include in the structured output.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"When true, the structured output may include properties beyond those defined in `properties`."}}}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"_overrides":{"type":"object","description":"Provider-specific overrides","properties":{"gemini":{"type":"object","description":"Gemini-specific configuration overrides.\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Gemini models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"prompts":{"type":"array","description":"MCP prompt entries saved with a Gemini guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"responseModalities":{"type":"array","description":"Response output modalities","items":{"type":"string","enum":["text","image"]}},"topK":{"type":"number","description":"Top-K sampling parameter for Gemini"},"thinkingConfig":{"type":"object","description":"Controls Gemini's extended thinking capabilities","properties":{"includeThoughts":{"type":"boolean","description":"When true, includes the model's thinking steps in the response."},"thinkingBudget":{"type":"number","minimum":100,"maximum":4000,"description":"Maximum tokens allocated for thinking"},"thinkingLevel":{"type":"string","description":"Controls how much thinking effort the model applies; use higher levels for complex, multi-step tasks at the cost of latency and tokens.","enum":["minimal","low","medium","high"]}}},"imageConfig":{"type":"object","description":"Gemini image generation configuration","properties":{"aspectRatio":{"type":"string","description":"Aspect ratio of generated images; choose a ratio matching the intended display format.","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"]},"imageSize":{"type":"string","description":"Output resolution of generated images; higher resolutions increase detail and file size.","enum":["1K","2K","4K"]}}},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Resolution for media inputs (images, video)"}}},"anthropic":{"type":"object","description":"Claude-specific configuration overrides. Used when `provider` is \"anthropic\".\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Claude models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"topK":{"type":"number","minimum":0,"description":"Top-K sampling parameter. Deprecated on Claude models released after Claude Opus\n4.6, which reject any value at runtime; set it only on older models."},"thinkingConfig":{"type":"object","description":"Controls Claude's extended thinking capabilities.","properties":{"type":{"type":"string","enum":["enabled","disabled","adaptive"],"description":"Extended thinking mode."},"budgetTokens":{"type":"number","minimum":1024,"description":"Maximum tokens allocated for thinking. Required when `type` is \"enabled\" —\nomitting it fails the save with 422 `invalid_thinking_config`."},"display":{"type":"string","enum":["summarized","omitted"],"description":"How thinking output is surfaced in the response."},"effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"How much thinking effort the model applies; use with `type` \"adaptive\". Higher\nvalues (`xhigh`, `max`) may be gated to specific Claude models by the provider."}},"if":{"properties":{"type":{"const":"enabled"}},"required":["type"]},"then":{"required":["budgetTokens"]}},"serviceTier":{"type":"string","enum":["auto","standard_only"],"description":"Anthropic service tier for the request."},"prompts":{"type":"array","description":"MCP prompt entries saved with a Claude guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}}}}}}},"if":{"properties":{"provider":{"const":"openai"}},"required":["provider"]},"then":{"required":["openai"],"properties":{"openai":{"required":["model","instructions"]}}},"else":{"if":{"properties":{"provider":{"enum":["gemini","anthropic"]}},"required":["provider"]},"then":{"required":["litellm"],"properties":{"litellm":{"required":["model"]}}},"else":{"if":{"properties":{"provider":{"enum":["mistral","xai","huggingface","deepseek","cohere","groq"]}},"required":["provider"]},"then":{"required":["model"]}}}},"McpResources":{"type":"array","description":"Governed MCP resources — read-only reference content (policies, schemas, documentation)\npulled from connected MCP servers and made available to the agent as a consistent source\nof truth. Each entry references one MCP connection and the specific resources allowed from it.","items":{"type":"object","required":["type","mcp"],"properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of resource entry. Always \"mcp\"."},"mcp":{"type":"object","required":["_mcpConnectionId","allowedResources"],"description":"MCP server resource configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the resources."},"allowedResources":{"type":"array","minItems":1,"description":"Resources to expose to the agent from the MCP server. Must contain at least one\nentry; each entry identifies one resource by name and URI.","items":{"type":"object","required":["name","uri"],"properties":{"name":{"type":"string","description":"Display name of the MCP resource."},"uri":{"type":"string","description":"URI that identifies the resource on the MCP server."}}}}}}}}},"MappingField":{"type":"object","description":"One Mapper 1.0 field-mapping entry.","properties":{"generate":{"type":"string","description":"Target field path to write on the destination record."},"extract":{"type":"string","description":"Source expression. Accepts:\n- A dot path from the record root (e.g. `email`, `address.city`), read from the\n  incoming record. A path that matches no field writes nothing.\n- Handlebars template (contains `{{`) for concatenation /\n  formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,\n  `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the\n  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`\n  render nothing, so the field is left out even when the record has the value.\n\nA `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare\nstring is read as a field path, not a constant: set constants in `hardCodedValue`.\nOmit when using `hardCodedValue`.\n"},"hardCodedValue":{"type":["string","null"],"description":"Static value written to `generate` instead of extracting from the source record."},"dataType":{"type":"string","enum":["string","number","boolean","numberarray","stringarray","json"],"description":"Data type coercion applied to the mapped value."},"discardIfEmpty":{"type":"boolean","description":"When true, the field is omitted from the output when the extracted value is empty."},"immutable":{"type":"boolean","description":"When true, the mapped value cannot be overwritten by later mapping steps."},"lookupName":{"type":"string","description":"Name of an entry in the import's `lookups` array (`http.lookups` on an HTTP import) used to translate the value."},"default":{"type":["string","null"],"description":"Fallback value written when the source value is an empty string, null or\nmissing. Without a default, an empty string and null are written as they are\nand a missing field is left out."},"extractDateFormat":{"type":"string","description":"Date format of the source value, used to parse it before conversion."},"extractDateTimezone":{"type":"string","description":"Timezone applied when parsing the source date value."},"generateDateFormat":{"type":"string","description":"Date format applied to the value written to the destination."},"generateDateTimezone":{"type":"string","description":"Timezone applied when formatting the destination date value."},"conditional":{"type":"object","description":"Only apply this mapping entry when the given condition is satisfied.\n","properties":{"when":{"type":"string","enum":["record_created","record_updated","extract_not_empty","lookup_not_empty","lookup_empty","expression"],"description":"Condition that gates whether this mapping entry is applied.\n`lookup_not_empty` / `lookup_empty` evaluate the lookup named by the\nsibling `lookupName`; `expression` evaluates the sibling `expression`.\n"},"lookupName":{"type":"string","description":"Lookup to evaluate for the `lookup_not_empty` / `lookup_empty`\nconditions.\n"},"expression":{"type":"string","description":"Expression evaluated when `when` is `expression`.\n"}}}}},"AIDescription":{"type":"object","description":"AI-generated descriptions and documentation for the resource.\n\nThis object contains automatically generated content that helps users\nunderstand the purpose, behavior, and configuration of the resource without\nrequiring them to analyze the technical details. The AI-generated content\nis sanitized and safe for display in the UI.\n","properties":{"summary":{"type":["string","null"],"description":"Brief AI-generated summary of the resource's purpose and functionality.\n\nThis concise description provides a quick overview of what the resource does,\nwhat systems it interacts with, and its primary role in the integration.\nThe summary is suitable for display in list views, dashboards, and other\ncontexts where space is limited.\n\nMaximum length: 10KB\n"},"detailed":{"type":["string","null"],"description":"Comprehensive AI-generated description of the resource's functionality.\n\nThis detailed explanation covers the resource's purpose, configuration details,\ndata flow patterns, filtering logic, and other technical aspects. It provides\nin-depth information suitable for documentation, tooltips, or detailed views\nin the administration interface.\n\nThe content may include HTML formatting for improved readability.\n\nMaximum length: 10KB\n"},"generatedOn":{"type":["string","null"],"format":"date-time","description":"Timestamp indicating when the AI description was generated.\n\nThis field helps track the freshness of the AI-generated content and\ndetermine when it might need to be regenerated due to changes in the\nresource's configuration or behavior.\n\nThe timestamp is recorded in ISO 8601 format with UTC timezone (Z suffix).\n"}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/imports/{_id}":{"get":{"summary":"Get a guardrail","description":"Returns the complete configuration of a specific guardrail import.\nThe `_id` is from the imports collection — the same ID used for any\nimport type.","operationId":"getGuardrailById","tags":["Guardrails"],"parameters":[{"name":"_id","in":"path","description":"The unique identifier of the guardrail import","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Guardrail retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guardrail"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"}}}}}}
```

## Update a guardrail

> Replaces the guardrail import with the provided configuration.\
> This is a full replace -- include all fields you want to keep.\
> \`adaptorType\` must remain \`GuardrailImport\`.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Request":{"type":"object","description":"Configuration for a guardrail import. `_connectionId` is only\nrequired for BYOK `ai_agent` guardrails.","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail."},"description":{"type":"string","maxLength":5120,"description":"Optional description of the guardrail's purpose."},"_connectionId":{"type":"string","format":"objectId","description":"Connection for BYOK (bring your own key) — only meaningful for `ai_agent` type\nguardrails. Optional for the built-in providers (`openai`, `gemini`, `anthropic`),\nwhich run on platform-managed credentials when it is omitted; catalog providers\n(`mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`) have no platform-managed\ncredentials and need it to run."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Must be `GuardrailImport`."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 mapping that selects the guardrail's input from the\nincoming record. The UI writes a single field entry that maps a\nrecord field to the `text` input (e.g.\n`{\"fields\": [{\"extract\": \"employeeSummary\", \"generate\": \"text\"}]}`);\nonly that field is evaluated, and fields outside it are neither\nscanned nor masked. A mapping can also generate `record`, an object\nevaluated as its JSON. Optional — when omitted the whole record is\nevaluated, serialized as JSON, unless the record has its own\ntop-level `text` field, which is then evaluated alone. The server\nserves this field only when populated.","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (`text`, or `record` for an object).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Controls the shape of the input passed to the guardrail's\nprocessing pipeline, exactly as on other imports. The UI writes\n`record` explicitly on new guardrails; when the field is absent\nthe platform behaves as `record`."}},"required":["name","adaptorType","guardrail"]},"GuardrailConfig":{"type":"object","description":"Selects the check a guardrail applies and carries its settings. `type` picks the check\nand the matching sub-object (`pii`, `moderation`, or `aiAgent`) configures it.\nResponses echo the active sub-object with `confidenceThreshold` defaulted and also\nreturn the inactive `pii` / `moderation` siblings as empty stubs\n(`pii: {entities: [], mask: false}`, `moderation: {categories: []}`) — only the active\ntype's sub-object is meaningful. Guardrails created before the AI-agent stub was\nstripped on write may still return an inert `aiAgent` on `pii` / `moderation` guardrails.","properties":{"type":{"type":"string","enum":["ai_agent","pii","moderation"],"description":"The type of guardrail to apply. Each type requires its corresponding\nsub-configuration object (`aiAgent`, `pii`, or `moderation`)."},"confidenceThreshold":{"type":"number","minimum":0,"maximum":1,"default":0.7,"description":"Confidence threshold (0 to 1). Detections below this threshold are\nignored. Lower values catch more issues but increase false positives."},"aiAgent":{"type":"object","description":"LLM configuration for the check; set when `type` is `ai_agent` and validated\nagainst `GuardrailAiAgentConfig`. On `pii` / `moderation` guardrails a legacy\nserver-written stub may appear here — it is inert, and current servers strip it on\nwrite."},"pii":{"type":"object","required":["entities"],"description":"PII detection configuration. Required when `type` is `pii`.","properties":{"entities":{"type":"array","description":"PII entity types to detect. When `type` is `pii`, at least one\nentry is required; the inactive sibling on other guardrail types\nmay be served with an empty list.","items":{"type":"string","enum":["credit_card_number","card_security_code_cvv_cvc","cryptocurrency_wallet_address","date_and_time","email_address","iban_code","bic_swift_bank_identifier_code","ip_address","location","medical_license_number","national_registration_number","persons_name","phone_number","url","us_bank_account_number","us_drivers_license","us_itin","us_passport_number","us_social_security_number","uk_nhs_number","uk_national_insurance_number","spanish_nif","spanish_nie","italian_fiscal_code","italian_drivers_license","italian_vat_code","italian_passport","italian_identity_card","polish_pesel","finnish_personal_identity_code","singapore_nric_fin","singapore_uen","australian_abn","australian_acn","australian_tfn","australian_medicare","indian_pan","indian_aadhaar","indian_vehicle_registration","indian_voter_id","indian_passport","korean_resident_registration_number"]}},"mask":{"type":"boolean","default":false,"description":"When true, the result also carries `masked`: the evaluated input with each detected\nvalue replaced by asterisks. The record itself is unchanged. With whole-record input\n(no `mapping`, and no top-level `text` field on the record), `masked` is the record\nserialized as one JSON string. When false, PII is flagged only."}}},"moderation":{"type":"object","required":["categories"],"description":"Content moderation configuration. Required when `type` is `moderation`.","properties":{"categories":{"type":"array","description":"Content moderation categories to check. When `type` is\n`moderation`, at least one entry is required; the inactive\nsibling on other guardrail types may be served with an empty\nlist.","items":{"type":"string","enum":["sexual","sexual_minors","hate","hate_threatening","harassment","harassment_threatening","self_harm","self_harm_intent","self_harm_instructions","violence","violence_graphic","illicit","illicit_violent"]}}}}},"required":["type","confidenceThreshold"],"if":{"required":["type"],"properties":{"type":{"const":"pii"}}},"then":{"required":["pii"],"properties":{"pii":{"required":["entities"],"properties":{"entities":{"minItems":1}}}}},"else":{"if":{"required":["type"],"properties":{"type":{"const":"moderation"}}},"then":{"required":["moderation"],"properties":{"moderation":{"required":["categories"],"properties":{"categories":{"minItems":1}}}}},"else":{"required":["aiAgent"],"properties":{"aiAgent":{"$ref":"#/components/schemas/GuardrailAiAgentConfig"}}}}},"GuardrailAiAgentConfig":{"type":"object","description":"LLM configuration for an `ai_agent` guardrail — which provider and model evaluate each\nrecord, with instructions, parameter tuning, and output format. Guardrails never invoke\ntools, so unlike an AI agent import no block here accepts a `tools` array. MCP `prompts`\nand `resources` are accepted on save but never used at run time, so put the policy the\nguardrail must apply in its instructions. Providers come in two families with two\nconfiguration formats:\n\n- **Built-in providers** — each has its own configuration block.\n  - **openai**: OpenAI models (GPT-4.1, GPT-5, etc.). Configure via the `openai` object.\n  - **gemini**: Google Gemini models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.gemini`.\n  - **anthropic**: Anthropic Claude models via the LiteLLM proxy. Configure via `litellm` with overrides in `litellm._overrides.anthropic`.\n- **Catalog providers** — `mistral`, `xai`, `huggingface`, `deepseek`, `cohere`, `groq`. Added\n  as catalog data rather than platform code, they share one generic flat format:\n  `model`, `modelOptions`, `instructions`, `output`, and the `prompts` / `resources`\n  arrays directly on this object.\n\nA `_connectionId` on the parent import selects bring-your-own-key (BYOK)\ncredentials. Without one, built-in providers run on platform-managed\ncredentials; catalog providers have no platform-managed credentials, so the\nsave requires one — without it the guardrail fails to save with 422\n`connection_required` on `_connectionId`.\n","required":["provider"],"properties":{"provider":{"type":"string","enum":["openai","gemini","anthropic","mistral","xai","huggingface","deepseek","cohere","groq"],"description":"AI provider to use."},"model":{"type":"string","description":"Model identifier for a catalog provider (generic flat format) — for example\n`grok-4.6`. Built-in providers set the model inside their own block\n(`openai.model`, `litellm.model`) instead."},"modelOptions":{"type":"object","description":"Model tuning for a catalog provider (generic flat format). Which keys, values, and\nranges are accepted is defined per catalog model and validated on save when the\nmodel is a catalog entry.","properties":{"maxOutputTokens":{"type":"number","description":"Maximum number of tokens the model may generate."},"temperature":{"type":"number","description":"Sampling temperature."},"topP":{"type":"number","description":"Nucleus sampling threshold."},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh"],"description":"Reasoning depth for models that expose it."}}},"instructions":{"type":"string","description":"System prompt for a catalog provider (generic flat format). Built-in providers\nset it inside their own block (`openai.instructions`,\n`litellm._overrides.anthropic.systemInstruction`)."},"output":{"type":"object","description":"Output format for a catalog provider (generic flat format). Built-in providers\nconfigure it inside their own block (`openai.output`, `litellm.responseFormat`).","properties":{"format":{"type":"object","description":"Controls the structure of the model's output.","properties":{"type":{"type":"string","enum":["text","json_schema"],"description":"Output type."},"name":{"type":"string","description":"Name of the JSON schema, for `json_schema` output."},"strict":{"type":"boolean","description":"When true, the model must conform exactly to `jsonSchema`."},"jsonSchema":{"type":"object","additionalProperties":true,"description":"JSON Schema the structured output must conform to, for `json_schema` output."}}},"verbose":{"type":"string","description":"Level of detail in the model's response, for models that expose it."}}},"prompts":{"type":"array","description":"MCP prompt entries saved with a catalog-provider guardrail (generic flat format).\nEach entry references one MCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the prompts."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"openai":{"type":"object","description":"OpenAI-specific configuration. Used when `provider` is \"openai\".\n","required":["model","instructions"],"properties":{"instructions":{"type":"string","maxLength":1000000,"description":"System prompt that defines the check's behavior, goals, and constraints.\n"},"model":{"type":"string","description":"OpenAI model identifier. Open string (not an enum) — model names change frequently."},"reasoning":{"type":"object","description":"Controls depth of reasoning for complex tasks.","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"How much reasoning effort the model should invest"},"summary":{"type":"string","enum":["concise","auto","detailed"],"description":"Level of detail in reasoning summaries"}}},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature. Higher values (e.g. 1.5) produce more creative output,\nlower values (e.g. 0.2) produce more focused and deterministic output.\n"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"topLogprobs":{"type":"number","minimum":0,"maximum":20,"description":"Number of most likely tokens to return log probabilities for at each output position."},"maxOutputTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the model's response. Unlike an AI agent import, a guardrail does not receive a server-written value when this is omitted."},"serviceTier":{"type":"string","enum":["auto","default","priority"],"description":"OpenAI service tier. \"priority\" provides higher rate limits and\nlower latency at increased cost."},"output":{"type":"object","description":"Output format configuration. A guardrail stores `format` but doesn't use it: the\nrequest to the model always carries the guardrail's own `validation_result` JSON\nschema (`flagged`, `reasoning`, `confidence`), and the result returns `flagged` and\n`reasoning` whatever `format` holds.","properties":{"format":{"type":"object","description":"Stored output structure. The request to the model uses the guardrail's own\nverdict schema instead (see `output`).\n","properties":{"type":{"type":"string","enum":["text","json_schema","blob"],"description":"Output format type, as stored."},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in. Stored and echoed on\nguardrails for parity with the AI-agent format block — the guardrail form\ndoes not set it today, and neither view changes the model request."},"name":{"type":"string","description":"Name for the output format (used with json_schema)"},"strict":{"type":"boolean","description":"Stored strict-validation flag for `jsonSchema`. A guardrail's model request uses its own verdict schema, so this doesn't apply there."},"jsonSchema":{"type":"object","description":"Stored JSON Schema. Required when `format.type` is \"json_schema\". A guardrail\ndoesn't send it to the model; the request carries the `validation_result`\nverdict schema instead.\n","properties":{"type":{"type":"string","description":"Root type of the stored JSON Schema.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"Field definitions in the stored JSON Schema."},"required":{"type":"array","description":"Property names the stored JSON Schema marks as required.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"Whether the stored JSON Schema allows properties beyond those in `properties`."}}},"schema":{"type":"object","readOnly":true,"additionalProperties":true,"description":"Server-written copy of `jsonSchema`, present in responses once `jsonSchema`\nis set. Send `jsonSchema`, not this field."}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"verbose":{"type":"string","enum":["low","medium","high"],"description":"Level of detail in the model's response"}}},"prompts":{"type":"array","description":"MCP prompt entries saved with the guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}},"litellm":{"type":"object","description":"LiteLLM proxy configuration. Used when `provider` is \"gemini\" or \"anthropic\".\n\nLiteLLM provides a unified interface to multiple AI providers. Gemini-specific\nsettings are in `_overrides.gemini`; Claude-specific settings are in\n`_overrides.anthropic`.\n\n`model` is required when litellm is the active provider path.\n","properties":{"model":{"type":"string","description":"LiteLLM model identifier. For Gemini, models are stored without the `gemini/`\nprefix; for Anthropic, use the Claude model id (e.g. `claude-sonnet-4-6`)."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature"},"maxCompletionTokens":{"type":"number","minimum":100,"maximum":128000,"description":"Maximum number of tokens in the response"},"topP":{"type":"number","minimum":0.1,"maximum":1,"description":"Nucleus sampling parameter"},"seed":{"type":"number","description":"Random seed for reproducible outputs"},"responseFormat":{"type":"object","description":"Output format configuration","properties":{"type":{"type":"string","description":"Output format type.","enum":["text","json_schema","blob"]},"schemaMode":{"type":"string","enum":["manual","json"],"description":"Which view a schema editor opens `jsonSchema` in; the schema sent to the provider\nis the same either way. Stored and echoed on guardrails for parity with the\nAI-agent format block — the guardrail form does not set it today."},"name":{"type":"string","description":"Name for the output format (used with json_schema)."},"strict":{"type":"boolean","description":"When true, enforces strict schema validation on output."},"jsonSchema":{"type":"object","description":"JSON Schema for structured output. Required when `responseFormat.type` is \"json_schema\".","properties":{"type":{"type":"string","description":"Root JSON Schema type of the structured output; use \"object\" for record-shaped results.","enum":["object","array","string","number","integer","boolean"]},"properties":{"type":"object","additionalProperties":true,"description":"JSON Schema definitions for each field the structured output may contain."},"required":{"type":"array","description":"Property names the model must include in the structured output.","items":{"type":"string"}},"additionalProperties":{"type":"boolean","description":"When true, the structured output may include properties beyond those defined in `properties`."}}}},"if":{"properties":{"type":{"const":"json_schema"}},"required":["type"]},"then":{"required":["name","jsonSchema"]}},"_overrides":{"type":"object","description":"Provider-specific overrides","properties":{"gemini":{"type":"object","description":"Gemini-specific configuration overrides.\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Gemini models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"prompts":{"type":"array","description":"MCP prompt entries saved with a Gemini guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"},"responseModalities":{"type":"array","description":"Response output modalities","items":{"type":"string","enum":["text","image"]}},"topK":{"type":"number","description":"Top-K sampling parameter for Gemini"},"thinkingConfig":{"type":"object","description":"Controls Gemini's extended thinking capabilities","properties":{"includeThoughts":{"type":"boolean","description":"When true, includes the model's thinking steps in the response."},"thinkingBudget":{"type":"number","minimum":100,"maximum":4000,"description":"Maximum tokens allocated for thinking"},"thinkingLevel":{"type":"string","description":"Controls how much thinking effort the model applies; use higher levels for complex, multi-step tasks at the cost of latency and tokens.","enum":["minimal","low","medium","high"]}}},"imageConfig":{"type":"object","description":"Gemini image generation configuration","properties":{"aspectRatio":{"type":"string","description":"Aspect ratio of generated images; choose a ratio matching the intended display format.","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"]},"imageSize":{"type":"string","description":"Output resolution of generated images; higher resolutions increase detail and file size.","enum":["1K","2K","4K"]}}},"mediaResolution":{"type":"string","enum":["low","medium","high"],"description":"Resolution for media inputs (images, video)"}}},"anthropic":{"type":"object","description":"Claude-specific configuration overrides. Used when `provider` is \"anthropic\".\n","required":["systemInstruction"],"properties":{"systemInstruction":{"type":"string","maxLength":1000000,"description":"System instruction for Claude models. Equivalent to OpenAI's `instructions`.\nMaximum 1,000,000 characters.\n"},"topK":{"type":"number","minimum":0,"description":"Top-K sampling parameter. Deprecated on Claude models released after Claude Opus\n4.6, which reject any value at runtime; set it only on older models."},"thinkingConfig":{"type":"object","description":"Controls Claude's extended thinking capabilities.","properties":{"type":{"type":"string","enum":["enabled","disabled","adaptive"],"description":"Extended thinking mode."},"budgetTokens":{"type":"number","minimum":1024,"description":"Maximum tokens allocated for thinking. Required when `type` is \"enabled\" —\nomitting it fails the save with 422 `invalid_thinking_config`."},"display":{"type":"string","enum":["summarized","omitted"],"description":"How thinking output is surfaced in the response."},"effort":{"type":"string","enum":["low","medium","high","xhigh","max"],"description":"How much thinking effort the model applies; use with `type` \"adaptive\". Higher\nvalues (`xhigh`, `max`) may be gated to specific Claude models by the provider."}},"if":{"properties":{"type":{"const":"enabled"}},"required":["type"]},"then":{"required":["budgetTokens"]}},"serviceTier":{"type":"string","enum":["auto","standard_only"],"description":"Anthropic service tier for the request."},"prompts":{"type":"array","description":"MCP prompt entries saved with a Claude guardrail. Each item references one\nMCP connection and prompt names; a guardrail's run never fetches them.","items":{"type":"object","properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of prompt entry. Always \"mcp\"."},"mcp":{"type":"object","description":"MCP server prompt configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server."},"allowedPrompts":{"type":"array","description":"Prompt names saved with the entry; a guardrail's run never fetches them.","items":{"type":"string"}}}}}}},"resources":{"$ref":"#/components/schemas/McpResources"}}}}}}}},"if":{"properties":{"provider":{"const":"openai"}},"required":["provider"]},"then":{"required":["openai"],"properties":{"openai":{"required":["model","instructions"]}}},"else":{"if":{"properties":{"provider":{"enum":["gemini","anthropic"]}},"required":["provider"]},"then":{"required":["litellm"],"properties":{"litellm":{"required":["model"]}}},"else":{"if":{"properties":{"provider":{"enum":["mistral","xai","huggingface","deepseek","cohere","groq"]}},"required":["provider"]},"then":{"required":["model"]}}}},"McpResources":{"type":"array","description":"Governed MCP resources — read-only reference content (policies, schemas, documentation)\npulled from connected MCP servers and made available to the agent as a consistent source\nof truth. Each entry references one MCP connection and the specific resources allowed from it.","items":{"type":"object","required":["type","mcp"],"properties":{"type":{"type":"string","enum":["mcp"],"description":"Type of resource entry. Always \"mcp\"."},"mcp":{"type":"object","required":["_mcpConnectionId","allowedResources"],"description":"MCP server resource configuration.","properties":{"_mcpConnectionId":{"type":"string","format":"objectId","description":"Connection to the MCP server that exposes the resources."},"allowedResources":{"type":"array","minItems":1,"description":"Resources to expose to the agent from the MCP server. Must contain at least one\nentry; each entry identifies one resource by name and URI.","items":{"type":"object","required":["name","uri"],"properties":{"name":{"type":"string","description":"Display name of the MCP resource."},"uri":{"type":"string","description":"URI that identifies the resource on the MCP server."}}}}}}}}},"MappingField":{"type":"object","description":"One Mapper 1.0 field-mapping entry.","properties":{"generate":{"type":"string","description":"Target field path to write on the destination record."},"extract":{"type":"string","description":"Source expression. Accepts:\n- A dot path from the record root (e.g. `email`, `address.city`), read from the\n  incoming record. A path that matches no field writes nothing.\n- Handlebars template (contains `{{`) for concatenation /\n  formatting / conditional logic (e.g. `{{firstName}} {{lastName}}`,\n  `{{#if mobile}}{{mobile}}{{else}}{{phone}}{{/if}}`). The template reads the\n  record's fields by bare name: `{{record.firstName}}` and `{{data.firstName}}`\n  render nothing, so the field is left out even when the record has the value.\n\nA `$.` JSONPath (the Mapper 2.0 `mappings` syntax) reads nothing here, and a bare\nstring is read as a field path, not a constant: set constants in `hardCodedValue`.\nOmit when using `hardCodedValue`.\n"},"hardCodedValue":{"type":["string","null"],"description":"Static value written to `generate` instead of extracting from the source record."},"dataType":{"type":"string","enum":["string","number","boolean","numberarray","stringarray","json"],"description":"Data type coercion applied to the mapped value."},"discardIfEmpty":{"type":"boolean","description":"When true, the field is omitted from the output when the extracted value is empty."},"immutable":{"type":"boolean","description":"When true, the mapped value cannot be overwritten by later mapping steps."},"lookupName":{"type":"string","description":"Name of an entry in the import's `lookups` array (`http.lookups` on an HTTP import) used to translate the value."},"default":{"type":["string","null"],"description":"Fallback value written when the source value is an empty string, null or\nmissing. Without a default, an empty string and null are written as they are\nand a missing field is left out."},"extractDateFormat":{"type":"string","description":"Date format of the source value, used to parse it before conversion."},"extractDateTimezone":{"type":"string","description":"Timezone applied when parsing the source date value."},"generateDateFormat":{"type":"string","description":"Date format applied to the value written to the destination."},"generateDateTimezone":{"type":"string","description":"Timezone applied when formatting the destination date value."},"conditional":{"type":"object","description":"Only apply this mapping entry when the given condition is satisfied.\n","properties":{"when":{"type":"string","enum":["record_created","record_updated","extract_not_empty","lookup_not_empty","lookup_empty","expression"],"description":"Condition that gates whether this mapping entry is applied.\n`lookup_not_empty` / `lookup_empty` evaluate the lookup named by the\nsibling `lookupName`; `expression` evaluates the sibling `expression`.\n"},"lookupName":{"type":"string","description":"Lookup to evaluate for the `lookup_not_empty` / `lookup_empty`\nconditions.\n"},"expression":{"type":"string","description":"Expression evaluated when `when` is `expression`.\n"}}}}},"Guardrail":{"type":"object","description":"Guardrail import object as returned by the API.","required":["_id","name","adaptorType","guardrail","apiIdentifier","lookups","createdAt","lastModified"],"allOf":[{"$ref":"#/components/schemas/ResourceResponse"},{"$ref":"#/components/schemas/IAResourceResponse"},{"type":"object","properties":{"name":{"type":"string","maxLength":100,"description":"Display name for the guardrail. May be empty if created without one."},"description":{"type":"string","maxLength":5120,"description":"Free-text note describing the guardrail's purpose."},"adaptorType":{"type":"string","enum":["GuardrailImport"],"description":"Always `GuardrailImport` for guardrails."},"_connectionId":{"type":"string","format":"objectId","description":"BYOK connection backing an `ai_agent` guardrail. Absent when a built-in provider runs on platform-managed credentials."},"_sourceId":{"type":"string","format":"objectId","readOnly":true,"description":"Source guardrail this one was cloned from. Present only on clones."},"guardrail":{"$ref":"#/components/schemas/GuardrailConfig"},"mapping":{"type":"object","description":"Mapper 1.0 input mapping that selects what is evaluated: a field mapped\nto `text`, or an object mapped to `record` (evaluated as its JSON).\nServed only when populated — a guardrail created without one has no\n`mapping` in responses, and evaluates the whole record (or the\nrecord's own top-level `text` field, when it has one).","properties":{"fields":{"type":"array","description":"Field-level mapping entries; `generate` targets the guardrail input (typically `text`).","items":{"$ref":"#/components/schemas/MappingField"}},"lists":{"type":"array","description":"List-level mappings, each generating a sublist. Rarely used on guardrails.","items":{"type":"object","properties":{"generate":{"type":"string","description":"Target sublist or array path to generate."},"fields":{"type":"array","description":"Field mappings applied within each generated list item.","items":{"$ref":"#/components/schemas/MappingField"}}}}}}},"inputContext":{"type":"string","enum":["record","envelope"],"description":"Input shape for the guardrail's processing pipeline. Present when set; absence means `record`."},"apiIdentifier":{"type":"string","readOnly":true,"description":"Ten-character hex identifier used to invoke the guardrail over HTTP."},"lookups":{"type":"array","description":"Static lookup configurations. Guardrail (AI agent) imports support static lookups only; defaults to an empty array.","items":{"type":"object"}},"mappings":{"type":"array","description":"Import field mappings. Each entry requires a `status` field. Typically empty for guardrails.","items":{"type":"object"}},"mockResponse":{"type":"array","description":"Sample evaluation results stored with the guardrail. The UI populates these from a\npreview run; accepted on create and update. Each item has the shape of the result a\nrun produces for one record, with the verdict fields (`flagged`, `masked`,\n`reasoning`) at the top level.","items":{"type":"object","properties":{"statusCode":{"type":"integer","description":"HTTP-style status code of the sample evaluation."},"flagged":{"type":"boolean","description":"When true, the sample input tripped the guardrail."},"reasoning":{"type":"string","description":"The model's explanation of the verdict. Returned by `ai_agent` guardrails,\nwhatever output format the guardrail stores."},"_json":{"type":"object","description":"Empty (`{}`) in the result of a saved guardrail invoked by id. A preview's result\ncarries the raw verdict under `_json.data`: `flagged`, `reasoning` and\n`confidence` for `ai_agent`, or `flagged`, `masked` and `entities_detected`\nfor `pii`. Read the top-level fields, not `_json`.","additionalProperties":true},"ignored":{"type":"boolean","description":"When true, the result fell below `confidenceThreshold` and was disregarded."},"masked":{"type":"string","description":"Sample input with detected values masked. Populated for `pii` guardrails with masking enabled."},"dataURI":{"type":"string","description":"Data URI of any artifact produced by the sample evaluation."},"errors":{"type":"array","description":"Errors raised during the sample evaluation.","items":{"type":"object"}}}}},"aiDescription":{"$ref":"#/components/schemas/AIDescription"}}}]},"ResourceResponse":{"type":"object","description":"Response","properties":{"_id":{"type":"string","format":"objectId","readOnly":true,"description":"Unique identifier for the resource. Format is a 24-character hexadecimal string."},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was created. Set automatically and cannot be modified."},"lastModified":{"type":"string","format":"date-time","readOnly":true,"description":"Timestamp when the resource was last updated. Changes whenever any property is modified."},"deletedAt":{"type":["string","null"],"format":"date-time","readOnly":true,"description":"Timestamp when the resource was soft-deleted. When null or absent, the resource is active."}},"required":["_id"]},"IAResourceResponse":{"type":"object","description":"Integration app response fields for resources that are part of integration apps","properties":{"_integrationId":{"type":"string","format":"objectId","readOnly":true,"description":"Reference to the specific integration instance that contains this resource.\n\nThis field is only populated for resources that are part of an integration app\ninstallation. It contains the unique identifier (_id) of the integration\nresource that was installed in the account.\n\nThe integration instance represents a specific installed instance of an\nintegration app, with its own configuration, settings, and runtime environment.\n\nThis reference enables:\n- Tracing the resource back to its parent integration instance\n- Permission and access control based on integration ownership\n- Lifecycle management (enabling/disabling, updating, or uninstalling)\n"},"_connectorId":{"type":"string","format":"objectId","readOnly":true,"description":"Integration App (connector) that defines this resource. Present only on resources an\nIntegration App owns. The app locks parts of these documents, and a PUT that changes a\nlocked field answers 200 but keeps the stored value, so read the document back to confirm\na change."}}},"AIDescription":{"type":"object","description":"AI-generated descriptions and documentation for the resource.\n\nThis object contains automatically generated content that helps users\nunderstand the purpose, behavior, and configuration of the resource without\nrequiring them to analyze the technical details. The AI-generated content\nis sanitized and safe for display in the UI.\n","properties":{"summary":{"type":["string","null"],"description":"Brief AI-generated summary of the resource's purpose and functionality.\n\nThis concise description provides a quick overview of what the resource does,\nwhat systems it interacts with, and its primary role in the integration.\nThe summary is suitable for display in list views, dashboards, and other\ncontexts where space is limited.\n\nMaximum length: 10KB\n"},"detailed":{"type":["string","null"],"description":"Comprehensive AI-generated description of the resource's functionality.\n\nThis detailed explanation covers the resource's purpose, configuration details,\ndata flow patterns, filtering logic, and other technical aspects. It provides\nin-depth information suitable for documentation, tooltips, or detailed views\nin the administration interface.\n\nThe content may include HTML formatting for improved readability.\n\nMaximum length: 10KB\n"},"generatedOn":{"type":["string","null"],"format":"date-time","description":"Timestamp indicating when the AI description was generated.\n\nThis field helps track the freshness of the AI-generated content and\ndetermine when it might need to be regenerated due to changes in the\nresource's configuration or behavior.\n\nThe timestamp is recorded in ISO 8601 format with UTC timezone (Z suffix).\n"}}},"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}},"responses":{"400-bad-request":{"description":"Bad request. The server could not understand the request because of malformed syntax or invalid parameters.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-unprocessable-entity":{"description":"Unprocessable entity. The request was well-formed but was unable to be followed due to semantic errors.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/imports/{_id}":{"put":{"summary":"Update a guardrail","description":"Replaces the guardrail import with the provided configuration.\nThis is a full replace -- include all fields you want to keep.\n`adaptorType` must remain `GuardrailImport`.","operationId":"updateGuardrail","tags":["Guardrails"],"parameters":[{"name":"_id","in":"path","description":"The unique identifier of the guardrail import","required":true,"schema":{"type":"string","format":"objectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Request"}}}},"responses":{"200":{"description":"Guardrail updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Guardrail"}}}},"400":{"$ref":"#/components/responses/400-bad-request"},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-unprocessable-entity"}}}}}}
```

## Delete a guardrail

> Deletes a guardrail import. Soft-deleted and retained in the recycle\
> bin for 30 days before permanent removal.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}},"404-not-found":{"description":"Not found. The requested resource does not exist or is not visible to the caller.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422-dependency-conflict":{"description":"The resource has dependents that must be deleted first. Each entry\nin the `errors` array names one blocking resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","description":"Standard error response envelope returned by integrator.io APIs.","properties":{"errors":{"type":"array","description":"List of errors that occurred while processing the request.","items":{"type":"object","properties":{"code":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Machine-readable error code. Usually a string like\n`invalid_ref`, `missing_required_field`, or `unauthorized`;\nmay be an **integer** when the error mirrors an upstream HTTP\nstatus (e.g. `500`) — most commonly returned by connection-ping\nand adaptor-proxy responses."},"message":{"type":"string","description":"Human-readable description of the error."},"field":{"type":"string","description":"Optional pointer to the document field that caused the error.\nUsed by structural validation errors (`missing_required_field`,\n`invalid_ref`) to indicate which field is at fault\n(e.g. `_id`, `type`, `http.baseURI`)."},"source":{"type":"string","description":"Optional origin layer for the error — e.g. `application` when\nthe error came from the remote system the adaptor called,\n`connector` when the adaptor itself rejected the request."}},"required":["message"]}}},"required":["errors"]}}},"paths":{"/v1/imports/{_id}":{"delete":{"summary":"Delete a guardrail","description":"Deletes a guardrail import. Soft-deleted and retained in the recycle\nbin for 30 days before permanent removal.","operationId":"deleteGuardrail","tags":["Guardrails"],"parameters":[{"name":"_id","in":"path","description":"The unique identifier of the guardrail import","required":true,"schema":{"type":"string","format":"objectId"}}],"responses":{"204":{"description":"Guardrail deleted successfully"},"401":{"$ref":"#/components/responses/401-unauthorized"},"404":{"$ref":"#/components/responses/404-not-found"},"422":{"$ref":"#/components/responses/422-dependency-conflict"}}}}}}
```

## List dependencies of a guardrail

> Returns the set of resources that depend on the specified guardrail import.\
> The response is an object whose keys are dependent-resource types\
> (e.g. \`flows\`, \`imports\`) and whose values are arrays of dependency entries.\
> \
> An empty object \`{}\` means no other resources depend on the target.\
> This is also returned for a well-formatted but nonexistent id.

```json
{"openapi":"3.2.0","info":{"title":"Guardrails","version":"1.0.0"},"tags":[{"name":"Guardrails","description":"Guardrails are safety and compliance checks that evaluate data flowing\nthrough integrations — detecting PII, moderating content, or applying\ncustom AI-powered rules.\n\nGuardrails are import resources with `adaptorType: GuardrailImport`. All\nCRUD operations use the `/v1/imports` endpoints. The `guardrail` object\nholds the type-specific configuration.\n\nA guardrail returns a verdict for each record and never changes the\nrecord. The verdict fields are at the top level of the result:\n`flagged`, plus `masked` (a `pii` guardrail with `mask: true`) or\n`reasoning` (an `ai_agent` guardrail), while `_json` is empty when a saved\nguardrail is invoked by id. In a flow, the guardrail step's response\nmapping copies them onto the record (`{\"extract\": \"masked\", \"generate\":\n\"description\"}`), and routers branch on the mapped `flagged`.\n\n## Guardrail schema\n\n{% openapi-schemas spec=\"guardrail\" schemas=\"Guardrail\" grouped=\"true\" %}"}],"servers":[{"url":"https://api.integrator.io","description":"Production (US / default region)"},{"url":"https://api.eu.integrator.io","description":"Production (EU region)"},{"url":"https://api.au.integrator.io","description":"Production (AU region)"},{"url":"https://api.ca.integrator.io","description":"Production (CA region)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"DependencyResponse":{"type":"object","description":"Map of dependent-resource types to arrays of dependency entries.\nKeys are plural resource type strings (e.g. `flows`, `imports`,\n`connections`). An empty object `{}` means no dependents.\n","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/DependencyEntry"}}},"DependencyEntry":{"type":"object","description":"A single resource that depends on the queried resource.","properties":{"id":{"type":"string","description":"Unique identifier of the dependent resource."},"name":{"type":"string","description":"Display name of the dependent resource."},"type":{"type":"string","description":"Sub-type of the dependent resource when its collection distinguishes one, such as\n`stream` for a listener export. Only present for resource types that carry a `type`."},"paths":{"type":"array","description":"Dot-notation paths within the dependent resource that reference\nthe target resource. `[*]` denotes array elements.","items":{"type":"string"}},"accessLevel":{"type":"string","description":"The caller's access level on the dependent resource."},"dependencyIds":{"type":"object","description":"Map of resource types to arrays of IDs that this dependent\nresource references on the target. Keys are singular or plural\nresource type strings; values are arrays of ID strings.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["id","name","paths","accessLevel","dependencyIds"]}},"responses":{"401-unauthorized":{"description":"Unauthorized. The request lacks a valid bearer token, or the provided token\nfailed to authenticate.\n\nNote: the 401 response is produced by the auth middleware **before** the\nrequest reaches the endpoint handler, so it does **not** follow the\nstandard `{errors: [...]}` envelope. Instead the body is a bare\n`{message: string}` object with no `code`, no `errors` array. Callers\nhandling 401s should key off the HTTP status and the `message` string,\nnot try to destructure an `errors[]`.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable description of the auth failure. Known values:\n- `\"Unauthorized\"` — no `Authorization` header on the request.\n- `\"Bearer Authentication Failed\"` — header present but token\n  is invalid, revoked, or expired."}},"required":["message"]}}}}}},"paths":{"/v1/imports/{_id}/dependencies":{"get":{"operationId":"listGuardrailDependencies","tags":["Guardrails"],"summary":"List dependencies of a guardrail","description":"Returns the set of resources that depend on the specified guardrail import.\nThe response is an object whose keys are dependent-resource types\n(e.g. `flows`, `imports`) and whose values are arrays of dependency entries.\n\nAn empty object `{}` means no other resources depend on the target.\nThis is also returned for a well-formatted but nonexistent id.","parameters":[{"name":"_id","in":"path","required":true,"description":"Resource ID.","schema":{"type":"string","format":"objectId"}}],"responses":{"200":{"description":"Dependency map. Keys are resource-type strings; values are arrays\nof dependency entries. Returns `{}` when no dependents exist.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependencyResponse"}}}},"401":{"$ref":"#/components/responses/401-unauthorized"}}}}}}
```
