Source: Configure permissions (Claude Agent SDK docs)
The six-step permission evaluation order of the Claude Agent SDK, allow/deny rules, and the six permission modes.
Contents
- What: official documentation page, Claude Code docs (Agent SDK section)
- Author: Anthropic
- Date: undated living docs (read 2026-11-14)
- Original: https://code.claude.com/docs/en/agent-sdk/permissions
Summary
Details how a tool call is approved or blocked: hooks, then deny rules, ask rules, the permission mode, allow rules and finally the application’s canUseTool callback. It explains the semantics of allowed_tools and disallowed_tools, path rules, and each permission mode, with several warnings about combinations that silently bypass checks.
Key claims
- Evaluation order: hooks, deny rules, ask rules, permission mode, allow rules,
canUseToolcallback. - Deny rules apply even in
bypassPermissionsmode and even when a hook returned allow. allowed_toolspre-approves listed tools but does not hide others; unlisted tools fall through to the mode and callback.- A bare name in
disallowed_toolsremoves the tool from the request; a scoped rule likeBash(rm *)denies matching calls only. - Auto-approved calls never reach
canUseTool; use aPreToolUsehook to inspect them. allowed_toolsdoes not constrainbypassPermissions: unlisted tools are approved too.- Modes:
default,dontAsk(deny instead of prompting),acceptEdits,bypassPermissions,plan, andauto(a classifier model reviews actions). - Subagents inherit plan, acceptEdits, auto or bypassPermissions from the main session; a subagent’s own
bypassPermissionsvalue is never applied. - Recommended locked-down headless setup: an explicit
allowedToolslist plusdontAskmode.