It is highly recommended to use the Persona Builder to create your guardrails, although you can use the Create Guardrails API directly.
- Be specific about what topics, behaviors, or responses should be restricted or avoided.
- Consider edge cases where participants might try to circumvent the guardrails through creative prompting.
- Ensure your guardrails complement, rather than contradict, your persona’s system prompt and intended functionality.
- Test your guardrails with various conversation scenarios to ensure they activate appropriately without being overly restrictive.
- Add them during persona creation like this:
- Add them by editing the persona like this:
For the best results, try creating specific guardrails for different types of personas or conversation contexts.For example, a healthcare consultation might use guardrails to maintain medical compliance, while an educational tutor might use guardrails to enforce child safety and appropriate content guidelines.
Parameters
Within each set of guardrails, you can have multiple guardrail objects defined.
guardrails_name
A desciptive name for an individual guardrail.
Example: "Never Discuss Competitor's Products"
This must be a string value without spaces.
guardrails_prompt
A text prompt that explains what particular behavior(s) should be observed for a particular guardrail. The more detail you can provide, the better.
Example: "Only mention products within Our Company Inc. during conversations, and never discuss competitors' products."
modality
This value represents whether a specific guardrail should be enforced based on the participant’s verbal or visual responses. Each individual guardrail can be visual or verbal (not both), but this can vary across the same set of guardrails.
The default value for
modality
is "verbal"
.callback_url
(optional)
A URL that you can send notifications to when a particular guardrail has been triggered.
Example: "https://your-server.com/guardrails-webhook"