CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 5 · Lesson 28/38

    Human approval checkpoints in Claude Code and the Agent SDK

    Apply human-in-the-loop validation strategies

    15 min read
    2.8% of exam
    5 sources
    Published 20 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Choose a Claude Code permission mode by how much of Claude's work a person must approve
    • Name the checkpoints that still reach a human in every permission mode
    • Trace a tool call through hooks, deny rules, ask rules, the permission mode, allow rules and canUseTool, and predict which step decides it
    • Implement a canUseTool callback that sends a person's approval, changes or refusal back to Claude

    Key concept

    Human approval checkpoint — A point in the permission pipeline where a tool call stops until a person approves it, changes it or refuses it. The checkpoint only exists if no earlier step has already approved or denied the call.

    1.Why an agent needs human approval checkpoints

    An agent that can run shell commands, edit files or call external services will sometimes do something its user never meant. Anthropic's incident log lists real cases: deleting remote git branches after misreading an instruction, uploading an engineer's GitHub auth token to a compute cluster, and attempting migrations against a production database. None of these came from hostile intent. In each case the model was overeager and takes initiative beyond what the user would approve.

    Human-in-the-loop validation means putting a person between the agent and those actions. The design problem is placing the person well. If every action asks for approval, people stop reading the prompts: Claude Code users approve 93% of permission prompts. If nothing asks, nobody catches the deleted branch. A good design sends routine reads and edits through without a prompt and saves the person's attention for actions that are irreversible, touch shared infrastructure or send data outside the organisation.

    Claude offers three surfaces for this. Claude Code uses permission modes. The Agent SDK uses a canUseTool callback that your application answers. Managed Agents use permission policies that pause a session until your client confirms. All three answer the same question: which calls run on their own and which ones wait for a person?

    Checkpoint 1 of 8· Check yourself

    A team sets up its coding agent so that every tool call waits for a person to approve it, including file reads and routine edits. They expect this to give the strongest protection against incidents such as a deleted remote branch. What does the lesson say will happen, and what is the better design?

    Sources12

    2.Permission modes: how much the human reviews

    A permission mode sets the baseline for how much a person reviews. In Claude Code you switch modes with Shift+Tab in the CLI, and in the SDK you set permissionMode. Going from default to bypassPermissions, each mode takes more decisions away from the person.

    What each Claude Code permission mode runs without asking, and when to use it
    ModeWhat runs without askingBest for
    defaultReads onlyReviewing every action yourself, sensitive work
    acceptEditsReads, file edits, and common filesystem commands (mkdir, touch, mv, cp, etc.)Iterating on code you're reviewing
    planReads, plus classifier-approved commands when auto mode is availableExploring a codebase before changing it
    autoEverything, with background safety checksLong tasks, reducing prompt fatigue
    dontAskFile reads inside your working directories and pre-approved tools; anything that would prompt is deniedLocked-down CI and scripts
    bypassPermissionsEverythingIsolated containers and VMs only

    Two modes give different kinds of human-in-the-loop control, and they are easy to confuse. plan lets Claude investigate freely but keeps your source files untouched until a person signs off. Claude Code blocks edits until you approve a plan. dontAsk is for runs with no person present. It turns every would-be prompt into a denial, so a CI job never sits waiting on a question nobody will answer. Calls approved by allowedTools or allow rules still run. In the SDK, canUseTool is never called in this mode. A headless run with --dangerously-skip-permissions behaves the same way: the few calls that would still prompt are denied instead.

    In auto mode a model-based classifier takes the human approver's place. Before shell commands and network requests run, it checks that they match what the user asked for. Approval fatigue is the reason it exists. It does not remove the person entirely.

    Some actions reach a person in every mode, including auto and bypassPermissions, which skips permission prompts except for the actions no mode auto-approves. These are:

    • tools matched by an explicit ask rule
    • connector tools your organisation set to ask, in sessions where that setting reaches Claude Code
    • tools that need user interaction: the built-in AskUserQuestion tool and MCP tools marked requiresUserInteraction
    • rm and rmdir removals targeting a critical path
    • the cross-session messaging safeguards

    Ask rules sit on that list. In brief, an ask rule names a tool or command pattern that always prompts (see Permission rules: allow, ask and deny). That makes an ask rule a checkpoint that survives a mode change. What the person sends back matters too. On a prompt they can attach a comment. If they choose Yes, Claude Code runs the action and then gives Claude the comment. If they choose No, the comment goes to Claude as the reason for the denial and Claude keeps working. A No without a comment on a main-conversation prompt stops the turn.

    Checkpoint 2 of 8· Match them up

    Match each permission mode to how it handles human review.

    Tap a term, then the definition that fits it.

    Checkpoint 3 of 8· Check yourself

    Developers often switch Claude Code to auto or bypassPermissions with Shift+Tab. The security lead wants a person to review every git push whatever mode is active. Which configuration does that?

    Checkpoint 4 of 8· Exam question

    A DevOps team runs a Claude agent unattended inside a CI pipeline to triage failing builds. No human is available to respond to interactive approval prompts during the run, so any tool call that isn't already pre-approved must be denied outright rather than left waiting on a prompt. Which permission mode configuration achieves this?

    Sources134

    3.Where the human sits in the permission order

    In the Agent SDK, every tool call passes through a fixed sequence of steps. The first step that reaches a decision settles the call, and later steps never see it. The person, through canUseTool, is the last step. So whether a human ever sees a call depends on what every step before it did.

    Agent SDK permission evaluation order, first step to last
    StepWhat it does to a call
    1. HooksCustom code that can allow, deny, or modify the tool request
    2. Deny rulesBlock matching calls; nothing later can lift the block
    3. Ask rulesSend matching calls for confirmation
    4. Permission modebypassPermissions approves what reaches it; acceptEdits approves file operations; plan sends file-edit and shell-write tools to canUseTool; other modes fall through
    5. Allow rulesA bare allowedTools entry such as "Read" approves the whole tool
    6. canUseTool callbackAsks a person at runtime when no earlier step resolved the call

    The order explains which configurations keep a person in the loop:

    • Plan mode keeps a reviewer on every write. The mode step comes before allow rules, so in plan mode no write can be auto-approved. A lead who wants to see each diff before it lands can let Claude investigate with read-only tools while every proposed edit goes to the callback. acceptEdits does the opposite: edits land first and get reviewed afterwards.
    • A bare allow entry silences the callback. An allowedTools entry such as "Read" approves the whole tool before the callback is consulted. If you allow a tool and expect canUseTool to intercept it, the callback will never run for that tool.
    • A deny rule cannot be reversed from the callback. Deny rules are step two. A call they block never reaches step six, so canUseTool cannot lift the block for a single call.
    • bypassPermissions only approves what reaches step four. It approves everything that arrives at the mode step, so a hook or ask rule that already decided the call is not affected.

    That last point is why a hook is the strongest checkpoint for a high-impact tool. Hooks run custom code on every matching call (see Hooks: actions that always run). A PreToolUse hook scoped to a wire-transfer tool decides at step one, before any rule or mode. It adds a second approval layer on top of the permission settings. If someone later switches the session to bypassPermissions, the hook's demand for human approval still holds, because the bypass step comes after it.

    Checkpoint 5 of 8· Check yourself

    An SDK application wants a person to approve each shell command, but it also wants Bash to work without friction. So it sets allowedTools to ["Read", "Bash"] and adds a canUseTool callback that shows each Bash command to an operator. During testing, Bash commands run and the operator never sees one. What explains this, and what fixes it?

    Checkpoint 6 of 8· Exam question

    A fintech company's Claude-powered agent can initiate wire transfers through a custom MCP tool. Even though the operations team has configured allowedTools to auto-approve most read and reporting tools, they want every wire-transfer tool call to require a human's explicit approval no matter what permission mode the session is later switched to, including bypassPermissions. Which approach best satisfies this requirement?

    Checkpoint 7 of 8· Exam question

    An engineering lead is building an agent with the Claude Agent SDK to investigate a suspected security vulnerability across a large codebase. She insists that no file be modified until she has personally reviewed and approved the exact edit Claude intends to make, through an approval callback in her own application. Which configuration best matches this workflow?

    Sources4

    4.canUseTool: routing tool calls to a person

    canUseTool is how an Agent SDK application asks a person. The SDK calls it in two situations. The first is when Claude wants a tool that no permission rule or mode has auto-approved. The second is when Claude calls AskUserQuestion to ask a clarifying question. The callback receives the tool name, the tool's input and a context object. You show those to a person, wait for their decision and return it. For Bash, the input carries command, description and timeout. For Write, it carries file_path and content. Those are the details a reviewer needs to see.

    A minimal Python callback: ask the user, then return allow or denypython
    async def can_use_tool(tool_name, input_data, context):
        print(f"Claude wants to use {tool_name}")
        approved = await ask_user("Allow this action?")
    
        if approved:
            return PermissionResultAllow(updated_input=input_data)
        return PermissionResultDeny(message="User declined")

    The callback returns one of two results, and each one sends something back to Claude. An allow result carries the input the tool will run with. That can be Claude's original input or a version the person edited. A deny result carries a message. The tool does not run, and Claude reads the message and continues.

    The two canUseTool responses in each SDK language
    ResponsePythonTypeScript
    AllowPermissionResultAllow(updated_input=...){ behavior: "allow", updatedInput }
    DenyPermissionResultDeny(message=...){ behavior: "deny", message }

    Those two shapes support six reviewer actions:

    1. Approve: let the tool run as Claude requested.
    2. Approve with changes: edit the input before execution, for example to sanitise a path or add a constraint.
    3. Approve and remember: send back a rule from the context's suggestions so matching calls skip the prompt next time.
    4. Reject: block the tool and tell Claude why.
    5. Suggest an alternative: block the call but point Claude towards what the user wants instead.
    6. Redirect entirely: use streaming input to send Claude a completely new instruction.

    Two wiring details catch people out. If you pass a tools array, include AskUserQuestion in it, or Claude's clarifying questions never reach the callback. In Python, the documented example also registers a dummy PreToolUse hook that returns {"continue_": True}, because that workaround keeps the stream open for can_use_tool. In TypeScript, the context argument also carries an AbortSignal, which lets you cancel a prompt nobody is answering.

    Checkpoint 8 of 8· Fill the gap

    A reviewer approves a Bash call in this callback. The tool must run with input the reviewer could have edited, such as a sanitised path. Which keyword argument completes the allow result?

    async def can_use_tool(tool_name, input_data, context):
        print(f"Claude wants to use {tool_name}")
        approved = await ask_user("Allow this action?")
    
        if approved:
            return PermissionResultAllow( ? =input_data)
        return PermissionResultDeny(message="User declined")

    Sources5

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Control whether Claude asks before acting.”
      ↩︎ Why an agent needs human approval checkpoints
      “Claude Code blocks edits until you approve a plan”
      ↩︎ Permission modes: how much the human reviews
      “In this -p run, the few calls that would still prompt are denied instead”
      ↩︎ Permission modes: how much the human reviews
      “Tools matched by an explicit ask rule”
      ↩︎ Permission modes: how much the human reviews
      “set permissions.disableBypassPermissionsMode to”
      ↩︎ Permission modes: how much the human reviews
      “dontAsk | File reads inside your working directories and pre-approved tools; anything that would prompt is denied | Locked-down CI and scripts”
      ↩︎ Checkpoint
    2. 2.
      “Claude Code users approve 93% of permission prompts.”
      ↩︎ Why an agent needs human approval checkpoints
      “takes initiative beyond what the user would approve”
      ↩︎ Why an agent needs human approval checkpoints
      “Over time that leads to approval fatigue, where people stop paying close attention to what they're approving.”
      ↩︎ Checkpoint
    3. 3.
      “Skips permission prompts, except for the actions no mode auto-approves”
      ↩︎ Permission modes: how much the human reviews
      “No: Claude Code sends your comment to Claude as the reason for the denial, and Claude continues working.”
      ↩︎ Permission modes: how much the human reviews
      “Ask rules prompt for confirmation whenever Claude Code tries to use the specified tool.”
      ↩︎ Checkpoint
    4. 4.
      “Any call that would otherwise prompt is denied.”
      ↩︎ Permission modes: how much the human reviews
      “Hooks: run custom code to allow, deny, or modify tool requests.”
      ↩︎ Where the human sits in the permission order
      “In bypassPermissions mode, Claude Code approves everything that reaches this step”
      ↩︎ Where the human sits in the permission order
      “sends file-edit and shell-write tools to your canUseTool callback regardless of allow rules”
      ↩︎ Where the human sits in the permission order
      “auto-approves that whole tool before the callback is consulted”
      ↩︎ Where the human sits in the permission order
      “prompt users for approval at runtime, when no earlier step resolves the call”
      ↩︎ Key concept
      “In bypassPermissions mode, Claude Code approves everything that reaches this step”
      ↩︎ Exam trap 1
      “auto-approves that whole tool before the callback is consulted”
      ↩︎ Exam trap 2
      “canUseTool is never called”
      ↩︎ Exam trap 3
    5. 5.
      “If you specify a tools array, include AskUserQuestion for this to work.”
      ↩︎ canUseTool: routing tool calls to a person
      “Approve with changes: modify the input before execution (for example, sanitize paths, add constraints)”
      ↩︎ canUseTool: routing tool calls to a person
      “proposed PermissionUpdate entries to avoid re-prompting”
      ↩︎ canUseTool: routing tool calls to a person
      “Required workaround: dummy hook keeps the stream open for can_use_tool”
      ↩︎ canUseTool: routing tool calls to a person
      “Claude wants to use a tool that isn’t auto-approved by a permission rule or permission mode.”
      ↩︎ Checkpoint

    Continue to part 2 of 2

    Managed Agents permission policies and tool confirmations

    Spotted a mistake, or was something unclear? Tell us.