support PreToolUse allow and ask permissionDecision#20756
Closed
abhinav-oai wants to merge 2 commits into
Closed
Conversation
This was referenced May 2, 2026
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.
What
Adds support for
PreToolUsehookpermissionDecision: "allow"andpermissionDecision: "ask"outcomes while preserving the existingdenybehavior.PreToolUsehook output is parsed once incodex-hooks.ToolRegistryattaches that directive to the tool invocation before dispatch.ToolOrchestrator, where it is applied beside the existing approval requirement:allowapproves the request without running permission prompts or guardian reviewaskrequests a user prompt directly, suppressing guardian review andPermissionRequesthook evaluation for that forced promptDesign decisions
ApprovalRequest/ centralized approval-routing work instead of adding another parallel decision system. The new directive changes routing policy, while the existing approval machinery still owns prompt construction and decision handling.PreToolUseresponsible only for the hook verdict. The directive is attached to the invocation once and consumed at the approval boundary, which avoids re-running hooks or plumbing bespoke flags through unrelated layers.allowbypasses prompts and guardian review, but it does not override an approval requirement that is already classified asForbidden.askexplicitly user-facing. It bypasses guardian review and cached/automatic approval shortcuts so the hook can reliably force a human confirmation path.deferout of scope for now because this change only adds the Claude-compatible behaviors we can map cleanly onto the current approval model.