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?
When everything asks for approval, people stop paying attention and approve by habit. That is why Claude Code users approve 93% of prompts. The incidents came from an overeager agent, not hostile intent, so some checkpoint is still needed. The aim is to save the person's attention for risky actions. Removing prompts completely means nobody stops the deleted branch before it happens.
“Over time that leads to approval fatigue, where people stop paying close attention to what they're approving.”Source: www.anthropic.com
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.
| Mode | What runs without asking | Best for |
|---|---|---|
| default | Reads only | Reviewing every action yourself, sensitive work |
| acceptEdits | Reads, file edits, and common filesystem commands (mkdir, touch, mv, cp, etc.) | Iterating on code you're reviewing |
| plan | Reads, plus classifier-approved commands when auto mode is available | Exploring a codebase before changing it |
| auto | Everything, with background safety checks | Long tasks, reducing prompt fatigue |
| dontAsk | File reads inside your working directories and pre-approved tools; anything that would prompt is denied | Locked-down CI and scripts |
| bypassPermissions | Everything | Isolated 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.
The modes differ in how much they take away from the person. plan holds back edits until a plan is approved. acceptEdits approves edits. auto hands approval to a classifier. dontAsk turns prompts into denials for runs with nobody present. bypassPermissions skips almost every prompt, so it belongs only in isolated environments.
“dontAsk | File reads inside your working directories and pre-approved tools; anything that would prompt is denied | Locked-down CI and scripts”Source: code.claude.com
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?
An explicit ask rule is one of the checkpoints no mode auto-approves, so it still applies when someone changes the mode. Blocking bypassPermissions still leaves auto mode, where the classifier can approve the push. A deny rule blocks the push without asking anyone. dontAsk denies would-be prompts instead of waiting for a person.
“Ask rules prompt for confirmation whenever Claude Code tries to use the specified tool.”Source: code.claude.com
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?
Correct answer: A — Set permissionMode to "dontAsk" and list the CI-safe tools in allowedTools, so listed calls run automatically and everything else is denied without ever reaching canUseTool.
- A. Correct. dontAsk converts any call not pre-approved by allowedTools, settings.json allow rules, or a hook into an outright denial and never calls canUseTool, which is exactly the unattended behavior the pipeline needs.
- B. Incorrect. Omitting a callback under default mode is not documented to resolve as an automatic denial; default mode expects canUseTool to be present to answer unmatched calls.
- C. Incorrect. acceptEdits only auto-approves file edits and specific filesystem commands; anything else still falls through to canUseTool rather than being denied, which would hang an unattended run.
- D. Incorrect. plan mode still runs read-only tools normally and routes file-edit or shell-write tools to canUseTool, so approval prompts are not eliminated and CI triage needing real tool calls would stall.
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.
| Step | What it does to a call |
|---|---|
| 1. Hooks | Custom code that can allow, deny, or modify the tool request |
| 2. Deny rules | Block matching calls; nothing later can lift the block |
| 3. Ask rules | Send matching calls for confirmation |
| 4. Permission mode | bypassPermissions approves what reaches it; acceptEdits approves file operations; plan sends file-edit and shell-write tools to canUseTool; other modes fall through |
| 5. Allow rules | A bare allowedTools entry such as "Read" approves the whole tool |
| 6. canUseTool callback | Asks 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
allowedToolsentry such as"Read"approves the whole tool before the callback is consulted. If you allow a tool and expectcanUseToolto 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
canUseToolcannot 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.
No person decides. The call matches no allow rule, so it would normally prompt. dontAsk denies every call that would prompt, and canUseTool is never called. The push is refused immediately and the job keeps running.
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?
The first step that reaches a decision settles the call. A bare allowedTools entry approves the whole tool at step five, so the call never reaches the callback at step six. A deny rule can't be lifted by the callback. bypassPermissions approves calls itself at the mode step, so it doesn't pass them to the callback.
“Claude wants to use a tool that isn’t auto-approved by a permission rule or permission mode.”Source: code.claude.com
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?
Correct answer: A — Register a PreToolUse hook scoped to the wire-transfer tool that returns permissionDecision "ask" for every call, since hooks execute before deny rules, ask rules, the permission mode check, and allow rules, and their decision holds even under bypassPermissions.
- A. Correct. Hooks run first in the evaluation order and a PreToolUse hook's decision applies regardless of permission mode, including bypassPermissions, guaranteeing the prompt for this tool.
- B. Incorrect mechanism. A bare allow-rule entry auto-approves every matching call and the call never reaches canUseTool, so this design silently removes the intended approval step.
- C. Incorrect. acceptEdits only auto-approves file edits and specific filesystem commands; other tools still fall through to normal permission handling, which could still resolve via an existing allow rule rather than always prompting.
- D. Incorrect. Deny rules are evaluated before canUseTool in the flow, so the callback has no mechanism to reverse a deny decision for a specific call.
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?
Correct answer: A — Run the session with permissionMode "plan" so Claude investigates with read-only tools, while every file-edit or shell-write call is routed to the canUseTool callback for her review, even when an allow rule matches.
- A. Correct. In plan mode Claude explores with read-only tools but file edits are never auto-approved, even when an allow rule matches; they prompt through the canUseTool callback, so her application receives each proposed edit and she can approve it before anything is written.
- B. Incorrect. acceptEdits writes files immediately without a pre-write review step, which violates the requirement that no file change happen before her explicit approval.
- C. Incorrect. Manually deny-listing and unlisting every source path is impractical at scale and does not give per-diff review of the exact content of each proposed change.
- D. Incorrect claim. Deny rules are also evaluated before the permission-mode step, not just ask rules, so the statement misdescribes the evaluation order, and this setup is a needlessly risky way to reach the same outcome as plan mode.
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.
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.
| Response | Python | TypeScript |
|---|---|---|
| Allow | PermissionResultAllow(updated_input=...) | { behavior: "allow", updatedInput } |
| Deny | PermissionResultDeny(message=...) | { behavior: "deny", message } |
Those two shapes support six reviewer actions:
- Approve: let the tool run as Claude requested.
- Approve with changes: edit the input before execution, for example to sanitise a path or add a constraint.
- Approve and remember: send back a rule from the context's
suggestionsso matching calls skip the prompt next time. - Reject: block the tool and tell Claude why.
- Suggest an alternative: block the call but point Claude towards what the user wants instead.
- 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")An allow result carries the input the tool will run with, in Python as PermissionResultAllow(updated_input=...). It can be Claude's original input or a version the reviewer edited. A message belongs to a deny result, and Claude reads it as the reason for the refusal. Suggestions come in on the context and hold rules for 'approve and remember'. behavior is the TypeScript key, not a Python argument.
Source: code.claude.comSources5
Sources
(5)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://code.claude.com/docs/en/permission-modesOfficial docs
“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.https://www.anthropic.com/engineering/claude-code-auto-modeSecondary source
“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.https://code.claude.com/docs/en/permissionsOfficial docs
“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.
“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.https://code.claude.com/docs/en/agent-sdk/user-inputOfficial docs
“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