[BUG] Auto-mode ignores permissions.ask
Status Fixed / completed
Reported on v2.1.90
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 14 comments · opened Apr 2, 2026 · closed Aug 16, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
It is illogical that permissions.allow and permissions.deny are respected in auto-mode but not permissions.ask. All three permissions lists are configured in the same place, and if I want auto-mode to ignore permissions.ask I can simply empty out the permissions.ask array.
What Should Happen?
Auto-mode should respect permissions.ask
Error Messages/Logs
Steps to Reproduce
- Turn on auto-mode
- Specify a permissions.ask setting in your settings.json
- Prompt claude in a way that should trigger permissions.ask, but does not.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.90
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
13 Comments
I was very surprised and dismayed by this behaviour.
Additional repro:
git pushbypasses explicitaskrule in auto modeSettings:
What happened:
askrule CAN be enforceddangerouslyDisableSandbox: true: auto mode classifier allowed it without showing the yes/no confirmation dialogPreToolUsehook DID fire (showed remote info), but theaskpermission rule was bypassedExpected: The
askrule should still show the confirmation dialog in auto mode. The hook fired correctly — only theaskpermission was ignored.Workaround: Behavioral — the model must explicitly ask "About to push, confirm?" in text before running the command. This is fragile since it depends on the model remembering to do it.
Version: Claude Code latest (Opus 4.6), macOS, 2026-04-13
Still reproduces on 2026-04-17 (Opus 4.7, 1M context)
Verified the bug persists on the latest Opus release. The model version bump (4.6 → 4.7) did not fix it.
Same setup, same result:
permissions.askonBash(git push*)✓ configuredBash(git push*)✓ fires (confirmed viaadditionalContextinjection showing branch + upstream)git push --dry-run origin HEAD:test-branchwithout rendering the approval dialogAdditional testing — classifier interprets
autoMode.environmenttext unpredictably:Tried several phrasings to coax a dialog:
|
autoMode.environmenttext | Classifier result ||---|---|
| (nothing about pushes) | Silent allow |
| "ALWAYS defer to permissions.ask dialog, do NOT auto-execute" | Hard deny with reason "must defer to permissions.ask" |
| "ALLOW all variants through to the permissions layer" | Silent allow |
None produced a dialog. The classifier's output space appears limited to allow/deny — it can't route to "ask" even when
permissions.askis explicitly configured.Per Anthropic docs, this is by design:
— permission-modes.md
So
permissions.askis effectively a no-op in auto mode. The docs and the behavior agree, but this contradicts user expectation when bothaskandautoModeare configured together — either the user means "ask even in auto" or the config surface should make the conflict visible.Current workaround (adding here for future readers):
Put the gate in
autoMode.soft_deny— the classifier respects it and denies with a helpful prompt telling the user to toggle auto mode off:Works, but it's a double-negative: auto mode denies so default mode can prompt.
Suggested fix: either (a) let
permissions.askrender its dialog in auto mode with a single yes/no gate, or (b) addautoMode.askas a first-class option so the classifier can explicitly route to dialog instead of being forced into binary allow/deny.Workaround: a PreToolUse hook that emits
permissionDecision: "ask"still prompts in auto mode. The bypass affects only the staticpermissions.asklist; hook-emitted decisions are honored.Example: https://github.com/chrisguillory/claude-workspace/blob/45469aa/hooks/ask-before-auto-approval.py
If this is indeed by design, the design needs a re-think, especially since auto-mode has become the default. Auto mode is nice in that it bypasses a lot of unnecessary permissions prompts. I don't need to see a prompt every time Claude Code writes a script to perform some task and that script happens to contain a comment and a backslash. That's where it's useful. But if any
askpermissions are configured, it should be obvious that bypassing the permissions prompt for such items is always the wrong thing to do.Personally, I review every commit and some adds. So, I've gone to great trouble to set
askpermission ongit commitandgit add. I say great trouble, because in order for my permissions to be honored, I've had to explicitly denygit -C,git --work-tree, etc. due to limitations in the permissions system. This also means that I have to steer Claude Code from time to time when it tries to rungit -C, gets denied, and assumes that it isn't allowed to use git. This is why I say I've gone to great trouble to ensure that I get asked about all commits, and I'm not happy about my effort being thrown away.For the last 2–3 days, auto mode seems to have started to work the way everyone in this thread has asked for it to work. E.g. since I have
git pushinpermissions.ask, now I'm prompted every time, including in auto mode.IMHO this is a pretty big step back! If I say "it's OK to
git pushto a feature branch", I _want_ the auto classifier to approve those specific tool usages.On the other hand, I would always want to be asked about a
git push --force, so I completely understand the point raised by this issue.My only apparent workaround right now is to remove
git pushfrompermissions.ask, which reduces the safety of every session.Maybe what's needed is a distinction between a "soft ask" that can be approved by the auto-mode classifier, and a "hard ask" that can only be approved by the user.
@aaronadamsCA: It seems like the new way is to use the new auto-mode soft-deny feature. This seems to pop up a permissions prompt for me--presumably because I also have ask configured.
I hit this as well; very surprising that what I have explicitly configured in
askgets auto-approved (e.g.brew installshould always ask; I don't want the auto mode making any decisions on this)The bug seems to be fixed. I noticed that in v2.1.143 of claude code auto-mode is correctly honoring rules defined in
persmissions.askand it correctly prompt for explicit permission.Still reproduces on v2.1.175 (model: claude-fable-5, Linux/WSL2), so this either regressed after the fix mentioned above or was never fully fixed.
In auto mode, with this in
~/.claude/settings.json:```json
"ask": ["Bash(git push --force-with-lease*)"]
git add <file> && git commit -m "<msg>" 2>&1 | tail -3 && git push --force-with-lease origin <branch> 2>&1 | tail -3
Still reproduces on v2.1.181 (Claude Opus 4.7 via Amazon Bedrock, macOS) - and unline @terence-microej's report above this is not a sandbox-network path, it's the plain Bash tool with no sandbox.network.allowedDomains involved.
Setup in
~/.claude/settings.json:Session started in
default, switched toautomid-task after a plan-mode approval. Later in the same session Claude ran, with no prompt at all:Both calls match an explicit
askrule, both should have prompted per permission-modes docs (https://code.claude.com/docs/en/permission-modes.md) ("Explicit ask rules still force a prompt"), neither did. The session JSONL contains thetool_use + tool_resultfor each call with nopermissionDecisionentry in between - they were silently approved.The
Bash(git *)allow rule appears to be winning over the more specific ask rules in auto mode, which contradicts the documented "deny -> ask -> allow" precedence. It does not repro indefaultmode with the same settings - the samegit commit/git pushcalls prompt as expected.Workaround used: a PreToolUse hook emitting
permissionDecision: "ask"(as @GC-Scott earlier comment) - still works on 2.1.181.Hi Redysz,
What you're describing is actually different. When Claude ran "git -C ..." it matched your allow rule, not your ask rule because the rule matches on text, not on intelligence. The call didn't start with "git commit" because there was a -C in the middle. If you want to avoid such issues, you'll need a deny rule on "git -C" and some guidance for Claude to help it understand that when it calls git and gets denied that git isn't the denial, it's the -C.
________________________________
From: Karol Kurek @.*>
Sent: Tuesday, June 30, 2026 5:34 AM
To: anthropics/claude-code @.*>
Cc: Severance, Scott @.>; Mention @.>
Subject: [EXTERNAL] Re: [anthropics/claude-code] [BUG] Auto-mode ignores permissions.ask (Issue #42797)
[https://avatars.githubusercontent.com/u/25427869?s=20&v=4]Redysz left a comment (anthropics/claude-code#42797)<https://github.com/anthropics/claude-code/issues/42797#issuecomment-4841913716>
Still reproduces on v2.1.181 (Claude Opus 4.7 via Amazon Bedrock, macOS) - and unline @terence-microej<https://github.com/terence-microej>'s report above this is not a sandbox-network path, it's the plain Bash tool with no sandbox.network.allowedDomains involved.
Setup in ~/.claude/settings.json:
{ [...]
"permissions": {
"allow": ["Bash(git *)", ...],
"ask": ["Bash(git commit )", "Bash(git push )", "Bash(git push --force )", "Bash(git push -f )", ...]
}
}
Session started in default, switched to auto mid-task after a plan-mode approval. Later in the same session Claude ran, with no prompt at all:
git -C /abs/path commit -m "..."
git -C /abs/path push -u origin <feature-branch>
Both calls match an explicit ask rule, both should have prompted per permission-modes docs (https://code.claude.com/docs/en/permission-modes.md) ("Explicit ask rules still force a prompt"), neither did. The session JSONL contains the tool_use + tool_result for each call with no permissionDecision entry in between - they were silently approved.
The Bash(git *) allow rule appears to be winning over the more specific ask rules in auto mode, which contradicts the documented "deny -> ask -> allow" precedence. It does not repro in default mode with the same settings - the same git commit/git push calls prompt as expected.
Workaround used: a PreToolUse hook emitting permissionDecision: "ask" (as @GC-Scott<https://github.com/GC-Scott> earlier comment) - still works on 2.1.181.
—
Reply to this email directly, view it on GitHub<https://github.com/anthropics/claude-code/issues/42797?email_source=notifications&email_token=BGKRJB4OW46AQXSZZQWVZJD5COCUBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBUGE4TCMZXGE3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4841913716>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BGKRJB7IG3HOY3RE6376X635COCUBAVCNFSNUABFKJSXA33TNF2G64TZHM4TGNZSGUZTINZVHNEXG43VMU5TIMJZG4YDIMZYGUYKC5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/BGKRJBYIE3RJEKJZ4NZOHQL5COCUBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBUGE4TCMZXGE3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/BGKRJB5EBEQ6WK5Z2LOQ6WT5COCUBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOBUGE4TCMZXGE3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: @.***>
I have been investigating this on v2.1.214 (macOS,
defaultMode: "auto").permissions.askseems to be partially respected in auto mode.** An ask rule can fire; when it does, the prompt shows:Ask rule Bash(git push:*) overrides auto mode for this command.However, other times the command is simply approved. If I explicitly authorize the agent to run the command with something like, "implement the plan, commit, then push", it is likely to auto-approve.
But when later in the same session it may auto-approve pushes, even if I've told it I don't want that.
I don't think it is just caching based on an exact string match. I explicitly tested with some commands that had never been approved before (such as adding
--verbose) and some of those were approved. But other times (such as adding--dry-run) they prompted me.I also tried closing and resuming the session. But the behavior was similarly inconsistent after doing that.
I think the current state is the worst of both worlds: