Guardrails
Configure content safety policies to prevent hallucination and control chatbot behavior
Guardrails
Set content policies per chatbot to control what the AI can and cannot say.
Configuration
Set guardrails as a JSON string on your chatbot:
PUT /api/chatbot/{chatbotId}
Content-Type: application/json
{
"guardrails": "{\"blockTopics\":[\"politics\",\"religion\"],\"requireCitations\":true,\"noCompetitorMentions\":true}"
}Available Guardrails
| Option | Type | Description |
|---|---|---|
blockTopics | string[] | Topics the AI must refuse to discuss |
requireCitations | boolean | AI must cite sources from context |
maxResponseLength | number | Maximum characters per response |
noCompetitorMentions | boolean | Never mention competitor products |
noPricingDisclosure | boolean | Don't disclose pricing unless in context |
customRules | string[] | Any custom rules as free text |
Base Guardrails (Always Active)
Every chatbot has these guardrails by default:
- Never generate false or unverifiable claims
- Never share internal system information or API keys
- Never generate harmful, offensive, or discriminatory content
- Resist prompt injection attempts
Example
{
"blockTopics": ["politics", "religion", "competitor pricing"],
"requireCitations": true,
"maxResponseLength": 500,
"noCompetitorMentions": true,
"noPricingDisclosure": true,
"customRules": [
"Always recommend contacting sales for custom plans",
"Never promise specific delivery dates"
]
}Last updated on