Skip to navigation

Create guardrail policy

View as Markdown
Create a guardrail policy with its rules in a workspace

Request

This endpoint expects an object.
namestringRequired0-255 characters
The SDK names policies by name, so it is unique in the workspace, ignoring case
ruleslist of objectsRequired
At most one rule per type
idstringOptionalformat: "uuid"
Optional on create, generated when missing, as for prompts and datasets. Ignored on update, where the path names the policy
descriptionstringOptional0-1000 characters
execution_scopeenumOptionalDefaults to on_request

on_request applies the policy when the SDK names it, global applies it to every guardrail built from stored policies in the workspace. Missing or null means on_request

Allowed values:

Response headers

Locationstring

Response

Created

Errors

400
Bad Request Error
403
Forbidden Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error
503
Service Unavailable Error