Create Guardrails
Create a new guardrail. Guardrails provide strict behavioral boundaries that are enforced throughout a conversation.
Attach guardrails to a persona directly via guardrail_ids or by tag via guardrail_tags on Create Persona.
Documentation Index
Fetch the complete documentation index at: https://docs.tavus.io/llms.txt
Use this file to discover all available pages before exploring further.
https://docs.tavus.io/openapi.yaml for the full HTTP API contract.Authorizations
Body
A descriptive name for the guardrail. Only alphanumeric characters and underscores are allowed. Maximum 100 characters.
100"healthcare_compliance_guardrail"
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 URL that will receive a notification when the guardrail is triggered during a conversation. Maximum 2,048 characters.
2048"https://your-server.com/guardrails-webhook"
Optional tags for organizing guardrails and for attaching them to personas in bulk via guardrail_tags on Create Persona. Up to 32 tags per guardrail. Tag names are limited to 64 characters.
3264["compliance", "healthcare"]Whether triggering this guardrail emits a real-time app-message event on the conversation. Default true. Set to false to suppress the in-conversation event for guardrails you only want to observe server-side via callback_url.
true
Response
Guardrail created successfully
Unique identifier for the created guardrail. Use this value in guardrail_ids on a persona.
"g1234567890ab"
"healthcare_compliance_guardrail"
"Never share sensitive medical information or provide medical advice outside approved guidelines."
verbal, visual "verbal"
"https://your-server.com/guardrails-webhook"
["compliance", "healthcare"]Whether triggering this guardrail emits a real-time app-message event on the conversation.
true
"2024-01-15T10:30:00Z"
"2024-01-15T10:30:00Z"

