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
Configure guardrails in the dashboard under your chatbot's AI settings, or set them as a JSON string via the dashboard API:
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 | Asks the AI to keep responses under N characters (advisory — instructs the model, does not truncate) |
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