# Implement multi-step workflows with enforcement and handoff patterns

Enforce prerequisites before actions and hand off unresolved decisions with precise evidence.
Learn to place trusted checks at the action boundary and keep separate customer concerns visible throughout a workflow. A refund example distinguishes a confirmed duplicate charge, an unknown cause, a requested amount, and a handoff that still requires submission.

Author: LearningPathX Editorial Team
Content version: 1.0
Published: 2026-12-04T00:32:24.780329+00:00
HTML: https://learningpathx.com/material/CCAR-F/implement-multi-step-workflows-with-enforcement-and-handoff-patterns.html

Knowledge domain: Agentic Architecture & Orchestration
Tags: Workflow Design / Escalation / Action Authorization / Tool Hooks

## Implement multi-step workflows with enforcement and handoff patterns

## Learning objectives

By the end of this topic, you should be able to:

* Distinguish an instruction to follow a sequence from a gate that enforces its prerequisites.
* Place checks before consequential operations and preserve their evidence.
* Investigate multiple concerns without losing shared context or merging incompatible outcomes.
* Produce a human handoff containing facts, uncertainties and a specific decision request.

## Guidance and enforcement solve different problems

A prompt can explain that customer identity must be verified before a refund. It cannot, by itself, prevent every unauthorized call. A reliable operation places the prerequisite in the trusted execution path: the downstream tool checks authoritative state before it accepts the request. In the supplied material, CLAUDE.md provides persistent coding standards, architectural guidance and preferences, while a SKILL.md file defines a skill with YAML frontmatter and Markdown content. These files guide behavior; neither file alone enforces the prerequisite at runtime.

A pre-action hook can be part of that control path when the harness supports blocking the relevant operation. Its guarantee is limited to the operations it actually intercepts, the correctness of its check, its failure policy and any permitted bypass. A model-based hook can help inspect evidence, but using a hook does not make the model's factual judgment deterministic.

Choose a check appropriate to the requirement. A schema validates structure. A customer lookup establishes available account facts. An authorization decision establishes whether this actor may perform this operation. None substitutes for the others. A well-formed request for the wrong customer is still wrong.

## Put prerequisites at the actual action boundary

Represent prerequisites as explicit state: verified customer identifier, applicable policy version, permitted operation and any required approval. Bind the evidence to the current request rather than relying on an old message saying verification occurred.

Before a downstream write, confirm that the required record exists, is applicable and matches the target. Failure or absence must leave the operation blocked. The model should not be able to create its own authority by supplying `verified: true` in a proposed argument.

A code-managed sequence can retrieve prerequisites, evaluate conditions and then call the authorized operation. Programmatic tool calling can reduce unnecessary model round-trips when intermediate results can be filtered and evaluated in code. It is less useful when every next step requires fresh semantic judgment. Trusted server checks remain necessary even if the model writes a plausible orchestration script.

Consider repeated and concurrent requests too. A prerequisite may change before an action runs, and retrying an uncertain write may duplicate an operation. Use the target system's appropriate state validation and request identity; a completed drafting step is not an execution receipt.

## Select a hook by timing and evidence

A pre-tool check can block a proposed operation before its side effect. A post-tool check can inspect or transform the result but cannot make the already executed operation disappear. A stop-time check assesses whether a run should finish; it is not a substitute for protecting an earlier write.

A synchronous blocking check can participate in the decision path. An asynchronous notification that finishes later cannot guarantee that the action waited for it. Where verification needs files or test execution, the checker needs authorized access to that actual state. Where the supplied event already contains decisive data, a simpler deterministic check may be sufficient.

Hook events, response formats, timeouts and bypass behavior depend on the installed interface. Check those details before relying on an example configuration. Repeatedly blocking completion without a recovery path can create a loop; it does not establish that the protected invariant holds.

## Separate the customer's concerns before investigating

One request may combine a billing discrepancy, an invoice copy and a policy exception. Build a concern list and give each item a status, evidence requirement and owner. Share only the context needed for each investigation, including the same customer and policy identifiers.

Independent read-only investigations may run together. An action depending on a verified identity or another investigation must wait. Preserve the distinction between finding an invoice, drafting a message and sending that invoice. Parallel investigation is not permission for parallel writes.

When synthesizing, check that every concern was addressed and that no unresolved exception was hidden inside a general success statement. One resolved concern does not make the entire interaction resolved.

## Make a handoff useful without the transcript

A human reviewer needs the relevant customer or case identifier, observed issue, evidence, proposed action and precise decision required. Distinguish a confirmed cause from a hypothesis. Identify amounts and currencies, and state whether an amount was requested, calculated, authorized or actually paid.

A schema can require fields and allowed routing states, but it does not prove that their values are true. Validate the evidence and business meaning before dispatching the handoff. A forced tool selection controls which tool is requested; it does not by itself establish a factual root cause or make a financial action authorized.

Route only the necessary information to the authorized recipient. Record the actual handoff result, such as a ticket identifier, before saying it was submitted. A payload marked `requires_human` is a state record, not proof that a person received or approved it. Preserve unresolved delivery if the receiving system fails.

## Worked example: two concerns and a blocked refund

In this invented support case, customer C-17's identity has been verified through the approved account workflow. An authorized billing lookup confirms a duplicate charge of USD 600\. The customer requests a full USD 600 refund and an invoice copy. The lookup does not establish why the duplicate charge occurred. The example policy permits automated refunds up to and including USD 500; a larger amount requires human review. These are teaching assumptions, not a product or universal service policy.

| Concern | Observed evidence | Supported next step |
| --- | --- | --- |
| Invoice copy | The authorized lookup finds the invoice. | Prepare it through the approved workflow; finding it does not mean it was sent. |
| Duplicate charge | Billing evidence confirms USD 600; automatic limit is USD 500. | Block automatic refund and request human review. |

A minimal routing check for this teaching rule uses integer cents:

```python
def refund_route(identity_verified, amount_cents):
    if identity_verified is not True:
        return "verify_identity"
    if type(amount_cents) is not int or amount_cents <= 0:
        return "clarify_amount"
    if amount_cents > 50000:
        return "human_review"
    return "eligible_for_authorized_workflow"
```

The final result permits only the next authorized workflow; this function does not execute a refund or check every production requirement. Its identity input must come from trusted verification state, not a model's assertion. For this rule, 49,999 and 50,000 cents take the within-limit branch; 50,001 cents requires human review. An unverified identity never reaches the refund route. The case's 60,000 cents therefore goes to human review.

A suitable handoff includes:

```json
{
  "customer_id": "C-17",
  "confirmed_issue": "Authorized billing lookup confirmed a duplicate charge.",
  "root_cause": "Not established; the cause of the duplicate charge remains unknown.",
  "escalation_reason": "The requested refund exceeds the automatic limit.",
  "refund_amount": 600,
  "currency": "USD",
  "amount_basis": "requested amount; not approved or paid",
  "recommended_action": "manual_review",
  "decision_requested": "Review the USD 600 refund above the USD 500 automatic limit.",
  "other_concern_status": "Invoice found; sending not confirmed."
}
```

The human can understand the issue without reading the full conversation. The requested amount remains USD 600; changing it to USD 500 merely to fit the automatic limit would falsify the request. If handoff submission fails, retain the payload and report that delivery remains unresolved rather than claiming escalation completed.

## Source-scoped controls, evidence and limits

Exact hook types, fields, limits, models and integration names below are attributed to the supplied source snapshot. The original cited anchor/benchmark attachments were not supplied, and no current SDK/CLI/MCP or external payment/ticket service was tested. A source sample is not an execution receipt. MCP means Model Context Protocol. The supplied glossary is a terminology registry that supplies candidate metadata; the Dxx domain files remain the factual authority when the two conflict. Glossary definitions, quality flags and candidate metadata do not certify product capabilities or actual execution; interpret those factual claims in their primary domain context.

Prompt chaining passes one step's output into the next; an actual intermediate code gate can reject that output before the next controlled step. MCP tools/resources/prompts and discovery methods such as tools/list expose capabilities, not business prerequisites. The implemented host/client owns the required customer-before-refund order.

The snapshot distinguishes prompt hooks, whose supplied event data supports a single model evaluation, from agent hooks that inspect actual files or run authorized commands. It describes agent hooks with ok/reason, up to 50 tool-use turns and a 60-second default timeout, without the prompt-hook impossible field. Those source interface details require actual support. A model verifier can gather evidence but is not an infallible predicate. The source describes ok:false as continuing a turn in some event paths; continued reasoning does not authorize the rejected action.

This source-shaped Stop configuration illustrates a 120-second override for test verification, not a measured pass or a pre-deployment gate:

```json
{
  "hooks": {
    "Stop": [{"hooks": [{"type":"agent","prompt":"Verify the current unit-test suite. Run the actual suite and report its command, revision, exit status and failures. $ARGUMENTS","timeout":120}]}]
  }
}
```

Use only an accepted installed-interface schema. Record the actual suite/command, current code revision, observed output and exit result; the prompt or timeout alone proves nothing passed. A Stop check governs turn completion, whereas an earlier financial write/deployment needs its own pre-action control. The source reports a Stop safeguard after eight consecutive blocks. Treat this as an attributed implementation snapshot, not a universal current default: ending repeated blocking is not successful verification or acceptance. Timeouts and forced exit leave their actual failed/unresolved predicate intact.

For the snapshot's async hooks, decision, permissionDecision and continue fields cannot retroactively control the already continuing/completed action. Use supported synchronous blocking timing where the action must wait. When multiple hooks match, the source says all commands run before merge; a deny does not cancel siblings' logging or other effects. Its PreToolUse permission merge is deny → defer → ask → allow, and additionalContext is accumulated. Qualify the fields/order by actual event/interface and make every sibling effect safe independently.

Where appropriate, separate the performer from a verification worker and give the verifier the actual artifact, acceptance criterion and relevant environment. Require inspectable test logs/command results, not merely ok:true or a different worker name. The result still needs interpretation against the real question.

## Optional contracts and trusted prerequisite execution

FACET is an optional contract-compilation example named by the source, not an independently verified native platform requirement. The source payment illustration describes amount/currency inputs and transaction\_id/status outputs for a request of 100 USD. The complete application-owned example below declares its input and output contracts, full expected records and rejected/uncertain paths. Those declarations do not authorize, execute or confirm a payment. The source's process\_payment.tool\_definition() fragment and dated model are conceptual until the actual supported integration is established; no real transaction output is claimed here.

Use monotonic effective capability narrowing at delegation: child tools/actions must stay within parent/task authority. A read-only task must actually exclude unauthorized writes/network effects across all retained tool paths. The source's later strict-subset phrase does not require removing one arbitrary capability merely to make the set smaller; enforce the substantive authorized subset. Context isolation and a read-only prompt are not filesystem permission controls.

For a concrete prerequisite flow, the following is application-state pseudocode with trusted server adapters, not SDK registration syntax:

```text
receive authenticated actor, intended customer, request identity and requested integer USD cents
call the permitted get_customer adapter and capture its actual result/error
if lookup failed/missing/malformed: return blocked lookup state without calling process_refund
if returned ID differs from intended customer or authoritative verification is not true:
    return verification-required state without calling process_refund
check current account/operation permission, policy, amount domain and required approval
if any is absent/invalid: return the specific blocked/human-review state
otherwise invoke the permitted process_refund with the validated ID, authorized amount
and deduplicated request identity through the actual server action boundary
record actual acknowledged result, or an uncertain execution outcome requiring reconciliation
```

Awaiting get\_customer orders return timing; it does not make a truthy verified field authoritative or validate the target/amount. The source's one-call get\_team\_members line does not implement this prerequisite, and its short verified-field/refund\_amount example omits the full identity/policy/error domain. No generated script can create its own permission. Revalidate current state at the actual write boundary and reconcile an uncertain repeated request before retrying.

In the source's Programmatic Tool Calling architecture, Code Execution owns loops/conditions, pauses for supported tool results, resumes processing them in the script and exposes selected final output to the model. That is not arbitrary generated Python gaining universal tools. It can suit fan-out, filtering and large intermediate results. If each next step needs new model reasoning or immediate user confirmation, startup/script/interaction overhead may outweigh savings and the missing semantic round-trip cannot be skipped.

The source reports internal retrieval accuracy 25.6%→28.5% and GIA scores 46.5%→51.2% for its stated experiments. Those are +2.9 and +4.7 percentage points respectively, not cost savings or a financial-safety guarantee. It separately reports about 38% fewer billed input tokens at unchanged accuracy on a 75-tool project-management workload, and unchanged scores with about 8% greater cost on τ²-bench. These are different workloads/metrics with uninspected original benchmark details. A new comparison must declare comparable cases/quality, full input/output/resource/cost scope, starts/ends, waits/retries and actual observations; this task measured none of those product effects.

## Durable handoffs and complete worker outcomes

Dependent investigations pass actual predecessor facts through the coordinator in order; only independent work can overlap. Async coordination can tolerate variable duration if actual durable task/state/receipt/retry mechanisms implement recovery. Changing sync syntax to async does not persist data or guarantee every latency failure disappears. Deduplicate semantically equivalent calls and reconcile side-effect outcomes before replay. A code checkpoint such as the source git-status/add/commit example is only a mechanism: inspect the authorized file set rather than staging everything automatically, and retain actual test/output evidence instead of assuming a commit or pytest command proves handoff correctness. For authorized cross-worker recovery, retain only the required nonsecret workspace, account or credential identity, or an approved secret reference, alongside the task and state evidence. Do not copy actual keys, tokens or passwords into prompts, logs or the handoff. Shared configuration or knowledge of a reference does not grant access; the receiving worker must separately have permission to use it.

The source's requires\_action, custom decide()/escalate() and session.status\_idled webhook are managed/custom-interface illustrations, not universal SDK calls. Preserve requested→validated→submitted/uncertain-delivery→waiting-for-human→actual-human-outcome states. An idle notification does not show delivery, approval or remediation; resume only from the relevant actual authorized response.

The source asyncio sketch leaves run\_worker as pass and decomposition/synthesis undefined; comments about retries do not implement a retry policy. Opus/Haiku role pairing is illustrative, not measured quality/cost. Its N+1 call shorthand can exclude separate planning, synthesis, verification and retries. Account every actual applicable coordinator/worker/synthesis turn and dispatch/wait/aggregation overhead; the 1,000–2,000 token summary range is source advice, not a completeness or context-fit guarantee. A simple latency-critical task may not justify a multi-worker workflow.

Use a worker contract that differentiates legitimate empty findings from missing work. For example, {"concern\_id":"invoice","status":"complete","findings":\[\],"evidence":"Actual checked lookup returned no invoice"} is a permitted empty result only if that lookup really occurred and the case policy supports it. Empty text, malformed JSON, a missing concern\_id or an unknown status is a failed response, not a no-issue result. Validate parsed fields and underlying evidence, then target a bounded retry or retain the concern unresolved. JSON may change XML parsing risks, but neither format proves semantics. Synthesis must account for every actual requested concern and must not turn a failed worker into invented analysis.

## One coherent handoff contract

The source schema describes customer\_id as UUID or email but later prose validates UUID only. Resolve that conflict with the real upstream identity contract before integration; a nonempty string alone is not verification. The existing C-17 example uses a deliberately different, application-owned teaching identifier, not a claim that C-17 is a UUID/email. This complete illustrative handoff schema records requested amount and uncertainty explicitly:

```json
{
  "type":"object",
  "properties":{
    "customer_id":{"type":"string","minLength":1},
    "root_cause":{"type":"string","minLength":1},
    "root_cause_status":{"type":"string","enum":["confirmed","suspected","unknown"]},
    "refund_amount":{"type":["number","null"],"minimum":0},
    "currency":{"type":"string","enum":["USD"]},
    "amount_status":{"type":"string","enum":["requested","authorized","paid","unknown","not_applicable"]},
    "recommended_action":{"type":"string","enum":["approve_refund","manual_review","policy_exception"]}
  },
  "required":["customer_id","root_cause","root_cause_status","refund_amount","currency","amount_status","recommended_action"],
  "additionalProperties":false
}
```

Under the teaching policy, a known requested USD 600 can be handed to manual\_review even though it cannot execute automatically above 500; recording the request is not authorizing it. Consumer checks require a finite amount consistent with actual evidence/status: unknown uses null, not\_applicable uses an explicit agreed 0, and requested/authorized/paid status needs its respective real evidence. Zero must not silently mean unknown. The schema alone cannot enforce all correlations or factual support. A recommendation approve\_refund remains a suggested human routing action, not approval or payment. A matching projection of the earlier case is {"customer\_id":"C-17","root\_cause":"Cause of duplicate charge not established","root\_cause\_status":"unknown","refund\_amount":600,"currency":"USD","amount\_status":"requested","recommended\_action":"manual\_review"}. Retain the earlier evidence, decision request and invoice status alongside that core projection for a human without transcript access.

For supported named generation, tool\_choice {"type":"tool","name":"escalate\_to\_human"} must match an actually exposed tool and compatible model/API/thinking configuration. The source states manual extended thinking is incompatible with forced named choice; no dated sample establishes current availability. A worker escalation\_signal and compressed diagnosis are candidate inputs to the coordinator, not a verified cause or permission. Supply actual supported facts/unknowns to payload generation, then locate the intended tool\_use by type/name/id; do not assume next() finds a valid block. Printing input neither validates business facts nor delivers a ticket.

On schema/identity/amount/action failure, preserve the invalid candidate and return a correctly matched tool\_result/error under the actual API contract, retaining the call ID and specific deficiency. A validator library cannot supply missing identity or diagnosis. Revalidate the next actual candidate. An application may declare, for example, at most 3 correction attempts plus an overall elapsed/resource cap; this is a teaching policy, not a product default. Missing evidence, timeout or exhausted attempts keeps the handoff unresolved. max\_tokens=1024 in the source request caps one response; it is not a multi-turn convergence or ticket-delivery limit.

This application-state pseudocode makes that illustrative correction boundary explicit; helper/API names are conceptual, not a claimed SDK implementation:

```text
set maximum_attempts = 3 and an actual application deadline/resource budget
accepted_candidate = none
last_error = none
for attempt from 1 through maximum_attempts:
    if the remaining budget is exhausted: return unresolved with reason budget_exhausted and any retained last_error
    generate one response through supported configured per-call limits
    locate the actual matching escalation call/name/ID and inspect its input
    if no matching usable call exists:
        retain the concrete gap as last_error; do not dispatch; continue
    validate schema, upstream identity, amount/status and action evidence
    if invalid:
        retain candidate/error; send the matched specific error; continue
    accepted_candidate = the validated actual input
    break
if accepted_candidate is none: return unresolved after the attempt limit
enter the separately authorized delivery state using accepted_candidate
reconcile actual dispatch acknowledgement, failure or uncertain outcome
only an actual acknowledged ticket moves to waiting-for-human
```

The real host must actually implement/enforce per-call timeout/resource handling, including an in-flight request; a deadline test before a call alone cannot interrupt a hung call. An error or missing call never falls through to dispatch. Accepted payload, delivery acknowledgement and later human decision remain separate outcomes.

Only a validated candidate enters the permitted actual ticketing adapter/MCP client. Verify its supported mapping, credentials/rights and request identity, dispatch, then inspect acknowledgement/ticket ID before recording delivered/awaiting-human. On timeout, retain uncertain delivery and reconcile the actual request state before retrying. Append a matched actual tool\_result ticket receipt if continuing the model loop. A ticket acknowledgement is not human approval or resolution; keep the financial action blocked until its real requirements are met. Apply the same nonsecret identity or approved-reference boundary to this integration: retain only what the authorized continuation needs, exclude actual secret values, and verify the recipient's permission rather than treating possession of a reference as authority.

## Complete application-owned payment and worker examples

These are additional invented teaching contracts, not FACET syntax, vendor tool schemas, observed payments or actual worker runs. They make the source's structural-versus-business distinction inspectable. The payment request uses whole integer USD dollars from 1 through 100, not cents or arbitrary real-world currency precision. The extra request\_id is this application's reconciliation identity. Actual account identity, operation permission, current policy and required approval must be checked separately before dispatch, even when both schemas validate.

The complete request schema is:

```json
{
  "type":"object",
  "properties":{
    "request_id":{"type":"string","minLength":1},
    "amount":{"type":"integer","minimum":1,"maximum":100},
    "currency":{"type":"string","enum":["USD"]}
  },
  "required":["request_id","amount","currency"],
  "additionalProperties":false
}
```

The complete result schema is separate. Its status enum is succeeded, rejected or unknown. A succeeded result requires a real acknowledged nonempty transaction\_id and null error\_code; rejected means no dispatch under this adapter's validation gate and uses null transaction\_id plus a specific error; unknown means the actual outcome must be reconciled, not assumed absent or safely retried. These correlations are application semantic checks beyond this shape schema:

```json
{
  "type":"object",
  "properties":{
    "request_id":{"type":"string","minLength":1},
    "transaction_id":{"type":["string","null"],"minLength":1},
    "status":{"type":"string","enum":["succeeded","rejected","unknown"]},
    "error_code":{"type":["string","null"],"minLength":1}
  },
  "required":["request_id","transaction_id","status","error_code"],
  "additionalProperties":false
}
```

The following are complete EXPECTED examples under explicit assumptions, not measured external responses. The first assumes every independent business prerequisite and a simulated acknowledgement; the second fails the currency gate before dispatch; the third assumes a permitted dispatch timed out without a usable receipt:

```json
[
  {
    "input":{"request_id":"demo-payment-1","amount":100,"currency":"USD"},
    "assumed_adapter_event":"all prerequisites satisfied; simulated acknowledged receipt",
    "expected_output":{"request_id":"demo-payment-1","transaction_id":"demo-transaction-1","status":"succeeded","error_code":null}
  },
  {
    "input":{"request_id":"demo-payment-2","amount":100,"currency":"EUR"},
    "assumed_adapter_event":"input validation rejects unsupported currency; no dispatch",
    "expected_output":{"request_id":"demo-payment-2","transaction_id":null,"status":"rejected","error_code":"unsupported_currency"}
  },
  {
    "input":{"request_id":"demo-payment-3","amount":100,"currency":"USD"},
    "assumed_adapter_event":"permitted dispatch timed out; actual effect unknown",
    "expected_output":{"request_id":"demo-payment-3","transaction_id":null,"status":"unknown","error_code":"outcome_unconfirmed"}
  }
]
```

At the request boundary, amount 1 and 100 satisfy only this numeric gate; 0, -1, 101, 100.5, true, a missing amount or a string amount fail it. Missing currency is currency\_required; EUR is unsupported\_currency. A shape-valid success object with no genuine receipt is still false business evidence. All amounts and IDs here are fictional. The source's 100 USD request is represented by amount:100 under this declared whole-dollar contract; it is not confused with 100 cents.

For workers, this separate contract requires concern\_id, status (complete or unresolved), findings (an array), evidence (nonempty text) and error (null or specific text). Complete/no-match is permitted only after a successful authorized lookup that actually covers the concern. A candidate that is merely parseable JSON but misses those fields is not accepted. The following exact response cases and complete coordinator decisions are EXPECTED static illustrations:

```json
[
  {
    "raw_worker_response":"{\"concern_id\":",
    "known_execution_evidence":"Worker returned truncated text; no validated result",
    "expected_decision":{"concern_id":"invoice","accepted":false,"state":"unresolved","findings":null,"reason":"malformed_json","next_action":"retry within the actual correction budget or request review"}
  },
  {
    "raw_worker_response":null,
    "known_execution_evidence":"No worker response was received",
    "expected_decision":{"concern_id":"invoice","accepted":false,"state":"unresolved","findings":null,"reason":"response_missing","next_action":"inspect actual task state before a permitted retry"}
  },
  {
    "raw_worker_response":{"concern_id":"invoice","status":"complete","findings":[],"evidence":"Assume an actual authorized lookup completed successfully and covered this invoice concern with no matches","error":null},
    "known_execution_evidence":"Assumed successful full-scope lookup; this article did not run it",
    "expected_decision":{"concern_id":"invoice","accepted":true,"state":"complete_no_match","findings":[],"reason":"verified_no_match_under_declared_contract","next_action":"report no matching invoice; preserve other concerns and case policy"}
  },
  {
    "raw_worker_response":{"concern_id":"invoice","status":"unresolved","findings":[],"evidence":"Lookup failed before returning results","error":"lookup_timeout"},
    "known_execution_evidence":"Assumed lookup failure; no claim of a completed search",
    "expected_decision":{"concern_id":"invoice","accepted":false,"state":"unresolved","findings":null,"reason":"lookup_timeout","next_action":"retain missing evidence and reconcile before retry"}
  }
]
```

These decisions retain the same complete field set. Missing/error outcomes use findings:null to mean no accepted findings, while verified no-match uses \[\]. An otherwise complete object with a missing concern\_id, missing evidence or unsupported status is rejected as invalid\_worker\_contract; its fields are not invented. This example's malformed/missing response is different from a complete no-match search. Neither an evidence string alone nor the expected accepted:true field proves a real search occurred. The coordinator must inspect the actual lookup receipt/scope and applicable policy before accepting it; every other customer concern still needs its own supported result.

## A matched validation error and a corrected handoff candidate

Keep the earlier teaching facts: the verified customer is C-17, the observed duplicate charge and requested refund are USD 600, its cause is unknown, and amounts above USD 500 require human review. For this separate static alternative, assume the ticket adapter is unavailable after local validation. The source-shaped message fragments below use the application-owned handoff fields defined above. They are not complete API requests, live responses or evidence of a ticket or payment.

```json
[
  {
    "role":"assistant",
    "content":[{
      "type":"tool_use",
      "id":"handoff_bad_600",
      "name":"escalate_to_human",
      "input":{"customer_id":"C-17","root_cause":"Cause of duplicate charge not established","root_cause_status":"unknown","refund_amount":500,"currency":"USD","amount_status":"requested","recommended_action":"manual_review"}
    }]
  },
  {
    "role":"user",
    "content":[{
      "type":"tool_result",
      "tool_use_id":"handoff_bad_600",
      "is_error":true,
      "content":"{\"code\":\"requested_amount_mismatch\",\"expected_requested_amount\":600,\"provided_amount\":500,\"currency\":\"USD\",\"instruction\":\"Preserve the actual requested USD 600 and unknown cause; route for manual review. No refund is authorized or paid.\"}"
    }]
  },
  {
    "role":"assistant",
    "content":[{
      "type":"tool_use",
      "id":"handoff_corrected_600",
      "name":"escalate_to_human",
      "input":{"customer_id":"C-17","root_cause":"Cause of duplicate charge not established","root_cause_status":"unknown","refund_amount":600,"currency":"USD","amount_status":"requested","recommended_action":"manual_review"}
    }]
  },
  {
    "role":"user",
    "content":[{
      "type":"tool_result",
      "tool_use_id":"handoff_corrected_600",
      "is_error":true,
      "content":"{\"code\":\"ticket_adapter_unavailable\",\"candidate_validation\":\"passed under the stated teaching facts and contract\",\"delivery_status\":\"not_delivered\",\"ticket_id\":null,\"refund_executed\":false,\"next_action\":\"Retain the validated USD 600 manual-review request and resolve the authorized delivery dependency; do not claim a ticket or retry an uncertain write blindly.\"}"
    }]
  }
]
```

The expected first validation rejects the candidate because USD 500 misstates the actual requested amount, even though the value fits a numeric schema. Its error answers `handoff_bad_600`, and the corrected request has a new identity, `handoff_corrected_600`, with all seven core fields. Under the explicit teaching facts, the corrected candidate is valid for manual-review handoff, not an authorized refund. Its separate delivery error reports the assumed unavailable adapter, not a malformed candidate or a delivered ticket. The coordinator therefore keeps delivery unresolved and reports no human approval or payment. Both error results precede any continuation and remain in the actual conversation history if this pattern is implemented. These are predicted static judgments; neither validator, ticket adapter nor model was run for this exchange.

## Summary

Use prompts to explain the workflow and trusted controls to enforce prerequisites. Place each control before the action it governs, keep separate concerns and their outcomes visible, and hand off evidence with a clear decision request. Structural validity, successful dispatch and human approval are different facts.
