Skip to main content

Guardrails

Guardrails are instructions that prevent your agent from answering questions or taking actions outside its defined scope. Without them, agents can go off-topic, make up information, or say things that damage your brand.

Why Guardrails Matter

A dental receptionist agent should book appointments — not give medical advice. A sales agent should qualify leads — not discuss competitor pricing. Guardrails enforce these boundaries.

Built-In Guardrail Settings

In Agent Studio → Guardrails, you can enable:
SettingWhat it does
Topic RestrictionList topics the agent should refuse to discuss
No Hallucination ModeAgent says “I don’t know” instead of making up facts
Profanity FilterAuto-censors inappropriate language
PII RestrictionPrevents agent from repeating sensitive data (card numbers, passwords)
Max Call DurationEnd the call after N minutes to prevent runaway conversations

Prompt-Level Guardrails

The most powerful guardrails are written directly into your agent’s system prompt:
You are a receptionist for Sharma Dental Clinic.

STRICT RULES:
1. Only discuss topics related to appointments, clinic hours, and general dentistry FAQs.
2. Never provide medical diagnoses or treatment advice.
3. If asked about competitor clinics, politely redirect: "I can only help with Sharma Dental."
4. If the caller becomes abusive or aggressive, say: "I'll need to transfer you to our team" and trigger a transfer.
5. Never confirm or repeat payment card numbers, even if the caller provides them.
6. If you don't know the answer, say: "Let me connect you with our team who can help with that."

Handling Off-Topic Requests

Use this pattern in your prompt to gracefully deflect:
When asked about anything outside your scope:
- Acknowledge the question politely
- Explain what you can help with
- Offer to transfer to a human if needed

Example: "That's a great question, but I'm specifically here to help with appointments at Sharma Dental. 
Can I help you book or reschedule a visit? If you have other questions, I can transfer you to our team."

Warm Transfer as a Guardrail

One of the most effective guardrails is configuring a warm transfer — when the agent hits the edge of its knowledge, it hands off to a human instead of guessing. See Warm Transfer for setup instructions.

Testing Your Guardrails

After configuring guardrails, test them in Agent Studio:
  1. Try asking the agent off-topic questions
  2. Try asking it to do something it shouldn’t (e.g., “What’s the CEO’s home address?”)
  3. Try being rude or aggressive
  4. Verify it stays on-script and deflects cleanly
Add a section in your prompt called “WHAT TO DO WHEN YOU DON’T KNOW” — agents with explicit fallback instructions perform significantly better than those relying on implicit reasoning.