Skip to main content

Module 08: Permission Modes

Controlling how Claude handles tool execution permissions.

What You’ll Learn

  • The four permission modes and when to use each
  • How permission modes affect tool execution
  • Best practices for production vs development

Permission Modes

Using Permission Modes

Mode Details

DEFAULT

  • Prompts for every tool use
  • Best for interactive CLI sessions
  • User must approve each operation

ACCEPT_EDITS

  • Auto-approves file editing tools (Read, Write, Edit)
  • Still prompts for shell commands (Bash)
  • Good balance of automation and safety

BYPASS_PERMISSIONS

  • Skips all permission prompts
  • Most common for SDK usage
  • Use with allowedTools/disallowedTools for safety

DANGEROUSLY_SKIP_PERMISSIONS

  • Uses a different CLI flag (--dangerously-skip-permissions) than BYPASS_PERMISSIONS (--permission-mode bypassPermissions)
  • Both skip permission prompts; the behavioral difference is minimal
  • The explicit “dangerous” naming serves as a code-level warning to reviewers
  • Intended for fully sandboxed environments (containers, VMs) without network access
  • Use BYPASS_PERMISSIONS for most automated use cases; reserve this for true sandboxes

Best Practices

Combining with Tool Permissions

For maximum safety, combine permission modes with tool restrictions:

Tradeoffs

  • DEFAULT mode provides safety but blocks automation - Claude waits for approval that never comes in non-interactive contexts.
  • BYPASS_PERMISSIONS is required for automation but shifts responsibility to your code for safety (use tool restrictions).
  • Permission modes are session-wide. You cannot require approval for some tools while bypassing others (use permission callbacks for fine-grained control - see Module 13).
  • No audit log is generated when permissions are bypassed. Implement your own logging if needed.
  • Claude may still refuse unsafe operations even with permissions bypassed, based on its training.

Source Code

View on GitHub

Running the Example

Next Module

Module 09: Structured Outputs - Get Claude to return structured JSON responses.