Create policy
Create a new policy configuration
Authentication
AuthorizationBearer
Bearer authentication using API key. Generate an API key from the AI Guardrails Dashboard. Example: Bearer sk_123…
Request
This endpoint expects an object.
name
A descriptive name for the policy. Leading and trailing whitespace is stripped. Must be unique within your organization.
default_threshold
The confidence level at or above which the policy’s detectors flag content. l1_confident is the most lenient and l4_less_likely the strictest. Thresholds are inclusive — l2_very_likely flags on both l2_very_likely and l1_confident detections.
detectors
The detectors to run. Each entry pairs a detector type with the location in the conversation it screens.
custom_guardrail_ids
IDs of the custom guardrails to attach to this policy.
Response
Policy created successfully
status
Response status
message
Human-readable response message
id
Policy ID
Errors
400
Bad Request Error
403
Forbidden Error
422
Unprocessable Entity Error