# Workflow enforcement gates and handoffs

*Claude Certified Architect - Foundations Study Guide · Agentic Architecture & Orchestration · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/agentic-architecture-and-orchestration/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.

- Certification: Claude Certified Architect - Foundations
- Exam section: Agentic Architecture & Orchestration
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Implement multi-step workflows with enforcement and handoff patterns

## 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_refund` until `get_customer` has 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

| Fact | Detail | Source |
|---|---|---|
| Permission order | Hooks, deny rules, ask rules, permission mode, allow rules, `canUseTool` | [Configure permissions](https://code.claude.com/docs/en/agent-sdk/permissions) |
| Auto-approved calls | Never reach `canUseTool`; checks there are silently bypassed | [Configure permissions](https://code.claude.com/docs/en/agent-sdk/permissions) |
| Hook deny | Applies even in `bypassPermissions` mode | [Configure permissions](https://code.claude.com/docs/en/agent-sdk/permissions) |
| PreToolUse block | `hookSpecificOutput` with `permissionDecision: "deny"` and `permissionDecisionReason` | [Intercept and control agent behavior with hooks](https://code.claude.com/docs/en/agent-sdk/hooks) |
| Keying gate state | Every hook input carries `session_id` | [Intercept and control agent behavior with hooks](https://code.claude.com/docs/en/agent-sdk/hooks) |
| PostToolUse input | `tool_input` and `tool_response` | [Hooks reference](https://code.claude.com/docs/en/hooks) |
| `defer` result | Turn ends with `stop_reason: "tool_deferred"`; resume to re-fire the hook | [Hooks reference](https://code.claude.com/docs/en/hooks) |
| `defer` limits | `-p` runs only; ignored when Claude makes several calls in the turn | [Hooks reference](https://code.claude.com/docs/en/hooks) |
| Hook decision precedence | `deny` > `defer` > `ask` > `allow` | [Intercept and control agent behavior with hooks](https://code.claude.com/docs/en/agent-sdk/hooks) |
| Escalation accuracy target | 95 percent or higher | [Customer support agent](https://platform.claude.com/docs/en/about-claude/use-case-guides/customer-support-chat) |

## Check yourself

- Why does a verification check inside `canUseTool` fail when the refund tool is in `allowedTools`?
- When a custom Messages API loop must block `issue_refund` until 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?

## Sources

- [Intercept and control agent behavior with hooks](https://code.claude.com/docs/en/agent-sdk/hooks)
- [Configure permissions](https://code.claude.com/docs/en/agent-sdk/permissions)
- [Hooks reference](https://code.claude.com/docs/en/hooks)
- [Customer support agent](https://platform.claude.com/docs/en/about-claude/use-case-guides/customer-support-chat)
- [Building effective AI agents](https://www.anthropic.com/research/building-effective-agents)
- [How tool use works](https://platform.claude.com/docs/en/agents-and-tools/tool-use/how-tool-use-works)
- [Subagents in the SDK](https://code.claude.com/docs/en/agent-sdk/subagents)
- [Define tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools)
- [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls)
- [Strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 11 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
