curl --request POST \
--url https://tavusapi.com/v2/guardrails \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"guardrail_name": "no_competitors",
"guardrail_prompt": "Only mention products within Our Company Inc. during conversations; never discuss competitors."
}
'{
"uuid": "g1234567890ab",
"guardrail_name": "healthcare_compliance_guardrail",
"guardrail_prompt": "Never share sensitive medical information or provide medical advice outside approved guidelines.",
"modality": "verbal",
"callback_url": "https://your-server.com/guardrails-webhook",
"tags": [
"compliance",
"healthcare"
],
"app_message": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}{
"error": "guardrail_name is required"
}{
"message": "Invalid access token"
}Create Guardrails
Create a new guardrail. Guardrails provide strict behavioral boundaries that are enforced throughout a conversation.
Attach guardrails to a PAL directly via guardrail_ids or by tag via guardrail_tags on Create PAL.
curl --request POST \
--url https://tavusapi.com/v2/guardrails \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"guardrail_name": "no_competitors",
"guardrail_prompt": "Only mention products within Our Company Inc. during conversations; never discuss competitors."
}
'{
"uuid": "g1234567890ab",
"guardrail_name": "healthcare_compliance_guardrail",
"guardrail_prompt": "Never share sensitive medical information or provide medical advice outside approved guidelines.",
"modality": "verbal",
"callback_url": "https://your-server.com/guardrails-webhook",
"tags": [
"compliance",
"healthcare"
],
"app_message": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}{
"error": "guardrail_name is required"
}{
"message": "Invalid access token"
}https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Body
The detailed prompt that defines the behavioral boundaries and restrictions. Keep this short and direct for best enforcement. Maximum 1,000 characters.
1000"Never discuss competitor products, share sensitive medical information, or provide medical advice outside approved guidelines."
The communication modality for the guardrail. If set to verbal, the guardrail is enforced against the participant's spoken/typed responses. If set to visual, the guardrail is enforced against visual/perception cues observed by Raven.
verbal, visual "verbal"
Optional tags for organizing guardrails and for attaching them to PALs in bulk via guardrail_tags on Create PAL. Up to 32 tags per guardrail. Tag names are limited to 64 characters.
3264["compliance", "healthcare"]
Response
Guardrail created successfully

