Workflow enforcement gates and handoffs
How to enforce workflow order in code instead of prompts: prerequisite gates with PreToolUse and PostToolUse hooks, handler checks or a withheld tool, the Agent SDK permission evaluation order, human approval pauses with defer, multi-concern decomposition, and structured handoff summaries for human agents.
Implement multi-step workflows with enforcement and handoff patterns
~8 min read · 11 practice questions ·
What the exam expects
- Choose programmatic enforcement (hooks, prerequisite gates) over prompt guidance when an ordering rule must hold every time, such as identity verification before a refund.
- Implement a gate that blocks
process_refunduntilget_customerhas returned a verified ID, in the Agent SDK, in the tool handler, or in a raw Messages API loop. - Explain the permission evaluation order and why an allow rule silently skips a check placed in
canUseTool. - Decompose a multi-concern request, verify once, investigate in parallel with shared context, synthesize one resolution and escalate only the item that needs a human.
- Compile a structured handoff summary for human agents who cannot see the transcript, and pause for approval with
defer.
Key terms: prerequisite gate (code that refuses a downstream tool call until an earlier step's result is recorded); PreToolUse / PostToolUse (hooks that run before a tool call and after it succeeds); canUseTool (the SDK's last-resort permission callback); defer (a PreToolUse decision that pauses the turn for an outside decision); handoff summary (structured case facts for a human taking over).
Key facts
- Detail
- Hooks, deny rules, ask rules, permission mode, allow rules,
canUseTool
- Detail
- Never reach
canUseTool; checks there are silently bypassed
- Detail
- Applies even in
bypassPermissionsmode
- Detail
hookSpecificOutputwithpermissionDecision: "deny"andpermissionDecisionReason
- Detail
- Every hook input carries
session_id
- Detail
tool_inputandtool_response
defer result- Detail
- Turn ends with
stop_reason: "tool_deferred"; resume to re-fire the hook
defer limits- Detail
-pruns only; ignored when Claude makes several calls in the turn
- Detail
deny>defer>ask>allow
- Detail
- 95 percent or higher
- Why does a verification check inside
canUseToolfail when the refund tool is inallowedTools? - When a custom Messages API loop must block
issue_refunduntil verification, what is the most direct gate? - What does a PreToolUse hook return to pause for a human approver, and what does the result show?
- Why must a coordinator pass the verified customer ID to each investigation subagent?
- When escalating to humans who cannot see the transcript, what must the handoff contain?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Claude Certified Architect - Foundations pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 30 lessons of the Claude Certified Architect - Foundations guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (11 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams
Practice for the Claude Certified Architect - Foundations exam
Certifyforce is an independent study resource and is not affiliated with, endorsed by or sponsored by Anthropic. Claude is a trademark of Anthropic.