Skip to main content
Escalation rules define conditions under which your agent should stop and hand off the conversation to a human agent.

What are Escalation Rules?

Escalation rules identify situations where human judgment is needed:
  • Customer is upset or threatening
  • Question involves legal, compliance, or security
  • Issue is too complex for automation
  • Customer explicitly requests a human
  • VIP or high-value customer needs attention

Creating Escalation Rules

1

Navigate to Guardrails

Go to Train → Guardrails and select the Escalation Rules tab.
2

Click Create Rule

Click Create Escalation Rule.
3

Name Your Rule

Give it a descriptive name:
  • Good: “Angry Customer Escalation”, “Legal Question Detection”
  • Avoid: “Rule 1”, “Escalation”
4

Define Trigger

Configure what causes this rule to trigger.
5

Configure Response

Define what happens when triggered:
  • Message to send to customer
  • Internal note content
  • Routing rules
6

Test

Use the built-in playground to verify detection.
7

Save

Save and activate the rule.

Detection Methods

AI-Based Detection

Use natural language to describe when to escalate: Example prompts:
Escalate when the customer expresses significant frustration 
or anger about the service, especially if they mention:
- Wanting to cancel their account
- Threatening negative reviews
- Repeated issues without resolution
- Being a long-time customer who is disappointed
Escalate when the conversation involves legal topics including:
- Contract terms or disputes
- Liability questions
- Threats of legal action
- Requests for legal documentation
Strengths:
  • Handles nuanced situations
  • Adapts to context
  • No need to predict every phrase

Keyword Detection

Trigger on specific words or phrases: Example keywords:
cancel, cancellation, lawsuit, lawyer, attorney, 
speak to human, talk to person, manager, supervisor,
unacceptable, furious, terrible service, worst experience
Strengths:
  • Fast and predictable
  • Easy to understand and audit
  • Good for specific trigger words

Regex Detection

Match complex patterns: Example patterns:
# Phone numbers
\b\d{3}[-.]?\d{3}[-.]?\d{4}\b

# Credit card numbers (trigger for security)
\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b

# Email addresses in specific domains
\b[\w.-]+@competitor\.com\b
Strengths:
  • Precise pattern matching
  • Good for structured data
  • Catches variations

Combining Methods

Use multiple detection methods together:
Trigger escalation when:
- AI detects customer frustration AND
- (Keywords include "cancel" OR "refund") AND
- Conversation is longer than 5 messages

Configuring Escalation Response

Customer Message

What the agent sends to the customer when escalating: Example:
I understand this is important to you, and I want to make sure 
you get the best help possible. I'm connecting you with a 
member of our team who can assist you directly.

You can expect to hear from them within [timeframe]. 
Thank you for your patience!

Internal Note

Context for the human agent:
## Escalation Summary

**Reason:** Customer expressed frustration about repeated billing issues

**Context:**
- Customer has contacted support 3 times about this issue
- Previous resolutions did not work
- Customer mentioned considering cancellation

**Conversation Summary:**
[Auto-generated summary]

**Recommended Action:**
Review billing history and consider goodwill gesture

Routing (if applicable)

Where to route the escalated conversation:
  • Specific team or queue
  • Priority level
  • Assignment rules

Example Escalation Rules

Angry Customer

SettingValue
NameAngry Customer Escalation
DetectionAI-based
PromptEscalate when customer expresses significant frustration, anger, or threatens to leave
Message”I can see this has been frustrating. Let me connect you with someone who can help resolve this.”
SettingValue
NameLegal Question Detection
DetectionKeyword + AI
Keywordslawyer, attorney, lawsuit, legal, contract dispute
PromptEscalate questions about legal matters, liability, or contract terms
Message”For legal matters, I’ll connect you with someone who can properly assist.”

VIP Customer

SettingValue
NameVIP Customer Handling
DetectionAttribute-based
ConditionCustomer tier = “Enterprise”
Message”Thank you for being a valued customer. I’m connecting you with your dedicated support contact.”

Human Request

SettingValue
NameExplicit Human Request
DetectionKeyword
Keywordsspeak to human, talk to person, real person, human agent, live agent
Message”Of course! I’m connecting you with a member of our team now.”

Testing Escalation Rules

Use the built-in playground:
  1. Open the escalation rule
  2. Enter test messages
  3. See if the rule triggers
  4. Adjust detection criteria as needed
Test scenarios to try:
  • Messages that should clearly trigger
  • Messages that should clearly not trigger
  • Edge cases and borderline situations

Assigning to Agents

1

Open Agent Configuration

Go to Build → Agents and click on an agent.
2

Go to Guardrails Tab

Select the Guardrails tab.
3

Select Escalation Rules

Check the rules that should apply to this agent.
4

Save

Save the agent configuration.

Best Practices

  • Test thoroughly before activating
  • Start broader, then refine — better to escalate too much initially
  • Review regularly — analyze which rules trigger most
  • Balance sensitivity — too sensitive = too many escalations
  • Provide context — good internal notes help human agents

Next Steps