Custom Agents

Escalations & Routing

Handle complex issues by routing them to the right team.

Escalations & Routing

Not every email can be handled by an AI agent. Complex issues, angry customers, or requests outside the agent's scope need human attention. Escalations let you route these cases to the right team member.

When to Escalate

Your agent should escalate when:

  • Unclear Intent: The email doesn't match any known category
  • Angry Customer: Sentiment analysis detects frustration or anger
  • Complex Request: The issue requires human judgment
  • Out of Scope: The request is outside the agent's defined responsibilities
  • Escalation Keyword: The customer explicitly asks to speak with a human

Setting Up Escalation Rules

Step 1: Define Escalation Triggers

In your agent's settings, go to Escalation Rules and define when to escalate:

Sentiment-Based

  • Escalate if sentiment score is below -0.7 (very negative)
  • Escalate if the email contains words like "angry," "frustrated," "unacceptable"

Keyword-Based

  • Escalate if email contains: "speak to a human," "manager," "complaint"
  • Escalate if subject contains: "URGENT," "CRITICAL," "COMPLAINT"

Category-Based

  • Escalate if the email doesn't match any known category
  • Escalate if confidence score is below 60%

Step 2: Choose Escalation Action

Decide what happens when an escalation is triggered:

Route to Email

Send the email to a specific inbox:

  • support@company.com
  • escalations@company.com
  • urgent@company.com

Route to Slack

Send a notification to a Slack channel:

  • #support-escalations
  • #urgent-issues
  • #customer-complaints

Route to Webhook

Send the escalation to your own system via webhook for custom handling.

Step 3: Add Context

Include context in the escalation:

Escalate if:
- [Condition 1]
- [Condition 2]
- [Condition 3]

Types of Rules

Keyword-based:

Escalate if the email mentions: refund, lawsuit, legal, complaint, angry, urgent

Sentiment-based:

Escalate if the customer seems very angry, frustrated, or threatening

Domain-based:

Escalate if the question is about pricing, contracts, custom solutions, or integrations

Priority-based:

Escalate if the sender is a VIP customer, enterprise client, or repeat escalator

Combination:

Escalate if:
- Customer mentions refund AND amount is over $500
- Email is from a VIP client
- Issue requires technical/engineering knowledge
- Customer has escalated before on this topic

Real-World Examples

Customer Support Agent

Good escalation rules:

Escalate if:
- Customer mentions refund, chargeback, or legal action
- Customer is very angry or threatening
- Issue requires technical/engineering knowledge
- Customer has contacted us 3+ times about the same issue
- Request is for a feature we don't have
- Customer mentions competitor or switching

Why these work:

  • Specific keywords (refund, legal, chargeback)
  • Sentiment detection (angry, threatening)
  • Domain-specific (technical issues)
  • Pattern recognition (repeat contacts)
  • Business logic (feature requests)

Sales Agent

Good escalation rules:

Escalate if:
- Prospect asks for custom pricing or enterprise terms
- Prospect mentions a competitor
- Deal size is over $50,000
- Prospect asks about integrations we don't support
- Prospect is from a Fortune 500 company
- Prospect mentions legal/contract concerns

Why these work:

  • High-value deals need human touch
  • Competitor mentions need strategy
  • Enterprise deals need special handling
  • Legal issues need legal review
  • Custom requests need sales expertise

Operations Agent

Good escalation rules:

Escalate if:
- Request involves data deletion or privacy
- Request is from a customer with pending issues
- Request requires manager approval
- Request involves refunds or credits
- Request mentions compliance or regulations

Best Practices

1. Start Broad, Then Narrow

Week 1: Escalate everything while you learn

Escalate if: anything seems unusual or important

Week 2: Escalate specific categories

Escalate if: customer is angry OR mentions refund OR issue is technical

Week 3+: Fine-tune based on patterns

Escalate if: [specific, tested rules]

2. Be Specific, Not Vague

Too vague:

Escalate if customer seems confused
Escalate if issue is important
Escalate if something seems wrong

Specific:

Escalate if customer asks about features we don't have
Escalate if customer mentions refund or legal action
Escalate if issue requires technical expertise

3. Avoid Over-Escalation

Target escalation rate: 5-15%

  • >30% escalation: Agent isn't trained well enough. Update instructions.
  • <5% escalation: You might be missing important issues. Broaden rules.

How to reduce escalations:

  • Improve agent instructions
  • Add examples to instructions
  • Enable more tools
  • Provide knowledge base documents
  • Adjust escalation rules

4. Monitor and Adjust

Review escalations weekly:

Questions to ask:

  • Were these actually complex?
  • Could the agent handle them with better training?
  • Are there patterns?
  • Should I update instructions?
  • Should I adjust rules?

Example workflow:

  1. Review 10 escalated emails
  2. Find patterns (e.g., "3 were about pricing")
  3. Update instructions to handle pricing better
  4. Adjust escalation rules
  5. Test with new emails

5. Provide Feedback

When you respond to an escalated email:

  • The agent learns from your response
  • Use it to improve instructions
  • Share patterns with your team
  • Document what works

Escalation Examples

Example 1: Refund Request

Email: "I want a refund. This product is terrible."

Agent thinks: "Customer is unhappy. Should I escalate?"

Your rule: "Escalate if customer mentions refund"

Result: ✅ Escalated (correct)

Your response: "I'm sorry you're unhappy. Let me help. Can you tell me what's not working?"

Agent learns: Refund requests need human touch


Example 2: Technical Issue

Email: "The API keeps returning 500 errors. I can't integrate your service."

Agent thinks: "This is technical. Should I escalate?"

Your rule: "Escalate if issue requires technical/engineering knowledge"

Result: ✅ Escalated (correct)

Your response: "I'm escalating to our engineering team. They'll reach out within 2 hours."

Agent learns: Technical issues need engineering


Example 3: Simple Question

Email: "What's your pricing?"

Agent thinks: "Should I escalate?"

Your rule: "Escalate if customer mentions refund, legal, or technical issues"

Result: ✅ NOT escalated (correct)

Agent response: "Our pricing starts at $29/month. Here's a comparison of plans..."

Agent learns: Pricing questions don't need escalation

Monitoring Escalations

In the Dashboard

  1. Go to Escalations tab
  2. See all flagged emails
  3. Review and respond
  4. Track patterns

Metrics to Track

  • Escalation rate: % of emails escalated
  • Response time: How long to respond to escalations
  • Resolution rate: % resolved without further escalation
  • Patterns: Common reasons for escalation

Weekly Review

Set aside 15 minutes each week to:

  1. Review escalated emails
  2. Look for patterns
  3. Update instructions if needed
  4. Adjust rules if needed
  5. Share insights with team

Common Mistakes

Too many escalations

  • Rule is too broad
  • Agent instructions are unclear
  • Agent needs better training
  • Solution: Narrow rules, improve instructions

Too few escalations

  • Rules are too strict
  • Missing important issues
  • Risk of bad customer experience
  • Solution: Broaden rules, add more conditions

Vague rules

  • "Escalate if seems important"
  • "Escalate if customer is unhappy"
  • Agent doesn't know what to do
  • Solution: Be specific with keywords and conditions

Never reviewing escalations

  • Can't improve the agent
  • Miss patterns
  • Escalations pile up
  • Solution: Review weekly, adjust rules

Next Steps

Advanced: Custom Escalation Logic

For complex routing, use our webhook API:

POST /v1/webhooks/escalations
{
  "agent_id": "agent_123",
  "email_id": "email_456",
  "reason": "angry_customer",
  "sentiment_score": -0.85,
  "suggested_action": "route_to_manager"
}

Your system can then decide:

  • Which team member to route to
  • What priority level to assign
  • Whether to auto-reply with a timeline

Next Steps