D1.5 · Agentic Architectures27% of CCA-F8 min read

Human-in-the-Loop Escalation.

Escalation is the deterministic handoff path when policy thresholds, low confidence, or repeated failure conditions are hit. The exam pattern: prompt-only escalation policy is wrong; the correct architecture uses hooks or hard gates.

Loading your plan…
Mental modelRelying on the system prompt to enforce an approval rule, or letting the action run and asking a person to confirm afterwards.
Human-in-the-Loop Escalation, hero illustration featuring Loop mascot in a warm gallery scene.
Share
On this page
01 · Summary

TLDR

Escalation is the deterministic handoff path when policy thresholds, low confidence, or repeated failure conditions are hit. The exam pattern: prompt-only escalation policy is wrong; the correct architecture uses hooks or hard gates.

3
Trigger types
D1
Exam domain
deterministic gate
Right answer
B
Coverage tier
prompt-only policy
Trap
02 · The decision

What you are deciding

Escalation is a control point built into the system: a defined condition stops execution before a consequential action, a named reviewer receives a complete evidence packet, and the action resumes only on their decision.

Learner decision

Which conditions require a human decision, and what stops the action until that decision arrives?

03 · Definition

What it is

An escalation is a deterministic transfer of control from an automated agent to a human operator, triggered by an explicitly defined condition. It is not a fallback when the agent gets stuck. It is not a heuristic like "escalate if uncertain". It is a Boolean check: Is this condition met? Yes: interrupt, gather facts, hand off. No: continue.

The most common triggers are policy exceptions (refund exceeds limit), permission failures (access denied), explicit customer request ("I want a human"), and ambiguous input (conflicting sources, missing required field). The agent's job is to recognize these signals, structure the handoff, and transfer decisively. A well-designed escalation takes 1-2 seconds. A poor one wastes 5 minutes of a human's time.

Escalation is a policy hook, not a prompt instruction. The agent does not decide via language like "I should escalate if the customer seems angry". The system enforces escalation via a PreToolUse hook that intercepts specific tool calls (e.g. process_refund) and checks: is this within policy? If any check fails, the hook blocks execution, constructs an escalation block, and exits the loop. Hooks execute before reasoning, guaranteeing compliance.

Escalation handoff has two phases: assembly and routing. In assembly, the harness gathers customer_id, order_id, transaction amount, policy limit, root cause, partial resolution status, and a one-sentence summary into a structured block (JSON or YAML, not prose). In routing, the block is sent to a queue (Slack, PagerDuty, email) and the agent stops. A human reads the block in 10 seconds and decides.

04 · By certification

How each certification frames it

CCA-P: How CCA-P tests human-in-the-loop validation

  • CCARP-D5-O3 Apply human-in-the-loop validation strategies

The Professional guide lists applying human-in-the-loop validation strategies in Domain 5 (PDF page 5). A strategy has five parts you can name: the trigger, the blocked action, the evidence packet, the reviewer and the resumption.

Anthropic's agent guidance describes agents that can pause for human feedback at checkpoints or when they meet blockers. Read each option for whether the pause happens before the consequential action and whether it is enforced by the system.

CCD-F: How CCD-F tests a deterministic escalation gate

  • CCDVF-D1-O2 Agent Construction with Claude: methods, tools, and platforms for constructing Claude agents, including the Claude Agent SDK, custom agent loops and harnesses, managed agent deployment models (self-hosted vs. Anthropic-hosted), and hooks for deterministic actions

The Developer guide lists hooks for deterministic actions under agent construction (PDF page 5, Domain 1). A deterministic gate is code that runs before the tool executes and decides allow, block or ask, whatever the model says.

In Claude Code, the documentation states that CLAUDE.md and memory are treated as context, not enforced configuration, and points to a PreToolUse hook for blocking an action regardless of what Claude decides. Test the gate by attempting the gated action and asserting that the tool never ran.

CCA-A: How CCA-A tests when review is required

  • CCAOF-D2-O4 Determine when human review or additional verification is required

The Associate guide lists determining when human review or additional verification is required (PDF page 4, Domain 2). Not every output needs a reviewer, so route review by consequence, uncertainty and evidence.

Send an output to a person when a wrong answer is costly or hard to undo, when the answer is uncertain, or when the supporting evidence is missing. A low-stakes draft with clear sources can be checked in passing.

05 · Mechanics

How it works

Escalation begins with trigger detection. A PreToolUse hook wraps high-stakes tool calls (process_refund, delete_record, send_communication). Before the tool executes, the hook evaluates the trigger condition: if refund_amount > policy_limit: escalate. The condition is deterministic, no fuzzy logic, no sentiment scoring. If true, execution halts and the agent does not get to argue for the exception.

Once triggered, escalation assembles the handoff block. The harness extracts and structures: customer_id, order_id, refund_amount, policy_limit, current_balance, root_cause (what the agent discovered), partial_resolution_status (what was accomplished), and recommended_action. The block is compact: 200-500 characters, readable in 10 seconds. Verbose blocks kill efficiency.

The block is routed to a queue. This is infrastructure, not agent code. Blocks land in Slack (#escalations), PagerDuty, or an email inbox. The queue includes timestamp, SLA, assignment, and a link to the full conversation. The agent stops and waits, or for batch workflows, saves the block and continues with a degraded fallback (auto-approve up to $100, escalate the rest).

Escalation success is binary: either the human resolves the case and signals back (database flag, API call), or the task is shelved. When a manager approves a $1000 refund, this approval is recorded. A subsequent retry of the agent loop checks the approval flag, and the process_refund hook sees approval_status: "manager_approved" and allows execution. Without this round-trip, the escalation is incomplete; the agent will re-attempt indefinitely.

Human-in-the-Loop Escalation mechanics, painterly diagram featuring Loop mascot.
06 · Worked example

Worked example: a refund that needs approval

Authored teaching example, not a bank question.

A support agent can propose refunds. Refunds above a limit the business sets, or on accounts with a dispute flag, must be approved by a finance reviewer.

01
Trigger. The gate checks the proposed refund against two conditions: amount above the limit, or a dispute flag on the account. Either one means escalate.
02
Blocked action. The gate runs in code before the refund tool. It refuses the call, records a pending request, and tells the agent the status is pending approval. No payment call is made.
03
Evidence packet. The reviewer receives the ticket, the order record, the policy clause relied on, the proposed amount, and the reason the case was escalated, so they can decide without reopening the whole chat.
04
Reviewer. A named finance role approves, changes or denies the request and records a reason. The decision belongs to the person, not to the model.
05
Resumption. On approval, the system executes exactly the approved amount and tells the customer. On denial, the agent receives the decision and explains it. Both outcomes are logged against the ticket.
ControlWhere it runsStops the action?
Prompt rule: ask a person firstIn the model's reasoningNo, the model can skip or misjudge it
Pre-action gate in codeBefore the tool executesYes, the call is refused
Audit log after the refundAfter executionNo, it records the harm

The refund cannot happen without an approval record, however the model words its reply. Check afterwards with a test that proposes an above-limit refund and confirms the payment tool was never called before approval.

07 · Failure modes

How this decision goes wrong

Prompt-only enforcement

Looks right: The system prompt says to get approval for large refunds, so the rule exists.

Why it fails: A prompt is guidance the model weighs. It can misread a case, be steered by injected text, or simply not apply the rule.

Instead: Enforce the condition in code before the tool runs, and keep the prompt as an explanation of why the gate exists.

Action before approval

Looks right: The agent issues the refund and then asks a person to confirm.

Why it fails: By the time the reviewer sees it, the money has moved. Review that follows the action can only report it.

Instead: Block at the boundary: the consequential call waits for a recorded approval, then runs once.

Incomplete handoff

Looks right: A message reading 'please approve refund' reaches the reviewer.

Why it fails: The reviewer must reconstruct the case, so they delay, guess or approve without checking.

Instead: Send the evidence packet with the request: facts, policy, proposed action and the reason for escalation.

08 · In production

Where you'll see it

Policy violation with PreToolUse hook

Refund request for $1200, policy max is $500. Hook checks if amount > 500: escalate. Block goes to Slack. Manager approves or denies in 5 seconds and updates database flag refund_approval: approved_1200. Agent retries; hook sees the flag, allows execution.

Ambiguous input requiring human sourcing

Three vendors claim different market shares. The agent cannot resolve. Escalation block: {conflict, sources, recommendation: "human sourcing decision"}. Without escalation, the agent would guess and silently produce inaccurate output.

Show 2 more examples

Permission failure (403 from infrastructure)

Operations agent tries restart_pod('prod-payment'). Tool returns 403 Forbidden. Harness detects error category. Escalation block routes to DevOps on-call. The on-call engineer either elevates permissions or performs the action themselves.

Explicit customer request

Customer says "I'd like to speak to a manager." Structural state-machine check: if "manager" in message: escalate_immediately. Block goes to manager queue. No agent reasoning, no multi-turn negotiation. This is policy, not judgment.

09 · Implementation

Code examples

Deterministic escalation via PreToolUse hook
from anthropic import Anthropic
import json

client = Anthropic()

def refund_hook(tool_name: str, tool_input: dict, facts: dict, policy: dict):
    """PreToolUse hook for process_refund. Returns {allow, escalate, block}."""
    if tool_name != "process_refund":
        return {"allow": True}

    amount = tool_input.get("amount", 0)
    if amount > policy["max_refund"]:
        return {
            "allow": False,
            "escalate": True,
            "block": json.dumps({
                "customer_id": facts["customer_id"],
                "order_id": facts["order_id"],
                "refund_amount": amount,
                "policy_limit": policy["max_refund"],
                "reason": f"Refund ${amount} exceeds limit ${policy['max_refund']}",
                "partial_status": "Order verified, reason confirmed",
                "recommended_action": "Manager approval required",
            }),
        }
    return {"allow": True}

# Run the agent with hook enforcement
def run_agent(msg: str, facts: dict, policy: dict):
    messages = [{"role": "user", "content": msg}]
    for turn in range(10):
        resp = client.messages.create(
            model="claude-opus-4-5", max_tokens=1024, messages=messages, tools=[...]
        )
        if resp.stop_reason == "end_turn":
            return {"status": "ok"}
        # Inspect tool_use blocks, run hook before execution
        for block in resp.content:
            if block.type == "tool_use":
                check = refund_hook(block.name, block.input, facts, policy)
                if check.get("escalate"):
                    return {"status": "escalated", "block": check["block"]}
        # ... append tool_result, continue ...
    return {"status": "max_iterations"}
Hook intercepts process_refund BEFORE execution. Deterministic check; no model judgment. Agent never reaches the tool when policy violated.
10 · Distractor patterns

Looks right, isn't

Each row pairs a plausible-looking pattern with the failure it actually creates. These are the shapes exam distractors are built from.

01Prompt the agent to escalate
× Looks right
Prompt the agent to escalate if something seems risky.
✓ What wins
Prompt-based escalation is unreliable.

The agent sees many "risky" cases and may not escalate any. Use deterministic hooks. Policy exceptions trigger hooks, not prompts.

02Wait until the agent finishes
× Looks right
Wait until the agent finishes its task, then check if it made mistakes, then escalate.
✓ What wins
Escalation must happen BEFORE tool execution (PreToolUse hook), not after.

Catching mistakes post-execution means the refund was already processed, the email was already sent. Too late.

03Escalate ambiguous cases by sending
× Looks right
Escalate ambiguous cases by sending the full conversation transcript to a human.
✓ What wins
Send a structured escalation block (200 chars, readable in 10s), not a transcript.

Humans cannot triage 20-turn conversations efficiently. Structure the facts the human needs.

04If the agent is uncertain,
× Looks right
If the agent is uncertain, have it escalate.
✓ What wins
Uncertainty is not a trigger.

Only explicit conditions trigger escalation: policy exception, permission failure, ambiguous input, explicit request. Agent confidence is orthogonal to escalation triggers.

05Once escalated, wait for the
× Looks right
Once escalated, wait for the human to respond before continuing.
✓ What wins
For user-blocking workflows (refund approval), yes, wait.

For batch workflows, save the block and continue with fallback (auto-approve up to $100, escalate the rest). Design determines the pattern.

11 · Compare

Side-by-side

↔ scroll to compare
Escalation TypeTriggerHandoff StructureHuman SLARound-trip
Policy exceptionPreToolUse hook: amount > limitcustomer_id, amount, reason, partial_status30 minYes: approval flag → agent retry
Permission failureTool error: 403task, failure_reason, alternative1-5 minNo: human performs action
Ambiguous inputAgent detects conflictconflict, sources, recommendation1-2 hoursNo: human sourcing
Explicit requestRegex on user textcustomer_id, request_context, current_stage5 minNo: transfer to queue
Missing fieldValidation: required field nullfield_name, blocking_reason, options15 minYes: collect field, retry
Compound (policy + missing field)Multiple checksAll blocking conditions listed30 minYes: resolve all, retry
12 · When to use

Decision tree

01

Is this a deterministic policy rule (amount > limit, access denied)?

YesUse a PreToolUse hook. Boolean condition. Hook blocks execution and exits agent.
NoUse ambiguity or explicit-request detection via state or text matching.
02

Can the agent proceed with a degraded fallback (auto-approve up to $X)?

YesEscalate only the overflow. Continue with fallback for the rest.
NoEscalate and halt. Wait for human decision before continuing.
03

Must the human re-enable the agent (round-trip)?

YesRecord the human decision in a database field. Agent retries; hook sees flag and allows execution.
NoHuman acts independently. Agent does not retry; task ends.
04

Is this an explicit customer request ("I want a human")?

YesImmediate escalation, no negotiation. Use keyword detection.
NoSystem rule: policy, permission, ambiguity. Use hook or structured check.
05

How long can the human take to respond?

YesSLA < 10 min (customer-blocking): async queue (Slack/email). User sees "escalated, response in ~5min".
NoSLA > 1 hour (batch): save block, continue with fallback.
13 · Exam trap

The exam trap

Relying on the system prompt to enforce an approval rule, or letting the action run and asking a person to confirm afterwards. Escalation is a control point in code: the consequential call waits for a recorded decision, and the reviewer receives a complete evidence packet rather than a bare request.

Human-in-the-Loop Escalation exam trap, painterly cautionary scene featuring Loop mascot.
14 · On the exam

Question patterns

CCA-P practice questions

2 approved CCA-P questions for this topic. Tap an answer to check it, then read the rationale for every option.

Question 1 of 2 · D1Choose the best answer

You're designing a contract-review system: intake (PDF upload) -> Claude extracts clauses -> a downstream compliance check -> a human approves or rejects the flagged clauses. Six months in, the legal team reports the model keeps making the same clause-classification mistakes even after they correct them weekly in a shared spreadsheet. What is missing from the end-to-end design?

Practice this topic with CCA-P questions

CCA-F practice questions

2 approved CCA-F questions for this topic. Tap an answer to check it, then read the rationale for every option.

Question 1 of 2 · D1Choose the best answer

Two subagents are returning conflicting reports about the same bug. How do you resolve it?

Practice this topic with CCA-F questions

CCA-A practice questions

1 approved CCA-A question for this topic. Tap an answer to check it, then read the rationale for every option.

Question 1 of 1 · D2Choose the best answer

A support team uses Claude to draft responses to billing disputes, which are sent directly to customers without review to save time. What is the risk with this setup?

Practice this topic with CCA-A questions

CCD-F practice questions

1 approved CCD-F question for this topic. Tap an answer to check it, then read the rationale for every option.

Question 1 of 1 · D1Choose the best answer

A regional utility's outage-triage agent investigates incoming outage reports using whatever diagnostic tools and sensor logs seem relevant to each case. Safety policy requires that any report mentioning a gas odor or a downed line touching water be handed to a certified dispatcher immediately, regardless of what the agent's own investigation concludes. Which design best satisfies this policy?

Practice this topic with CCD-F questions

15 · FAQ

Frequently asked

Showing 14 of 14 questions

16 · Sources

Sources and next steps

CCA-P exam guide: Domain 5, Governance, Safety & Risk Management

Help someone pass

Share this concept.

One share is one less person stuck on the same question.

Last reviewed: ·Refresh cadence: monthly