Skip to main content
GET
/
guardrails
/
get-guardrail
Get Guardrail
curl --request GET \
  --url https://api.enkryptai.com/guardrails/get-guardrail \
  --header 'X-Enkrypt-Guardrail: <x-enkrypt-guardrail>' \
  --header 'apikey: <api-key>'
{
  "name": "My Guardrail",
  "description": "Guardrail for production chatbot",
  "input": {
    "topic_detector": {
      "enabled": true,
      "topic": [
        "<string>"
      ],
      "block_message": "<string>"
    },
    "nsfw": {
      "enabled": true,
      "block_message": "<string>"
    },
    "toxicity": {
      "enabled": true,
      "block_message": "<string>"
    },
    "pii": {
      "enabled": true,
      "entities": [
        "pii"
      ]
    },
    "injection_attack": {
      "enabled": true,
      "block_message": "<string>"
    },
    "keyword_detector": {
      "enabled": true,
      "banned_keywords": [
        "<string>"
      ]
    },
    "system_prompt": {
      "enabled": false,
      "index": "system",
      "block_message": "<string>"
    },
    "copyright_ip": {
      "enabled": false,
      "block_message": "<string>"
    },
    "policy_violation": {
      "enabled": true,
      "policy_text": "<string>",
      "coc_policy_name": "<string>",
      "need_explanation": true,
      "block_message": "<string>"
    },
    "bias": {
      "enabled": true
    },
    "sponge_attack": {
      "enabled": false,
      "block_message": "<string>"
    }
  },
  "output": {
    "topic_detector": {
      "enabled": true,
      "topic": [
        "<string>"
      ],
      "block_message": "<string>"
    },
    "nsfw": {
      "enabled": true,
      "block_message": "<string>"
    },
    "toxicity": {
      "enabled": true,
      "block_message": "<string>"
    },
    "pii": {
      "enabled": true,
      "entities": [
        "pii"
      ]
    },
    "injection_attack": {
      "enabled": true,
      "block_message": "<string>"
    },
    "keyword_detector": {
      "enabled": true,
      "banned_keywords": [
        "<string>"
      ]
    },
    "system_prompt": {
      "enabled": false,
      "index": "system",
      "block_message": "<string>"
    },
    "copyright_ip": {
      "enabled": false,
      "block_message": "<string>"
    },
    "policy_violation": {
      "enabled": true,
      "policy_text": "<string>",
      "coc_policy_name": "<string>",
      "need_explanation": true,
      "block_message": "<string>"
    },
    "bias": {
      "enabled": true
    },
    "sponge_attack": {
      "enabled": false,
      "block_message": "<string>"
    }
  },
  "created_at": "2025-03-01T11:23:03.695943+00:00",
  "updated_at": "2025-03-01T11:23:03.695943+00:00",
  "policy_id": 1234567890,
  "project_name": "default",
  "created_by": "user@example.com",
  "updated_by": "user@example.com",
  "is_sample": false
}

Authorizations

apikey
string
header
required

Headers

X-Enkrypt-Guardrail
string
required

The guardrail name

Example:

"My Guardrail"

X-Enkrypt-Refresh-Cache
boolean

Refresh the cache if data is stale

Example:

false

Response

200 - application/json

Successful Response

name
string
required

The guardrail name

Example:

"My Guardrail"

description
string

Optional description of the guardrail

Example:

"Guardrail for production chatbot"

input
GuardrailsDetectorsObject ยท object

Detector configuration applied to input/prompt text

output
GuardrailsDetectorsObject ยท object

Detector configuration applied to output/response text

created_at
string
Example:

"2025-03-01T11:23:03.695943+00:00"

updated_at
string
Example:

"2025-03-01T11:23:03.695943+00:00"

policy_id
integer
Example:

1234567890

project_name
string
Example:

"default"

created_by
string
Example:

"user@example.com"

updated_by
string
Example:

"user@example.com"

is_sample
boolean
Example:

false