claude-code - 💡(How to fix) Fix [BUG] Deny list bypassed when skipAutoPermissionPrompt: true is set [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45426Fetched 2026-04-09 08:05:43
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

Error Message

Error Messages/Logs

No error — command runs successfully when it should be blocked

  1. Expected: blocked with permission error

Code Example

# No error — command runs successfully when it should be blocked
  $ cd /tmp/deny-list-repro
  $ claude -p "Run python3 -c \"print('hello')\" using the Bash tool"
  Output: `hello`
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Tools in the project-level deny list (.claude/settings.json → permissions.deny) are not blocked when skipAutoPermissionPrompt: true is set in user-level ~/.claude/settings.json. The denied command executes successfully instead of being hard-blocked.

This also reproduces in non-interactive mode (claude -p), where there is no TTY to prompt on — denied tools silently auto-approve.

What Should Happen?

Deny-listed tools should be unconditionally blocked regardless of:

  • skipAutoPermissionPrompt setting
  • Interactive vs non-interactive mode (-p flag)
  • User-level vs project-level settings

The deny list should be a hard gate, not a "would prompt but skip" gate.

Error Messages/Logs

# No error — command runs successfully when it should be blocked
  $ cd /tmp/deny-list-repro
  $ claude -p "Run python3 -c \"print('hello')\" using the Bash tool"
  Output: `hello`

Steps to Reproduce

  1. Create a project with a deny list: mkdir -p /tmp/deny-list-repro/.claude && cd /tmp/deny-list-repro && git init cat > .claude/settings.json << 'EOF' { "permissions": { "allow": ["Bash(echo *)"], "deny": ["Bash(python3 *)"], "defaultMode": "auto" } } EOF

  2. Ensure user-level settings have skipAutoPermissionPrompt:

~/.claude/settings.json should contain:

"skipAutoPermissionPrompt": true

  1. Run: claude -p "Run python3 -c "print('hello')" using the Bash tool"

  2. Expected: blocked with permission error

  3. Actual: prints hello — deny list bypassed

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.96 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

The deny list pattern Bash(python3 *) is in the project-level .claude/settings.json. The user-level ~/.claude/settings.json does not have a corresponding deny entry but has skipAutoPermissionPrompt: true. It appears the combination causes denied tools to be auto-approved instead of hard-blocked.

extent analysis

TL;DR

The issue can be fixed by ensuring that the deny list is checked regardless of the skipAutoPermissionPrompt setting.

Guidance

  • Review the permission checking logic to ensure it prioritizes the deny list over the skipAutoPermissionPrompt setting.
  • Verify that the deny list is being correctly parsed and applied in both interactive and non-interactive modes.
  • Consider adding an explicit check for denied tools before executing commands, to ensure they are always blocked.
  • Test the fix by reproducing the steps to reproduce and verifying that the denied tool is now correctly blocked.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue may be related to the interaction between project-level and user-level settings, and the skipAutoPermissionPrompt setting may be overriding the deny list. Further investigation is needed to determine the root cause.

Recommendation

Apply a workaround to ensure the deny list is checked regardless of the skipAutoPermissionPrompt setting, as this will provide a more secure default behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING