> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duckie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Escalation and Handoff

> Route unclear or high-risk tickets to human reviewers and specialist teams

The escalation agent is an autonomous internal agent deployed to Slack or another team channel. It receives structured triage questions from a workflow, posts them to reviewers, and returns a structured answer to the originating run.

Use a Duckie Assistant agent for reporting, run review, and improving Duckie behavior. Do not use a Duckie Assistant agent as the real-time escalation agent for ticket triage.

## What It Does

The escalation and handoff function:

* Sends low-confidence classification or routing questions to an internal channel
* Gives reviewers the ticket link, customer context, recommendation, and reason for escalation
* Collects reviewer decisions in thread
* Converts the reply into structured output for the workflow
* Writes a concise handoff note for the assigned team
* Records escalation reason, reviewer decision, and final route for analytics

## Recommended Components

| Need                                 | Duckie component                      |
| ------------------------------------ | ------------------------------------- |
| Human collaboration                  | Autonomous internal agent             |
| Internal channel                     | Slack integration                     |
| Structured request and response      | Workflow node or custom tool contract |
| Review routing and tagging decisions | Support triage reviewers              |
| Audit trail                          | Runs and ticket internal notes        |

## Flow

```mermaid theme={null}
sequenceDiagram
  participant Workflow as Triage workflow
  participant Agent as Slack escalation agent
  participant Reviewer as Support reviewer
  participant Ticket as Helpdesk ticket

  Workflow->>Agent: Structured triage question
  Agent->>Reviewer: Post ticket summary and recommendation
  Reviewer->>Agent: Reply with route, tags, and comments
  Agent->>Ticket: Add internal note when needed
  Agent->>Workflow: Return structured decision
  Workflow->>Ticket: Apply reviewed tags, priority, queue, or handoff
```

## When to Escalate

Escalate when:

* Classifier confidence is below the threshold
* The ticket has multiple plausible intents
* A high-value or priority customer is involved
* The customer is angry, at churn risk, or repeatedly contacting support
* The ticket may involve security, privacy, legal, or trust and safety concerns
* The recommended route would trigger an expensive or sensitive downstream workflow
* Required context is missing or conflicting
* A helpdesk writeback tool fails repeatedly

## Request Format

Each escalation should include:

* Ticket ID and source link
* Customer segment and support tier
* Short ticket summary
* Recommended intent, tags, route, and priority
* Confidence score and reason for uncertainty
* Relevant recent context
* Allowed reviewer responses

Example response contract:

```json theme={null}
{
  "decision": "approved | changes_requested | manual_review",
  "primary_intent": "bug report",
  "route": "technical support",
  "priority": "high",
  "tags": ["bug_report", "dashboard"],
  "reviewer": "name or identifier",
  "comments": "Route to technical support and ask for browser console logs."
}
```

## Specialist Handoff

The handoff should make the next team faster, not just move the ticket.

Include:

* One-sentence customer problem
* Customer context that affects handling
* Intent, product area, urgency, and route
* Missing information
* Relevant links to account, order, product event, logs, or prior tickets
* Why Duckie routed the ticket there
* Suggested next action

<Info>
  For most teams, a good handoff note is more valuable than a perfect tag. It lets specialists trust the route and continue without rereading the whole thread.
</Info>

## Related Docs

<CardGroup cols={2}>
  <Card title="Slack" icon="slack" href="/integrations/messaging/slack">
    Connect Duckie to the internal review channel.
  </Card>

  <Card title="Escalation Rules" icon="arrow-up-right-from-square" href="/guardrails/escalation-rules">
    Define when tickets should be routed to humans.
  </Card>

  <Card title="Deployment Modes" icon="toggle-on" href="/deployments/deployment-modes">
    Test escalation behavior before live use.
  </Card>

  <Card title="Runs" icon="clock-rotate-left" href="/analytics/runs">
    Inspect the escalation trail for each ticket.
  </Card>
</CardGroup>
