Skip to main content
POST
Create a new Guardrail

Authorizations

x-api-key
string
header
required

Body

application/json
name
string
required

Human-readable label. Also used to derive the permanent key used at runtime (lowercased, punctuation replaced with underscores, deduplicated with a numeric suffix on collision).

Example:

"Hate Speech Filter"

prompt
string
required

The rule text the agent's LLM evaluates a user's message against to decide whether this guardrail applies.

Example:

"Trigger when the user uses hateful, discriminatory, or abusive language toward a person or group."

category
string

Free-text tag for grouping guardrails. No fixed list - any string is accepted, including an empty one.

Example:

"Content Safety"

response_message
string

Spoken to the user verbatim when this guardrail fires. If omitted, the guardrail falls back to a moderation-endpoint check instead of a canned response.

Example:

"I'm sorry, but I can't help with that. Let's keep things respectful."

callback_url
string<uri>

Where a guardrail_triggered event is POSTed when this guardrail fires. Must be a well-formed http(s):// URL if present. Delivery is fire-and-forget - no retries.

Example:

"https://yourapp.com/webhooks/guardrail"

is_active
boolean
default:true

Set to false to exclude this guardrail from live conversations without deleting it.

Response

Guardrail created successfully

id
string<uuid>
required
Example:

"dfbaa3c6-1e90-43df-869a-b023896a198c"

message
string
required
Example:

"Guardrail created"