D1 · Agentic Architecture › Cluster 6 · Reliability

6.5 · Escalation to Human

The top rung — hand off when retry and fallback aren't enough

CONCEPT Rung 3: escalate

Escalation is the top of the recovery ladder: retry (transient) → fallback (degraded path) → escalate (human). It's not a failure of the design — for some situations, routing to a human is the correct outcome. The architect decides which conditions trip an escalation.

TriggerExampleWhy a human
Repeated failureRetry exhausted and every fallback failedThe system genuinely can't complete it safely
Low confidenceAmbiguous request, conflicting sources, model unsureGuessing risks a wrong, costly action
PolicyPayments, refunds over a limit, legal/medical, account deletionGovernance requires human sign-off regardless of confidence
🔑 Policy escalation is unconditional — it fires even when the agent is highly confident. "Issue a refund over $500" should route to a human by rule, not because the model felt unsure.

DIAGRAM The recovery ladder, ending in escalation

flowchart TD F([Step fails / risky action]) --> R{"Transient?"} R -->|Yes| RT["🟢 Retry w/ backoff (6.3)"] RT -->|recovered| DONE["Continue"] RT -->|exhausted| FB{"Fallback available
& allowed?"} R -->|No| FB FB -->|Yes| FBK["🔵 Fallback / degrade (6.4)"] FB -->|No| ESC FBK -->|still fails| ESC["🟣 Escalate to human"] P([Policy-gated action]) -.unconditional.-> ESC LC([Low confidence]) -.-> ESC ESC --> TOOL["create_escalation tool
→ ticket / human queue"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef fb fill:#d1ecf1,stroke:#17a2b8,color:#0c5460; classDef es fill:#e2d4f0,stroke:#764ba2,color:#3d1a5b; class RT ok; class FBK fb; class ESC,TOOL es;

CODE A create_escalation tool

Model escalation as a first-class tool. Claude can choose to call it when it's stuck or unsure, and your code can force it for policy-gated actions.

# Give the agent an explicit escape hatch.
create_escalation = {
    "name": "create_escalation",
    "description": "Hand off to a human when the task can't be completed "
                   "safely: repeated failure, low confidence, or policy.",
    "input_schema": {
        "type": "object",
        "properties": {
            "reason": {"type": "string",
                       "enum": ["repeated_failure", "low_confidence", "policy"]},
            "summary": {"type": "string"},
            "context": {"type": "string"},   # pass state so the human isn't blind
        },
        "required": ["reason", "summary"],
    },
}

def handle_escalation(args):
    ticket = human_queue.enqueue(reason=args["reason"],
                                 summary=args["summary"],
                                 context=args.get("context", ""))
    return f"Escalated to a human. Ticket {ticket.id}. Awaiting review."

# POLICY gate: force escalation regardless of the model's confidence.
def before_action(action):
    if action.type == "refund" and action.amount > 500:
        return handle_escalation({"reason": "policy",
                                  "summary": f"Refund ${action.amount} needs approval"})
    return execute(action)
Always attach context to the escalation. The stateless API means the human reviewer, like a sub-agent, only sees what you forward — give them the summary and relevant state so they can act.

TRADE-OFFS Where to set the escalation bar

✅ Escalate readily

  • Fewer wrong autonomous actions on high-stakes work
  • Builds trust; clear audit trail of human decisions

⚠️ Escalate too often

  • Human queue becomes a bottleneck; latency spikes
  • Defeats the point of automation for routine cases
  • Alert fatigue — reviewers rubber-stamp

EXAM TRAPS

Trap: Escalating only on error. → Escalation also fires on low confidence and on policy even when the agent succeeds confidently (payments, legal). It's not just an error handler.
Trap: Escalating without context. → The reviewer inherits the stateless problem; forward a summary + relevant state or the human can't act.
Trap: Jumping straight to escalation. → It's the top rung. Try retry then fallback first (unless a policy gate forces an immediate human hand-off).

PRACTICE

Q1 · A refund agent is highly confident it should refund $900. Should it just do it?

No. A policy gate forces escalation for refunds over the limit regardless of confidence. Route it to a human for approval; confidence doesn't override governance.

Q2 · Order of the recovery ladder, and where does escalation sit?

Retry → fallback → escalate. Escalation is the top rung, for repeated failure, low confidence, or policy. Take cheaper/local actions first; escalate when they don't (or mustn't) apply.

Q3 · Why expose escalation as a tool the model can call, rather than only triggering it in code?

So the model can escalate on low confidence / ambiguity it detects mid-task — cases your code can't pre-enumerate. Code still forces escalation for policy gates; the two are complementary.