> ## 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 Agent

> Route human-in-the-loop decisions through an internal Slack channel

The escalation agent is an autonomous internal agent deployed to Slack or another team channel. It receives structured questions from workflows or agents, posts them to reviewers, and returns structured answers 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 this workflow.

## What It Does

The escalation agent:

* Receives approval requests, missing-context questions, or exception alerts
* Posts concise requests to an internal channel
* Keeps the original case link and deadline visible
* Collects reviewer responses
* Converts the response into structured output
* Sends the answer back to the workflow or agent that asked
* Records the escalation in the run history

## Recommended Components

| Need                            | Duckie component                      |
| ------------------------------- | ------------------------------------- |
| Human collaboration             | Autonomous internal agent             |
| Internal channel                | Slack integration                     |
| Structured request and response | Workflow node or custom tool contract |
| Approval gate                   | Human approval workflow               |
| Audit trail                     | Runs and source-system comments       |

## Flow

```mermaid theme={null}
sequenceDiagram
  participant Origin as Originating workflow
  participant Agent as Slack escalation agent
  participant Reviewer as Reviewer
  participant Case as Case system

  Origin->>Agent: Structured approval request
  Agent->>Reviewer: Post request in Slack
  Reviewer->>Agent: Reply with decision and comments
  Agent->>Case: Add internal note or status update
  Agent->>Origin: Return structured decision
  Origin->>Origin: Continue approved, change-requested, rejected, or escalated branch
```

## When to Escalate

Escalate when:

* A human must approve external submission
* The agent has low confidence
* Required evidence is missing or conflicting
* The case value exceeds a threshold
* The deadline is at risk
* A tool fails repeatedly
* A reviewer must interpret policy
* The case includes legal, regulatory, or account ownership concerns

## Request Format

Each escalation should include:

* Case ID and source link
* Deadline and urgency
* Recommended action
* Reason for escalation
* Evidence summary or message draft
* Risks and missing facts
* Allowed responses

Example response contract:

```json theme={null}
{
  "decision": "approved | changes_requested | rejected | escalate",
  "reviewer": "name or identifier",
  "comments": "short explanation",
  "required_changes": ["item 1", "item 2"]
}
```

## Deployment Guidance

Use a dedicated internal channel, such as `#dispute-review` or `#payments-ops-review`.

Start in Testing mode and route only non-production or replayed cases through the channel until reviewers confirm that the message format is useful.

<Info>
  The escalation agent should be concise. Reviewers should be able to make a decision from the Slack message without opening multiple systems unless the case is complex.
</Info>

## Related Docs

<CardGroup cols={2}>
  <Card title="Autonomous Agents" icon="wand-magic-sparkles" href="/agents/autonomous-agents">
    Configure the internal escalation agent.
  </Card>

  <Card title="Slack" icon="slack" href="/integrations/messaging/slack">
    Connect Duckie to Slack.
  </Card>

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

  <Card title="Deployment Modes" icon="toggle-on" href="/deployments/deployment-modes">
    Test human-in-the-loop flows before live use.
  </Card>
</CardGroup>
