Repository navigation
Fix Claude Code permissions.ask rules being ignored in full access - #4764
Merged
ymichael merged 2 commits intoOct 15, 2026
Merged
Conversation
Commands marked "always ask" in Claude Code's settings (`permissions.ask`) still ran without a prompt in full access threads. In this mode Claude Code only asks bb about requests the user configured to be asked about, such as ask rules and PreToolUse hooks answering "ask", but bb approved all of them itself. Claude Code alone does prompt for these in its equivalent mode. bb now shows these requests in full access threads too. Everything else in full access is unchanged, because Claude Code doesn't ask about it. When running as root, bb keeps approving requests itself: Claude Code refuses bypassPermissions for root, so bb runs those sessions in "default" mode and stands in for bypass.
stefanroex
force-pushed
the
claude-code-permissions-ask-full-access
branch
from
October 7, 2026 08:15
981a8ce to
cfae65f
Compare
The new full access permission tests faked the user id with process.getuid, which doesn't exist on Windows, so they crashed in the Windows CI job. The ask-rule test now only fakes the user id where it exists, and the root test is skipped on Windows because Windows has no root user, matching the existing SdkSession tests.
ymichael
added a commit
that referenced
this pull request
Oct 24, 2026
## Human comments ## What was wrong Since #4764 (0.47), the Claude Code bridge forwards every `canUseTool` request in Full Access to the user, so that `permissions.ask` rules prompt. That PR assumed Claude Code asks only about ask rules and PreToolUse hooks that answer "ask" in `bypassPermissions`. It also asks on some of its own built-in safety checks. On CLI 2.1.309, `W=/tmp/x; for d in a b; do echo $d; done; rm -f $W/*.log` reaches `canUseTool` with "Dangerous rm operation on possibly-empty variable path…", although the same `rm` alone does not. Full Access threads and automations now stop for approval on these. A user reported this on Discord ("A variable in this command can't be checked before it runs", "This command changes directory before running a version-control command…"), and it hit one of our own Full Access threads too. bb can't approve only the safety checks while keeping ask-rule prompts. The SDK drops the control request's `decision_reason_type` before calling `canUseTool`, so a plain ask rule, a hook "ask", and a safety check differ only in free-form `decisionReason` text. ## What changed - New Claude Code provider setting **Approvals in Full Access** (`fullAccessApprovalsEnabled`), off by default. - Off: Full Access approves every request Claude Code sends, as before 0.47. - On: keeps #4764's behaviour and shows ask rules, hook "ask" answers, and safety checks. - Running as root: Full Access still always approves, since Claude Code refuses `bypassPermissions` there. - The value travels in `providerOptions` like `sandboxEnabled` and sits with the bridge's live session settings, so a change applies from the next turn without restarting Claude. `HOST_DAEMON_PROTOCOL_VERSION` is unchanged. - Docs: `docs/configuration.md`, the providers guide, and the claude-code-provider skill. ## How you verified - `pnpm exec turbo run typecheck test lint --filter=bb-plugin-provider-claude-code`: 406 tests pass. `pnpm exec turbo run test --filter=@bb/server -- test/threads/thread-runtime-config.test.ts`: 33 pass. - New bridge test: in Full Access a safety-check request is approved without a prompt by default, and is forwarded after a turn turns the setting on. It fails without the bridge change. - Reproduced the cause against the Agent SDK directly with bb's launch options (CLI 2.1.309, streaming input, `bypassPermissions`). The compound `rm` command reached `canUseTool`, and the simpler variants did not. - Manually QA'd in a source dev app, with a real Full Access Claude Code thread running the command above: 1. Setting off: the command ran with no prompt. 2. Setting turned on with the CLI: the next turn showed the "Dangerous rm…" approval card, and Deny worked. 3. Setting toggled off in Settings → Plugins → Claude Code provider (still off after a reload): the command ran with no prompt again. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
I'm improving how the Claude Code provider follows Claude Code's own permission settings and patterns. This is the last PR in the series and builds on #4628 and #4630, which are merged. Related: #4629.
What was wrong
In a Full Access thread, add
"ask": ["Bash(*askprobe*)"]to the project's.claude/settings.jsonand ask Claude to runecho askprobe: it runs without a prompt. Claude Code does ask in its own full access mode (bypassPermissions), as documented, but bb approved every full access request itself.What changed
bb now shows these requests in full access threads too. Nothing else starts prompting: in
bypassPermissionsClaude Code only asks about ask rules and PreToolUse hooks that answer "ask". As root, bb keeps approving requests itself, because Claude Code refusesbypassPermissionsthere and bb runs those sessions indefaultmode.Worth noting: an unattended full access thread, such as an automation, now waits at such a command until someone answers.
How you verified
pnpm exec turbo run typecheck test --filter=bb-plugin-provider-claude-codepasses all 368 tests.echo askprobeprompted andls -laran without a prompt.