Skip to main content
PUT
/
applications
/
{applicationId}
/
guardrails
Configure guardrails
curl --request PUT \
  --url https://app.trusys.ai/api/external/applications/{applicationId}/guardrails \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "enable_guard_rails": true,
  "input_validators": [
    {
      "type": "prompt-injection",
      "on_fail": "fail",
      "config": {
        "threshold": 0.8
      }
    }
  ],
  "output_validators": [
    {
      "type": "pii",
      "on_fail": "mask",
      "config": {
        "entities": [
          "EMAIL_ADDRESS"
        ],
        "threshold": 0.5
      }
    }
  ]
}
'
{
  "success": true,
  "data": {
    "enable_guard_rails": true,
    "input_validators": [
      {
        "type": "prompt-injection",
        "on_fail": "fail",
        "config": {
          "threshold": 0.8
        }
      }
    ],
    "output_validators": [
      {
        "type": "prompt-injection",
        "on_fail": "fail",
        "config": {
          "threshold": 0.8
        }
      }
    ]
  }
}

Authorizations

x-api-key
string
header
required

Your Trusys API key. Create and manage keys in the Trusys UI under Settings → API Keys.

Include the key on every request:

x-api-key: <your-api-key>

Path Parameters

applicationId
string<uuid>
required

Unique identifier (UUID) of the application. Returned by POST /applications.

Body

application/json

Guardrails toggle and validator lists.

enable_guard_rails
boolean
required

Master switch for guardrails on this application.

input_validators
object[]

Validators applied to user/model input. Each item is an object with type, on_fail, and optional config.

output_validators
object[]

Validators applied to model output. Each item is an object with type, on_fail, and optional config.

Response

Guardrails configuration saved.

success
boolean
data
object

Guardrails validators applied to application input and output.