Guardrails
Use the endpoints described below to manage guardrails. Model guardrails are a set of rules or machine learning models that ensure the output of a language model is safe, accurate, and ethical.
Operation path: GET /api/v2/guardConfigurations/
Authentication requirements: BearerAuth
List resource tags.
Parameters
| Name |
In |
Type |
Required |
Description |
| offset |
query |
integer |
false |
This many results will be skipped. |
| limit |
query |
integer |
false |
At most this many results are returned. |
| entityId |
query |
string |
true |
Filter guard configurations by the given entity ID. |
| entityType |
query |
string |
true |
Entity type of the given entity ID. |
Enumerated Values
| Parameter |
Value |
| entityType |
[customModel, customModelVersion, playground] |
Example responses
200 Response
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of guard configurations.",
"items": {
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Create a guard configuration
Operation path: POST /api/v2/guardConfigurations/
Authentication requirements: BearerAuth
Create a guard configuration.
Body parameter
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": [
"string",
"null"
]
}
},
"required": [
"inputColumnName",
"outputColumnName"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"templateId": {
"description": "ID of template this guard is based on.",
"type": "string"
}
},
"required": [
"entityId",
"entityType",
"name",
"stages",
"templateId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Parameters
Example responses
201 Response
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
| Status |
Meaning |
Description |
Schema |
| 201 |
Created |
none |
GuardConfigurationRetrieveResponse |
| 404 |
Not Found |
Either the resource does not exist or the user does not have permission to create the configuration. |
None |
| 409 |
Conflict |
The proposed configuration name is already in use for the same entity. |
None |
Show prediction environments in use
Operation path: GET /api/v2/guardConfigurations/predictionEnvironmentsInUse/
Authentication requirements: BearerAuth
AShow prediction environments in use for moderation.
Parameters
| Name |
In |
Type |
Required |
Description |
| offset |
query |
integer |
false |
This many results will be skipped. |
| limit |
query |
integer |
false |
At most this many results are returned. |
| customModelVersionId |
query |
string |
true |
Show prediction environment information for this custom model version. |
Example responses
200 Response
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of prediction environments in use for this custom model version.",
"items": {
"properties": {
"id": {
"description": "ID of prediction environment.",
"type": "string"
},
"name": {
"description": "Name of prediction environment.",
"type": "string"
},
"usedBy": {
"description": "Guards using this prediction environment.",
"items": {
"properties": {
"configurationId": {
"description": "ID of guard configuration.",
"type": "string"
},
"deploymentId": {
"description": "ID of guard model deployment.",
"type": "string"
},
"name": {
"description": "Name of guard configuration.",
"type": "string"
}
},
"required": [
"configurationId",
"deploymentId",
"name"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 32,
"type": "array"
}
},
"required": [
"id",
"name",
"usedBy"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 32,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Apply moderation configuration
Operation path: POST /api/v2/guardConfigurations/toNewCustomModelVersion/
Authentication requirements: BearerAuth
Apply moderation configuration to a new custom model version.
Body parameter
{
"properties": {
"customModelId": {
"description": "ID the custom model the user is working with.",
"type": "string"
},
"data": {
"description": "List of complete guard configurations to push",
"items": {
"description": "Complete guard configuration to push",
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "OpenAI Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"parameters": {
"description": "Parameter list, not used, deprecated.",
"items": {
"maxLength": 1,
"type": "string"
},
"maxItems": 1,
"type": "array"
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"description",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"overallConfig": {
"description": "Overall moderation configuration to push (not specific to one guard)",
"properties": {
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
}
},
"required": [
"timeoutAction",
"timeoutSec"
],
"type": "object",
"x-versionadded": "v2.35"
}
},
"required": [
"customModelId",
"data"
],
"type": "object",
"x-versionadded": "v2.35"
}
Parameters
Example responses
200 Response
{
"properties": {
"customModelVersionId": {
"description": "ID of the new custom model version created.",
"type": "string"
}
},
"required": [
"customModelVersionId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
| Status |
Meaning |
Description |
Schema |
| 200 |
OK |
none |
GuardConfigurationToCustomModelResponse |
| 404 |
Not Found |
Either the resource does not exist or the user does not have permission to create the configuration. |
None |
| 409 |
Conflict |
The destination custom model version is frozen. Create a new version to save configuration. |
None |
Delete a guard config by config ID
Operation path: DELETE /api/v2/guardConfigurations/{configId}/
Authentication requirements: BearerAuth
Delete a guard config.
Parameters
| Name |
In |
Type |
Required |
Description |
| configId |
path |
string |
true |
ID of the configuration. |
Responses
| Status |
Meaning |
Description |
Schema |
| 204 |
No Content |
none |
None |
| 404 |
Not Found |
Either the config does not exist or the user does not have permission to delete it. |
None |
Retrieve info about a guard configuration by config ID
Operation path: GET /api/v2/guardConfigurations/{configId}/
Authentication requirements: BearerAuth
Retrieve info about a guard configuration.
Parameters
| Name |
In |
Type |
Required |
Description |
| configId |
path |
string |
true |
ID of the configuration. |
Example responses
200 Response
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Update a guard config by config ID
Operation path: PATCH /api/v2/guardConfigurations/{configId}/
Authentication requirements: BearerAuth
Update a guard config.
Body parameter
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": [
"string",
"null"
]
}
},
"required": [
"inputColumnName",
"outputColumnName"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
}
},
"type": "object",
"x-versionadded": "v2.35"
}
Parameters
| Name |
In |
Type |
Required |
Description |
| configId |
path |
string |
true |
ID of the configuration. |
| body |
body |
GuardConfigurationUpdate |
false |
none |
Example responses
200 Response
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
| Status |
Meaning |
Description |
Schema |
| 200 |
OK |
none |
GuardConfigurationRetrieveResponse |
| 404 |
Not Found |
Either the resource does not exist or the user does not have permission to create the configuration. |
None |
| 409 |
Conflict |
The proposed configuration name is already in use for the same entity. |
None |
List guard templates
Operation path: GET /api/v2/guardTemplates/
Authentication requirements: BearerAuth
List guard templates.
Parameters
| Name |
In |
Type |
Required |
Description |
| offset |
query |
integer |
false |
This many results will be skipped. |
| limit |
query |
integer |
false |
At most this many results are returned. |
| includeAgentic |
query |
string |
false |
Include agentic and non-agentic templates in results (by default, agentic templates are not included). |
| isAgentic |
query |
string |
false |
Limit results to agentic templates. If true, this overrides either includeAgentic setting. |
| forPlayground |
query |
string |
false |
Filter for templates suitable for playground (exclude production-only templates). |
| forProduction |
query |
string |
false |
Filter for templates suitable for production (exclude playground-only templates). |
| name |
query |
string,null |
false |
Search for templates by name. |
Enumerated Values
| Parameter |
Value |
| includeAgentic |
[false, False, true, True] |
| isAgentic |
[false, False, true, True] |
| forPlayground |
[false, False, true, True] |
| forProduction |
[false, False, true, True] |
Example responses
200 Response
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of guard templates.",
"items": {
"properties": {
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"allowedStages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the template was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "ID of the user who created the Guard template.",
"maxLength": 1000,
"type": "string"
},
"description": {
"description": "Guard template description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard template object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"modifyMessage": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"modifyMessage"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": true,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"default": true,
"description": "True if the guard is fully configured and valid.",
"type": "boolean"
},
"labels": {
"description": "List of short strings to associate with the template.",
"items": {
"description": "A short string to associate with the template",
"maxLength": 255,
"type": "string"
},
"maxItems": 16,
"type": "array",
"x-versionadded": "v2.37"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard template name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"default": "",
"description": "NeMo guardrails actions",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"default": "",
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"orgId": {
"description": "Organization ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"playgroundOnly": {
"description": "Whether the guard is for playground only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
],
"x-versionadded": "v2.37"
},
"productionOnly": {
"description": "Whether the guard is for production only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
]
},
"type": {
"description": "Guard template type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"allowedStages",
"createdAt",
"description",
"id",
"name",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Retrieve info about a guard template by template ID
Operation path: GET /api/v2/guardTemplates/{templateId}/
Authentication requirements: BearerAuth
Retrieve info about a guard template.
Parameters
| Name |
In |
Type |
Required |
Description |
| templateId |
path |
string |
true |
ID of the template. |
Example responses
200 Response
{
"properties": {
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"allowedStages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the template was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "ID of the user who created the Guard template.",
"maxLength": 1000,
"type": "string"
},
"description": {
"description": "Guard template description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard template object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"modifyMessage": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"modifyMessage"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": true,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"default": true,
"description": "True if the guard is fully configured and valid.",
"type": "boolean"
},
"labels": {
"description": "List of short strings to associate with the template.",
"items": {
"description": "A short string to associate with the template",
"maxLength": 255,
"type": "string"
},
"maxItems": 16,
"type": "array",
"x-versionadded": "v2.37"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard template name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"default": "",
"description": "NeMo guardrails actions",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"default": "",
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"orgId": {
"description": "Organization ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"playgroundOnly": {
"description": "Whether the guard is for playground only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
],
"x-versionadded": "v2.37"
},
"productionOnly": {
"description": "Whether the guard is for production only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
]
},
"type": {
"description": "Guard template type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"allowedStages",
"createdAt",
"description",
"id",
"name",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
List supported LLMs
Operation path: GET /api/v2/moderationSupportedLlms/
Authentication requirements: BearerAuth
List supported LLMs for moderation.
Parameters
| Name |
In |
Type |
Required |
Description |
| offset |
query |
integer |
false |
This many results will be skipped. |
| limit |
query |
integer |
false |
At most this many results are returned. |
Example responses
200 Response
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "List of supported LLMs for moderation.",
"items": {
"properties": {
"description": {
"description": "Description of this LLM.",
"maxLength": 1024,
"type": "string"
},
"id": {
"description": "Identifier for this LLM.",
"maxLength": 1024,
"type": "string"
},
"llmType": {
"description": "General category of this LLM.",
"maxLength": 1024,
"type": "string"
},
"model": {
"description": "Specific model of this LLM.",
"maxLength": 1024,
"type": "string"
},
"name": {
"description": "Display name of this LLM.",
"maxLength": 1024,
"type": "string"
},
"provider": {
"description": "Provider of access to this LLM.",
"maxLength": 1024,
"type": "string"
},
"vendor": {
"description": "Vendor of this LLM.",
"maxLength": 1024,
"type": "string"
}
},
"required": [
"description",
"id",
"llmType",
"model",
"name",
"provider",
"vendor"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Get overall moderation configuration
Operation path: GET /api/v2/overallModerationConfiguration/
Authentication requirements: BearerAuth
Get overall moderation configuration for an entity.
Parameters
| Name |
In |
Type |
Required |
Description |
| entityId |
query |
string |
true |
Retrieve overall moderation configuration for the given entity ID. |
| entityType |
query |
string |
true |
Entity type of the given entity ID. |
Enumerated Values
| Parameter |
Value |
| entityType |
[customModel, customModelVersion, playground] |
Example responses
200 Response
{
"properties": {
"entityId": {
"description": "ID of custom model or playground for this configuration.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
},
"updatedAt": {
"description": "When the configuration was updated.",
"format": "date-time",
"type": "string"
},
"updaterId": {
"description": "ID of user who updated the configuration.",
"type": [
"string",
"null"
]
}
},
"required": [
"entityId",
"entityType",
"timeoutAction",
"timeoutSec",
"updaterId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Update overall moderation configuration
Operation path: PATCH /api/v2/overallModerationConfiguration/
Authentication requirements: BearerAuth
Update overall moderation configuration for an entity.
Body parameter
{
"properties": {
"entityId": {
"description": "ID of custom model or playground for this configuration.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 0,
"type": "integer"
}
},
"required": [
"entityId",
"entityType",
"timeoutAction",
"timeoutSec"
],
"type": "object",
"x-versionadded": "v2.35"
}
Parameters
| Name |
In |
Type |
Required |
Description |
| entityId |
path |
string |
true |
Retrieve overall moderation configuration for the given entity ID. |
| entityType |
path |
string |
true |
Entity type of the given entity ID. |
| body |
body |
OverallModerationConfigurationUpdate |
false |
none |
Enumerated Values
| Parameter |
Value |
| entityType |
[customModel, customModelVersion, playground] |
Example responses
200 Response
{
"properties": {
"entityId": {
"description": "ID of custom model or playground for this configuration.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
},
"updatedAt": {
"description": "When the configuration was updated.",
"format": "date-time",
"type": "string"
},
"updaterId": {
"description": "ID of user who updated the configuration.",
"type": [
"string",
"null"
]
}
},
"required": [
"entityId",
"entityType",
"timeoutAction",
"timeoutSec",
"updaterId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Responses
Schemas
DeploymentAndGuardResponse
{
"properties": {
"configurationId": {
"description": "ID of guard configuration.",
"type": "string"
},
"deploymentId": {
"description": "ID of guard model deployment.",
"type": "string"
},
"name": {
"description": "Name of guard configuration.",
"type": "string"
}
},
"required": [
"configurationId",
"deploymentId",
"name"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| configurationId |
string |
true |
|
ID of guard configuration. |
| deploymentId |
string |
true |
|
ID of guard model deployment. |
| name |
string |
true |
|
Name of guard configuration. |
GuardAdditionalConfig
{
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
}
Additional configuration for the guard.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| cost |
GuardConfigurationCostInfo |
false |
|
How to calculate cost information for this guard. |
| toolCall |
GuardToolCallInfo |
false |
|
How to calculate tool call metrics for this guard. |
GuardConditionResponse
{
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
}
Condition to trigger intervention
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| comparand |
any |
true |
|
Condition comparand (basis of comparison) |
anyOf
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
boolean |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
number |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
string |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
[string] |
false |
maxItems: 10
|
none |
continued
| Name |
Type |
Required |
Restrictions |
Description |
| comparator |
string |
true |
|
Condition comparator (operator) |
Enumerated Values
| Property |
Value |
| comparator |
[greaterThan, lessThan, equals, notEquals, is, isNot, matches, doesNotMatch, contains, doesNotContain] |
GuardConfigurationConditionResponse
{
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
}
Condition to trigger intervention
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| comparand |
any |
true |
|
Condition comparand (basis of comparison |
anyOf
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
boolean |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
number |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
string |
false |
|
none |
or
| Name |
Type |
Required |
Restrictions |
Description |
| » anonymous |
[string] |
false |
maxItems: 10
|
none |
continued
| Name |
Type |
Required |
Restrictions |
Description |
| comparator |
string |
true |
|
Condition comparator (operator) |
Enumerated Values
| Property |
Value |
| comparator |
[greaterThan, lessThan, equals, notEquals, is, isNot, matches, doesNotMatch, contains, doesNotContain] |
GuardConfigurationCostInfo
{
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
}
How to calculate cost information for this guard.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| currency |
string |
true |
maxLength: 255
|
ISO 4217 Currency code for display. |
| inputPrice |
number |
true |
minimum: 0
|
Cost per unit measure of tokens for input. |
| inputUnit |
integer |
true |
minimum: 0
|
Number of tokens related to input price. |
| outputPrice |
number |
true |
minimum: 0
|
Cost per unit measure of tokens for output. |
| outputUnit |
integer |
true |
minimum: 0
|
Number of tokens related to output price. |
GuardConfigurationCreate
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": [
"string",
"null"
]
}
},
"required": [
"inputColumnName",
"outputColumnName"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"templateId": {
"description": "ID of template this guard is based on.",
"type": "string"
}
},
"required": [
"entityId",
"entityType",
"name",
"stages",
"templateId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| additionalGuardConfig |
GuardAdditionalConfig |
false |
|
Additional configuration for the guard. |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| awsAccount |
string,null |
false |
|
ID of user credential containing an AWS account. |
| awsModel |
string,null |
false |
|
AWS model. |
| awsRegion |
string,null |
false |
maxLength: 255
|
AWS model region. |
| deploymentId |
string,null |
false |
|
ID of deployed model, for model guards. |
| description |
string |
false |
maxLength: 4096
|
Guard configuration description |
| entityId |
string |
true |
|
ID of custom model or playground for this guard. |
| entityType |
string |
true |
|
Type of associated entity. |
| googleModel |
string,null |
false |
|
Google model. |
| googleRegion |
string,null |
false |
maxLength: 255
|
Google model region. |
| googleServiceAccount |
string,null |
false |
|
ID of user credential containing a Google service account. |
| intervention |
GuardConfigurationInterventionResponse |
false |
|
Intervention configuration for the guard. |
| llmType |
string,null |
false |
|
Type of LLM used by this guard |
| modelInfo |
GuardConfigurationPayloadModelInfo |
false |
|
Configuration info for guards using deployed models. |
| name |
string |
true |
maxLength: 255
|
Guard configuration name |
| nemoInfo |
GuardConfigurationNemoInfoResponse |
false |
|
Configuration info for NeMo guards. |
| openaiApiBase |
string,null |
false |
maxLength: 255
|
Azure OpenAI API Base URL |
| openaiApiKey |
string,null |
false |
maxLength: 255
|
Deprecated; use openai_credential instead |
| openaiCredential |
string,null |
false |
|
ID of user credential containing an OpenAI token. |
| openaiDeploymentId |
string,null |
false |
maxLength: 255
|
Open API Deployment ID |
| stages |
[string] |
true |
maxItems: 16
|
The stages where the guard can run. |
| templateId |
string |
true |
|
ID of template this guard is based on. |
Enumerated Values
| Property |
Value |
| awsModel |
[amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, anthropic-claude-3.5-sonnet-v1, anthropic-claude-3.5-sonnet-v2, amazon-nova-lite, amazon-nova-micro, amazon-nova-pro] |
| entityType |
[customModel, customModelVersion, playground] |
| googleModel |
[chat-bison, google-gemini-1.5-flash, google-gemini-1.5-pro] |
| llmType |
[openAi, azureOpenAi, google, amazon, datarobot, nim] |
GuardConfigurationFullPost
{
"description": "Complete guard configuration to push",
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "OpenAI Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"parameters": {
"description": "Parameter list, not used, deprecated.",
"items": {
"maxLength": 1,
"type": "string"
},
"maxItems": 1,
"type": "array"
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"description",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Complete guard configuration to push
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| additionalGuardConfig |
GuardAdditionalConfig |
false |
|
Additional configuration for the guard. |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| awsAccount |
string,null |
false |
|
ID of user credential containing an AWS account. |
| awsModel |
string,null |
false |
|
AWS model. |
| awsRegion |
string,null |
false |
maxLength: 255
|
AWS model region. |
| deploymentId |
string,null |
false |
|
ID of deployed model, for model guards. |
| description |
string |
true |
maxLength: 4096
|
Guard configuration description |
| errorMessage |
string,null |
false |
|
Error message if the guard configuration is invalid. |
| googleModel |
string,null |
false |
|
Google model. |
| googleRegion |
string,null |
false |
maxLength: 255
|
Google model region. |
| googleServiceAccount |
string,null |
false |
|
ID of user credential containing a Google service account. |
| intervention |
GuardConfigurationInterventionResponse |
false |
|
Intervention configuration for the guard. |
| isAgentic |
boolean |
false |
|
True if the guard is suitable for agentic workflows only. |
| isValid |
boolean |
false |
|
Whether the guard is valid or not. |
| llmType |
string,null |
false |
|
Type of LLM used by this guard |
| modelInfo |
GuardModelInfoResponse |
false |
|
Configuration info for guards using deployed models. |
| name |
string |
true |
maxLength: 255
|
Guard configuration name |
| nemoInfo |
GuardConfigurationNemoInfoResponse |
false |
|
Configuration info for NeMo guards. |
| ootbType |
string,null |
false |
|
Guard template "Out of the Box" metric type |
| openaiApiBase |
string,null |
false |
maxLength: 255
|
Azure OpenAI API Base URL |
| openaiApiKey |
string,null |
false |
maxLength: 255
|
Deprecated; use openai_credential instead |
| openaiCredential |
string,null |
false |
|
ID of user credential containing an OpenAI token. |
| openaiDeploymentId |
string,null |
false |
maxLength: 255
|
OpenAI Deployment ID |
| parameters |
[string] |
false |
maxItems: 1
|
Parameter list, not used, deprecated. |
| stages |
[string] |
true |
maxItems: 16
|
The stages where the guard is configured to run. |
| type |
string |
true |
|
Guard configuration type |
Enumerated Values
| Property |
Value |
| awsModel |
[amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, anthropic-claude-3.5-sonnet-v1, anthropic-claude-3.5-sonnet-v2, amazon-nova-lite, amazon-nova-micro, amazon-nova-pro] |
| googleModel |
[chat-bison, google-gemini-1.5-flash, google-gemini-1.5-pro] |
| llmType |
[openAi, azureOpenAi, google, amazon, datarobot, nim] |
| ootbType |
[token_count, faithfulness, rouge_1, agent_goal_accuracy, agent_goal_accuracy_with_reference, cost, task_adherence, tool_call_accuracy, agentGoalAccuracy, agentGoalAccuracyWithReference, taskAdherence, toolCallAccuracy] |
| type |
[guardModel, nemo, ootb, pii, userModel] |
GuardConfigurationInterventionResponse
{
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
}
Intervention configuration for the guard.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| action |
string |
true |
|
Action to take if conditions are met |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| conditionLogic |
string |
false |
|
Action to take if conditions are met |
| conditions |
[GuardConfigurationConditionResponse] |
true |
maxItems: 1
|
List of conditions to trigger intervention |
| message |
string |
true |
maxLength: 4096
|
Message to use if prompt or response is blocked |
| sendNotification |
boolean |
false |
|
Create a notification event if intervention is triggered |
Enumerated Values
| Property |
Value |
| action |
[block, report, replace] |
| conditionLogic |
any |
GuardConfigurationListResponse
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of guard configurations.",
"items": {
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| count |
integer |
false |
|
Number of items returned on this page. |
| data |
[GuardConfigurationRetrieveResponse] |
true |
maxItems: 200
|
list of guard configurations. |
| next |
string,null(uri) |
true |
|
URL pointing to the next page (if null, there is no next page). |
| previous |
string,null(uri) |
true |
|
URL pointing to the previous page (if null, there is no previous page). |
| totalCount |
integer |
true |
|
The total number of items across all pages. |
GuardConfigurationNemoInfoResponse
{
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
}
Configuration info for NeMo guards.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| actions |
string |
false |
maxLength: 4096
|
NeMo guardrails actions file |
| blockedTerms |
string |
true |
maxLength: 4096
|
NeMo guardrails blocked terms list |
| credentialId |
string,null |
false |
|
NeMo guardrails credential ID (deprecated; use "openai_credential") |
| llmPrompts |
string |
false |
maxLength: 4096
|
NeMo guardrails prompts |
| mainConfig |
string |
true |
maxLength: 4096
|
Overall NeMo configuration YAML |
| railsConfig |
string |
true |
maxLength: 4096
|
NeMo guardrails configuration Colang |
GuardConfigurationPayloadModelInfo
{
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": [
"string",
"null"
]
}
},
"required": [
"inputColumnName",
"outputColumnName"
],
"type": "object",
"x-versionadded": "v2.35"
}
Configuration info for guards using deployed models.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| classNames |
[string] |
false |
maxItems: 100
|
List of class names for multiclass models |
| inputColumnName |
string |
true |
maxLength: 255
|
Input column name |
| modelId |
string,null |
false |
|
ID of registered model, for model guards. |
| modelName |
string |
false |
maxLength: 255
|
ID of registered model, for .model guards |
| outputColumnName |
string |
true |
maxLength: 255
|
Output column name |
| replacementTextColumnName |
string |
false |
maxLength: 255
|
Name of the output column with replacement text. Required only if intervention.action is replace. |
| targetType |
string,null |
false |
|
Target type |
Enumerated Values
| Property |
Value |
| targetType |
[Binary, Regression, Multiclass, TextGeneration] |
GuardConfigurationPredictionEnvironmentsInUseListResponse
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of prediction environments in use for this custom model version.",
"items": {
"properties": {
"id": {
"description": "ID of prediction environment.",
"type": "string"
},
"name": {
"description": "Name of prediction environment.",
"type": "string"
},
"usedBy": {
"description": "Guards using this prediction environment.",
"items": {
"properties": {
"configurationId": {
"description": "ID of guard configuration.",
"type": "string"
},
"deploymentId": {
"description": "ID of guard model deployment.",
"type": "string"
},
"name": {
"description": "Name of guard configuration.",
"type": "string"
}
},
"required": [
"configurationId",
"deploymentId",
"name"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 32,
"type": "array"
}
},
"required": [
"id",
"name",
"usedBy"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 32,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| count |
integer |
false |
|
Number of items returned on this page. |
| data |
[PredictionEnvironmentInUseResponse] |
true |
maxItems: 32
|
list of prediction environments in use for this custom model version. |
| next |
string,null(uri) |
true |
|
URL pointing to the next page (if null, there is no next page). |
| previous |
string,null(uri) |
true |
|
URL pointing to the previous page (if null, there is no previous page). |
| totalCount |
integer |
true |
|
The total number of items across all pages. |
GuardConfigurationRetrieveResponse
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the configuration was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard configuration.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "Name of the user who created the Guard configuration.",
"maxLength": 1000,
"type": "string"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"entityId": {
"description": "ID of custom model or playground for this guard.",
"type": [
"string",
"null"
]
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard configuration object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"createdAt",
"description",
"entityId",
"entityType",
"id",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| additionalGuardConfig |
GuardAdditionalConfig |
false |
|
Additional configuration for the guard. |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| awsAccount |
string,null |
false |
|
ID of user credential containing an AWS account. |
| awsModel |
string,null |
false |
|
AWS model. |
| awsRegion |
string,null |
false |
maxLength: 255
|
AWS model region. |
| createdAt |
string(date-time) |
true |
|
When the configuration was created. |
| creatorId |
string,null |
false |
|
ID of the user who created the Guard configuration. |
| creatorName |
string |
false |
maxLength: 1000
|
Name of the user who created the Guard configuration. |
| deploymentId |
string,null |
false |
|
ID of deployed model, for model guards. |
| description |
string |
true |
maxLength: 4096
|
Guard configuration description |
| entityId |
string,null |
true |
|
ID of custom model or playground for this guard. |
| entityType |
string |
true |
|
Type of associated entity. |
| errorMessage |
string,null |
false |
|
Error message if the guard configuration is invalid. |
| googleModel |
string,null |
false |
|
Google model. |
| googleRegion |
string,null |
false |
maxLength: 255
|
Google model region. |
| googleServiceAccount |
string,null |
false |
|
ID of user credential containing a Google service account. |
| id |
string |
true |
|
Guard configuration object ID |
| intervention |
GuardConfigurationInterventionResponse |
false |
|
Intervention configuration for the guard. |
| isAgentic |
boolean |
false |
|
True if the guard is suitable for agentic workflows only. |
| isValid |
boolean |
false |
|
Whether the guard is valid or not. |
| llmType |
string,null |
false |
|
Type of LLM used by this guard |
| modelInfo |
GuardModelInfoResponse |
false |
|
Configuration info for guards using deployed models. |
| name |
string |
true |
maxLength: 255
|
Guard configuration name |
| nemoInfo |
GuardConfigurationNemoInfoResponse |
false |
|
Configuration info for NeMo guards. |
| ootbType |
string,null |
false |
|
Guard template "Out of the Box" metric type |
| openaiApiBase |
string,null |
false |
maxLength: 255
|
Azure OpenAI API Base URL |
| openaiApiKey |
string,null |
false |
maxLength: 255
|
Deprecated; use openai_credential instead |
| openaiCredential |
string,null |
false |
|
ID of user credential containing an OpenAI token. |
| openaiDeploymentId |
string,null |
false |
maxLength: 255
|
Open API Deployment ID |
| stages |
[string] |
true |
maxItems: 16
|
The stages where the guard is configured to run. |
| type |
string |
true |
|
Guard configuration type |
Enumerated Values
| Property |
Value |
| awsModel |
[amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, anthropic-claude-3.5-sonnet-v1, anthropic-claude-3.5-sonnet-v2, amazon-nova-lite, amazon-nova-micro, amazon-nova-pro] |
| entityType |
[customModel, customModelVersion, playground] |
| googleModel |
[chat-bison, google-gemini-1.5-flash, google-gemini-1.5-pro] |
| llmType |
[openAi, azureOpenAi, google, amazon, datarobot, nim] |
| ootbType |
[token_count, faithfulness, rouge_1, agent_goal_accuracy, agent_goal_accuracy_with_reference, cost, task_adherence, tool_call_accuracy, agentGoalAccuracy, agentGoalAccuracyWithReference, taskAdherence, toolCallAccuracy] |
| type |
[guardModel, nemo, ootb, pii, userModel] |
GuardConfigurationToCustomModelResponse
{
"properties": {
"customModelVersionId": {
"description": "ID of the new custom model version created.",
"type": "string"
}
},
"required": [
"customModelVersionId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| customModelVersionId |
string |
true |
|
ID of the new custom model version created. |
GuardConfigurationToCustomModelVersion
{
"properties": {
"customModelId": {
"description": "ID the custom model the user is working with.",
"type": "string"
},
"data": {
"description": "List of complete guard configurations to push",
"items": {
"description": "Complete guard configuration to push",
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": false,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"description": "Whether the guard is valid or not.",
"type": "boolean"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "OpenAI Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"parameters": {
"description": "Parameter list, not used, deprecated.",
"items": {
"maxLength": 1,
"type": "string"
},
"maxItems": 1,
"type": "array"
},
"stages": {
"description": "The stages where the guard is configured to run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"type": {
"description": "Guard configuration type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"description",
"name",
"stages",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"overallConfig": {
"description": "Overall moderation configuration to push (not specific to one guard)",
"properties": {
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
}
},
"required": [
"timeoutAction",
"timeoutSec"
],
"type": "object",
"x-versionadded": "v2.35"
}
},
"required": [
"customModelId",
"data"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| customModelId |
string |
true |
|
ID the custom model the user is working with. |
| data |
[GuardConfigurationFullPost] |
true |
maxItems: 200
|
List of complete guard configurations to push |
| overallConfig |
OverallConfigUpdate |
false |
|
Overall moderation configuration to push (not specific to one guard) |
GuardConfigurationUpdate
{
"properties": {
"additionalGuardConfig": {
"description": "Additional configuration for the guard.",
"properties": {
"cost": {
"description": "How to calculate cost information for this guard.",
"properties": {
"currency": {
"description": "ISO 4217 Currency code for display.",
"maxLength": 255,
"type": "string"
},
"inputPrice": {
"description": "Cost per unit measure of tokens for input.",
"minimum": 0,
"type": "number"
},
"inputUnit": {
"description": "Number of tokens related to input price.",
"minimum": 0,
"type": "integer"
},
"outputPrice": {
"description": "Cost per unit measure of tokens for output.",
"minimum": 0,
"type": "number"
},
"outputUnit": {
"description": "Number of tokens related to output price.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"currency",
"inputPrice",
"inputUnit",
"outputPrice",
"outputUnit"
],
"type": "object",
"x-versionadded": "v2.37"
},
"toolCall": {
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
},
"type": "object",
"x-versionadded": "v2.37"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"awsAccount": {
"description": "ID of user credential containing an AWS account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"deploymentId": {
"description": "ID of deployed model, for model guards.",
"type": [
"string",
"null"
]
},
"description": {
"description": "Guard configuration description",
"maxLength": 4096,
"type": "string"
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleServiceAccount": {
"description": "ID of user credential containing a Google service account.",
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"message": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"default": false,
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"message"
],
"type": "object",
"x-versionadded": "v2.35"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": [
"string",
"null"
]
}
},
"required": [
"inputColumnName",
"outputColumnName"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard configuration name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"description": "NeMo guardrails actions file",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID (deprecated; use \"openai_credential\")",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiCredential": {
"description": "ID of user credential containing an OpenAI token.",
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
}
},
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| additionalGuardConfig |
GuardAdditionalConfig |
false |
|
Additional configuration for the guard. |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| awsAccount |
string,null |
false |
|
ID of user credential containing an AWS account. |
| awsModel |
string,null |
false |
|
AWS model. |
| awsRegion |
string,null |
false |
maxLength: 255
|
AWS model region. |
| deploymentId |
string,null |
false |
|
ID of deployed model, for model guards. |
| description |
string |
false |
maxLength: 4096
|
Guard configuration description |
| googleModel |
string,null |
false |
|
Google model. |
| googleRegion |
string,null |
false |
maxLength: 255
|
Google model region. |
| googleServiceAccount |
string,null |
false |
|
ID of user credential containing a Google service account. |
| intervention |
GuardConfigurationInterventionResponse |
false |
|
Intervention configuration for the guard. |
| llmType |
string,null |
false |
|
Type of LLM used by this guard |
| modelInfo |
GuardConfigurationPayloadModelInfo |
false |
|
Configuration info for guards using deployed models. |
| name |
string |
false |
maxLength: 255
|
Guard configuration name |
| nemoInfo |
GuardConfigurationNemoInfoResponse |
false |
|
Configuration info for NeMo guards. |
| openaiApiBase |
string,null |
false |
maxLength: 255
|
Azure OpenAI API Base URL |
| openaiApiKey |
string,null |
false |
maxLength: 255
|
Deprecated; use openai_credential instead |
| openaiCredential |
string,null |
false |
|
ID of user credential containing an OpenAI token. |
| openaiDeploymentId |
string,null |
false |
maxLength: 255
|
Open API Deployment ID |
Enumerated Values
| Property |
Value |
| awsModel |
[amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, anthropic-claude-3.5-sonnet-v1, anthropic-claude-3.5-sonnet-v2, amazon-nova-lite, amazon-nova-micro, amazon-nova-pro] |
| googleModel |
[chat-bison, google-gemini-1.5-flash, google-gemini-1.5-pro] |
| llmType |
[openAi, azureOpenAi, google, amazon, datarobot, nim] |
GuardInterventionResponse
{
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"modifyMessage": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"modifyMessage"
],
"type": "object",
"x-versionadded": "v2.35"
}
Intervention configuration for the guard.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| action |
string |
true |
|
Action to take if conditions are met |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| conditionLogic |
string |
false |
|
Action to take if conditions are met |
| conditions |
[GuardConditionResponse] |
true |
maxItems: 1
|
List of conditions to trigger intervention |
| modifyMessage |
string |
true |
maxLength: 4096
|
Message to use if prompt or response is blocked |
| sendNotification |
boolean |
false |
|
Create a notification event if intervention is triggered |
Enumerated Values
| Property |
Value |
| action |
[block, report, replace] |
| conditionLogic |
any |
GuardModelInfoResponse
{
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
}
Configuration info for guards using deployed models.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| classNames |
[string] |
false |
maxItems: 100
|
List of class names for multiclass models |
| inputColumnName |
string |
true |
maxLength: 255
|
Input column name |
| modelId |
string,null |
false |
|
ID of registered model, for model guards. |
| modelName |
string |
false |
maxLength: 255
|
ID of registered model, for .model guards |
| outputColumnName |
string |
true |
maxLength: 255
|
Output column name |
| replacementTextColumnName |
string |
false |
maxLength: 255
|
Name of the output column with replacement text. Required only if intervention.action is replace. |
| targetType |
string |
true |
|
Target type |
Enumerated Values
| Property |
Value |
| targetType |
[Binary, Regression, Multiclass, TextGeneration] |
GuardNemoInfoResponse
{
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"default": "",
"description": "NeMo guardrails actions",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"default": "",
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
}
Configuration info for NeMo guards.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| actions |
string |
false |
maxLength: 4096
|
NeMo guardrails actions |
| blockedTerms |
string |
true |
maxLength: 4096
|
NeMo guardrails blocked terms list |
| credentialId |
string,null |
false |
|
NeMo guardrails credential ID |
| llmPrompts |
string |
false |
maxLength: 4096
|
NeMo guardrails prompts |
| mainConfig |
string |
true |
maxLength: 4096
|
Overall NeMo configuration YAML |
| railsConfig |
string |
true |
maxLength: 4096
|
NeMo guardrails configuration Colang |
GuardTemplateListResponse
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "list of guard templates.",
"items": {
"properties": {
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"allowedStages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the template was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "ID of the user who created the Guard template.",
"maxLength": 1000,
"type": "string"
},
"description": {
"description": "Guard template description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard template object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"modifyMessage": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"modifyMessage"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": true,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"default": true,
"description": "True if the guard is fully configured and valid.",
"type": "boolean"
},
"labels": {
"description": "List of short strings to associate with the template.",
"items": {
"description": "A short string to associate with the template",
"maxLength": 255,
"type": "string"
},
"maxItems": 16,
"type": "array",
"x-versionadded": "v2.37"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard template name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"default": "",
"description": "NeMo guardrails actions",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"default": "",
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"orgId": {
"description": "Organization ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"playgroundOnly": {
"description": "Whether the guard is for playground only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
],
"x-versionadded": "v2.37"
},
"productionOnly": {
"description": "Whether the guard is for production only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
]
},
"type": {
"description": "Guard template type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"allowedStages",
"createdAt",
"description",
"id",
"name",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| count |
integer |
false |
|
Number of items returned on this page. |
| data |
[GuardTemplateRetrieveResponse] |
true |
maxItems: 200
|
list of guard templates. |
| next |
string,null(uri) |
true |
|
URL pointing to the next page (if null, there is no next page). |
| previous |
string,null(uri) |
true |
|
URL pointing to the previous page (if null, there is no previous page). |
| totalCount |
integer |
true |
|
The total number of items across all pages. |
GuardTemplateRetrieveResponse
{
"properties": {
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array",
"x-versionadded": "v2.36"
},
"allowedStages": {
"description": "The stages where the guard can run.",
"items": {
"enum": [
"prompt",
"response"
],
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"awsModel": {
"description": "AWS model.",
"enum": [
"amazon-titan",
"anthropic-claude-2",
"anthropic-claude-3-haiku",
"anthropic-claude-3-sonnet",
"anthropic-claude-3-opus",
"anthropic-claude-3.5-sonnet-v1",
"anthropic-claude-3.5-sonnet-v2",
"amazon-nova-lite",
"amazon-nova-micro",
"amazon-nova-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"awsRegion": {
"description": "AWS model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"createdAt": {
"description": "When the template was created.",
"format": "date-time",
"type": "string"
},
"creatorId": {
"description": "ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"creatorName": {
"description": "ID of the user who created the Guard template.",
"maxLength": 1000,
"type": "string"
},
"description": {
"description": "Guard template description",
"maxLength": 4096,
"type": "string"
},
"errorMessage": {
"description": "Error message if the guard configuration is invalid.",
"type": [
"string",
"null"
]
},
"googleModel": {
"description": "Google model.",
"enum": [
"chat-bison",
"google-gemini-1.5-flash",
"google-gemini-1.5-pro"
],
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"googleRegion": {
"description": "Google model region.",
"maxLength": 255,
"type": [
"string",
"null"
],
"x-versionadded": "v2.35"
},
"id": {
"description": "Guard template object ID",
"type": "string"
},
"intervention": {
"description": "Intervention configuration for the guard.",
"properties": {
"action": {
"description": "Action to take if conditions are met",
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"allowedActions": {
"description": "The actions this guard is allowed to take.",
"items": {
"enum": [
"block",
"report",
"replace"
],
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"conditionLogic": {
"default": "any",
"description": "Action to take if conditions are met",
"enum": [
"any"
],
"type": "string"
},
"conditions": {
"description": "List of conditions to trigger intervention",
"items": {
"description": "Condition to trigger intervention",
"properties": {
"comparand": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"items": {
"description": "Class name to match",
"maxLength": 128,
"type": "string"
},
"maxItems": 10,
"type": "array"
}
],
"description": "Condition comparand (basis of comparison)"
},
"comparator": {
"description": "Condition comparator (operator)",
"enum": [
"greaterThan",
"lessThan",
"equals",
"notEquals",
"is",
"isNot",
"matches",
"doesNotMatch",
"contains",
"doesNotContain"
],
"type": "string"
}
},
"required": [
"comparand",
"comparator"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 1,
"type": "array"
},
"modifyMessage": {
"description": "Message to use if prompt or response is blocked",
"maxLength": 4096,
"type": "string"
},
"sendNotification": {
"description": "Create a notification event if intervention is triggered",
"type": "boolean"
}
},
"required": [
"action",
"conditions",
"modifyMessage"
],
"type": "object",
"x-versionadded": "v2.35"
},
"isAgentic": {
"default": true,
"description": "True if the guard is suitable for agentic workflows only.",
"type": "boolean",
"x-versionadded": "v2.37"
},
"isValid": {
"default": true,
"description": "True if the guard is fully configured and valid.",
"type": "boolean"
},
"labels": {
"description": "List of short strings to associate with the template.",
"items": {
"description": "A short string to associate with the template",
"maxLength": 255,
"type": "string"
},
"maxItems": 16,
"type": "array",
"x-versionadded": "v2.37"
},
"llmType": {
"description": "Type of LLM used by this guard",
"enum": [
"openAi",
"azureOpenAi",
"google",
"amazon",
"datarobot",
"nim"
],
"type": [
"string",
"null"
]
},
"modelInfo": {
"description": "Configuration info for guards using deployed models.",
"properties": {
"classNames": {
"description": "List of class names for multiclass models",
"items": {
"description": "Class name",
"maxLength": 128,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"inputColumnName": {
"description": "Input column name",
"maxLength": 255,
"type": "string"
},
"modelId": {
"description": "ID of registered model, for model guards.",
"type": [
"string",
"null"
]
},
"modelName": {
"default": "",
"description": "ID of registered model, for .model guards",
"maxLength": 255,
"type": "string"
},
"outputColumnName": {
"description": "Output column name",
"maxLength": 255,
"type": "string"
},
"replacementTextColumnName": {
"default": "",
"description": "Name of the output column with replacement text. Required only if intervention.action is `replace`.",
"maxLength": 255,
"type": "string"
},
"targetType": {
"description": "Target type",
"enum": [
"Binary",
"Regression",
"Multiclass",
"TextGeneration"
],
"type": "string"
}
},
"required": [
"inputColumnName",
"outputColumnName",
"targetType"
],
"type": "object",
"x-versionadded": "v2.35"
},
"name": {
"description": "Guard template name",
"maxLength": 255,
"type": "string"
},
"nemoInfo": {
"description": "Configuration info for NeMo guards.",
"properties": {
"actions": {
"default": "",
"description": "NeMo guardrails actions",
"maxLength": 4096,
"type": "string"
},
"blockedTerms": {
"description": "NeMo guardrails blocked terms list",
"maxLength": 4096,
"type": "string"
},
"credentialId": {
"description": "NeMo guardrails credential ID",
"type": [
"string",
"null"
]
},
"llmPrompts": {
"default": "",
"description": "NeMo guardrails prompts",
"maxLength": 4096,
"type": "string"
},
"mainConfig": {
"description": "Overall NeMo configuration YAML",
"maxLength": 4096,
"type": "string"
},
"railsConfig": {
"description": "NeMo guardrails configuration Colang",
"maxLength": 4096,
"type": "string"
}
},
"required": [
"blockedTerms",
"mainConfig",
"railsConfig"
],
"type": "object",
"x-versionadded": "v2.35"
},
"ootbType": {
"description": "Guard template \"Out of the Box\" metric type",
"enum": [
"token_count",
"faithfulness",
"rouge_1",
"agent_goal_accuracy",
"agent_goal_accuracy_with_reference",
"cost",
"task_adherence",
"tool_call_accuracy",
"agentGoalAccuracy",
"agentGoalAccuracyWithReference",
"taskAdherence",
"toolCallAccuracy"
],
"type": [
"string",
"null"
]
},
"openaiApiBase": {
"description": "Azure OpenAI API Base URL",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiApiKey": {
"description": "Deprecated; use openai_credential instead",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"openaiDeploymentId": {
"description": "Open API Deployment ID",
"maxLength": 255,
"type": [
"string",
"null"
]
},
"orgId": {
"description": "Organization ID of the user who created the Guard template.",
"type": [
"string",
"null"
]
},
"playgroundOnly": {
"description": "Whether the guard is for playground only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
],
"x-versionadded": "v2.37"
},
"productionOnly": {
"description": "Whether the guard is for production only, or if it can be used in production and playground.",
"type": [
"boolean",
"null"
]
},
"type": {
"description": "Guard template type",
"enum": [
"guardModel",
"nemo",
"ootb",
"pii",
"userModel"
],
"type": "string"
}
},
"required": [
"allowedStages",
"createdAt",
"description",
"id",
"name",
"type"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| allowedActions |
[string] |
false |
maxItems: 10
|
The actions this guard is allowed to take. |
| allowedStages |
[string] |
true |
maxItems: 16
|
The stages where the guard can run. |
| awsModel |
string,null |
false |
|
AWS model. |
| awsRegion |
string,null |
false |
maxLength: 255
|
AWS model region. |
| createdAt |
string(date-time) |
true |
|
When the template was created. |
| creatorId |
string,null |
false |
|
ID of the user who created the Guard template. |
| creatorName |
string |
false |
maxLength: 1000
|
ID of the user who created the Guard template. |
| description |
string |
true |
maxLength: 4096
|
Guard template description |
| errorMessage |
string,null |
false |
|
Error message if the guard configuration is invalid. |
| googleModel |
string,null |
false |
|
Google model. |
| googleRegion |
string,null |
false |
maxLength: 255
|
Google model region. |
| id |
string |
true |
|
Guard template object ID |
| intervention |
GuardInterventionResponse |
false |
|
Intervention configuration for the guard. |
| isAgentic |
boolean |
false |
|
True if the guard is suitable for agentic workflows only. |
| isValid |
boolean |
false |
|
True if the guard is fully configured and valid. |
| labels |
[string] |
false |
maxItems: 16
|
List of short strings to associate with the template. |
| llmType |
string,null |
false |
|
Type of LLM used by this guard |
| modelInfo |
GuardModelInfoResponse |
false |
|
Configuration info for guards using deployed models. |
| name |
string |
true |
maxLength: 255
|
Guard template name |
| nemoInfo |
GuardNemoInfoResponse |
false |
|
Configuration info for NeMo guards. |
| ootbType |
string,null |
false |
|
Guard template "Out of the Box" metric type |
| openaiApiBase |
string,null |
false |
maxLength: 255
|
Azure OpenAI API Base URL |
| openaiApiKey |
string,null |
false |
maxLength: 255
|
Deprecated; use openai_credential instead |
| openaiDeploymentId |
string,null |
false |
maxLength: 255
|
Open API Deployment ID |
| orgId |
string,null |
false |
|
Organization ID of the user who created the Guard template. |
| playgroundOnly |
boolean,null |
false |
|
Whether the guard is for playground only, or if it can be used in production and playground. |
| productionOnly |
boolean,null |
false |
|
Whether the guard is for production only, or if it can be used in production and playground. |
| type |
string |
true |
|
Guard template type |
Enumerated Values
| Property |
Value |
| awsModel |
[amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, anthropic-claude-3.5-sonnet-v1, anthropic-claude-3.5-sonnet-v2, amazon-nova-lite, amazon-nova-micro, amazon-nova-pro] |
| googleModel |
[chat-bison, google-gemini-1.5-flash, google-gemini-1.5-pro] |
| llmType |
[openAi, azureOpenAi, google, amazon, datarobot, nim] |
| ootbType |
[token_count, faithfulness, rouge_1, agent_goal_accuracy, agent_goal_accuracy_with_reference, cost, task_adherence, tool_call_accuracy, agentGoalAccuracy, agentGoalAccuracyWithReference, taskAdherence, toolCallAccuracy] |
| type |
[guardModel, nemo, ootb, pii, userModel] |
{
"description": "How to calculate tool call metrics for this guard.",
"properties": {
"comparisonMetric": {
"description": "How tool calls should be compared for metrics calculations.",
"enum": [
"exactMatch",
"doNotCompare"
],
"type": "string"
}
},
"required": [
"comparisonMetric"
],
"type": "object",
"x-versionadded": "v2.37"
}
How to calculate tool call metrics for this guard.
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| comparisonMetric |
string |
true |
|
How tool calls should be compared for metrics calculations. |
Enumerated Values
| Property |
Value |
| comparisonMetric |
[exactMatch, doNotCompare] |
OverallConfigUpdate
{
"description": "Overall moderation configuration to push (not specific to one guard)",
"properties": {
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
}
},
"required": [
"timeoutAction",
"timeoutSec"
],
"type": "object",
"x-versionadded": "v2.35"
}
Overall moderation configuration to push (not specific to one guard)
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| timeoutAction |
string |
true |
|
Action to take if timeout occurs |
| timeoutSec |
integer |
true |
minimum: 2
|
Timeout value in seconds for any guard |
Enumerated Values
| Property |
Value |
| timeoutAction |
[block, score] |
OverallModerationConfigurationResponse
{
"properties": {
"entityId": {
"description": "ID of custom model or playground for this configuration.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 2,
"type": "integer"
},
"updatedAt": {
"description": "When the configuration was updated.",
"format": "date-time",
"type": "string"
},
"updaterId": {
"description": "ID of user who updated the configuration.",
"type": [
"string",
"null"
]
}
},
"required": [
"entityId",
"entityType",
"timeoutAction",
"timeoutSec",
"updaterId"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| entityId |
string |
true |
|
ID of custom model or playground for this configuration. |
| entityType |
string |
true |
|
Type of associated entity. |
| timeoutAction |
string |
true |
|
Action to take if timeout occurs |
| timeoutSec |
integer |
true |
minimum: 2
|
Timeout value in seconds for any guard |
| updatedAt |
string(date-time) |
false |
|
When the configuration was updated. |
| updaterId |
string,null |
true |
|
ID of user who updated the configuration. |
Enumerated Values
| Property |
Value |
| entityType |
[customModel, customModelVersion, playground] |
| timeoutAction |
[block, score] |
OverallModerationConfigurationUpdate
{
"properties": {
"entityId": {
"description": "ID of custom model or playground for this configuration.",
"type": "string"
},
"entityType": {
"description": "Type of associated entity.",
"enum": [
"customModel",
"customModelVersion",
"playground"
],
"type": "string"
},
"timeoutAction": {
"description": "Action to take if timeout occurs",
"enum": [
"block",
"score"
],
"type": "string"
},
"timeoutSec": {
"description": "Timeout value in seconds for any guard",
"minimum": 0,
"type": "integer"
}
},
"required": [
"entityId",
"entityType",
"timeoutAction",
"timeoutSec"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| entityId |
string |
true |
|
ID of custom model or playground for this configuration. |
| entityType |
string |
true |
|
Type of associated entity. |
| timeoutAction |
string |
true |
|
Action to take if timeout occurs |
| timeoutSec |
integer |
true |
minimum: 0
|
Timeout value in seconds for any guard |
Enumerated Values
| Property |
Value |
| entityType |
[customModel, customModelVersion, playground] |
| timeoutAction |
[block, score] |
PredictionEnvironmentInUseResponse
{
"properties": {
"id": {
"description": "ID of prediction environment.",
"type": "string"
},
"name": {
"description": "Name of prediction environment.",
"type": "string"
},
"usedBy": {
"description": "Guards using this prediction environment.",
"items": {
"properties": {
"configurationId": {
"description": "ID of guard configuration.",
"type": "string"
},
"deploymentId": {
"description": "ID of guard model deployment.",
"type": "string"
},
"name": {
"description": "Name of guard configuration.",
"type": "string"
}
},
"required": [
"configurationId",
"deploymentId",
"name"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 32,
"type": "array"
}
},
"required": [
"id",
"name",
"usedBy"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| id |
string |
true |
|
ID of prediction environment. |
| name |
string |
true |
|
Name of prediction environment. |
| usedBy |
[DeploymentAndGuardResponse] |
true |
maxItems: 32
|
Guards using this prediction environment. |
SupportedLlmListResponse
{
"properties": {
"count": {
"description": "Number of items returned on this page.",
"type": "integer"
},
"data": {
"description": "List of supported LLMs for moderation.",
"items": {
"properties": {
"description": {
"description": "Description of this LLM.",
"maxLength": 1024,
"type": "string"
},
"id": {
"description": "Identifier for this LLM.",
"maxLength": 1024,
"type": "string"
},
"llmType": {
"description": "General category of this LLM.",
"maxLength": 1024,
"type": "string"
},
"model": {
"description": "Specific model of this LLM.",
"maxLength": 1024,
"type": "string"
},
"name": {
"description": "Display name of this LLM.",
"maxLength": 1024,
"type": "string"
},
"provider": {
"description": "Provider of access to this LLM.",
"maxLength": 1024,
"type": "string"
},
"vendor": {
"description": "Vendor of this LLM.",
"maxLength": 1024,
"type": "string"
}
},
"required": [
"description",
"id",
"llmType",
"model",
"name",
"provider",
"vendor"
],
"type": "object",
"x-versionadded": "v2.35"
},
"maxItems": 200,
"type": "array"
},
"next": {
"description": "URL pointing to the next page (if null, there is no next page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"previous": {
"description": "URL pointing to the previous page (if null, there is no previous page).",
"format": "uri",
"type": [
"string",
"null"
]
},
"totalCount": {
"description": "The total number of items across all pages.",
"type": "integer"
}
},
"required": [
"data",
"next",
"previous",
"totalCount"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| count |
integer |
false |
|
Number of items returned on this page. |
| data |
[SupportedLlmResponse] |
true |
maxItems: 200
|
List of supported LLMs for moderation. |
| next |
string,null(uri) |
true |
|
URL pointing to the next page (if null, there is no next page). |
| previous |
string,null(uri) |
true |
|
URL pointing to the previous page (if null, there is no previous page). |
| totalCount |
integer |
true |
|
The total number of items across all pages. |
SupportedLlmResponse
{
"properties": {
"description": {
"description": "Description of this LLM.",
"maxLength": 1024,
"type": "string"
},
"id": {
"description": "Identifier for this LLM.",
"maxLength": 1024,
"type": "string"
},
"llmType": {
"description": "General category of this LLM.",
"maxLength": 1024,
"type": "string"
},
"model": {
"description": "Specific model of this LLM.",
"maxLength": 1024,
"type": "string"
},
"name": {
"description": "Display name of this LLM.",
"maxLength": 1024,
"type": "string"
},
"provider": {
"description": "Provider of access to this LLM.",
"maxLength": 1024,
"type": "string"
},
"vendor": {
"description": "Vendor of this LLM.",
"maxLength": 1024,
"type": "string"
}
},
"required": [
"description",
"id",
"llmType",
"model",
"name",
"provider",
"vendor"
],
"type": "object",
"x-versionadded": "v2.35"
}
Properties
| Name |
Type |
Required |
Restrictions |
Description |
| description |
string |
true |
maxLength: 1024
|
Description of this LLM. |
| id |
string |
true |
maxLength: 1024
|
Identifier for this LLM. |
| llmType |
string |
true |
maxLength: 1024
|
General category of this LLM. |
| model |
string |
true |
maxLength: 1024
|
Specific model of this LLM. |
| name |
string |
true |
maxLength: 1024
|
Display name of this LLM. |
| provider |
string |
true |
maxLength: 1024
|
Provider of access to this LLM. |
| vendor |
string |
true |
maxLength: 1024
|
Vendor of this LLM. |