feat(tui): route shell and file tool approvals through typed execpolicy rules#2053
Open
greyfreedom wants to merge 11 commits into
Open
feat(tui): route shell and file tool approvals through typed execpolicy rules#2053greyfreedom wants to merge 11 commits into
greyfreedom wants to merge 11 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements a new typed permission system for shell and file tools, introducing the codewhale-execpolicy crate to manage layered rulesets and pattern matching. The system supports tool-specific decisions (allow, deny, ask) based on command prefixes and workspace-relative path globs, with integration across the TUI and app-server. Review feedback points out the use of the unstable let_chains feature in multiple files, which requires refactoring for stable Rust compatibility, and identifies a potential logic issue where legacy command rules might be duplicated during resolution.
a5625e1 to
501dc0d
Compare
This was referenced May 25, 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.
Summary
This PR wires the typed permission rules introduced in PR1 into the tool execution flow.
Shell and file-oriented tools now consult the
ExecPolicyEnginebefore falling back to the existing approval behavior. This allows persistent rules such as:exec_shellread_file,write_file,edit_file,list_dir, andapply_patchfile_read,file_write, andfile_editThis does not add the approval-prompt persistence UI yet; that remains follow-up work.
Changes
deepseek-execpolicyto the TUI crate.auto_allow,auto_deny, and[permissions.rules]from TUI config into anExecPolicyEngine.deepseek -pallowskips the existing approval promptaskforces the existing approval pathdenyblocks execution before the tool runsmulti_tool_use.parallelcalls so read-only file tools cannot bypass rules by being wrapped in a parallel call.auto_denyis applieddeny/askrules are appliedauto_allowandallowrules are ignored with warningsSafety Notes
This PR keeps project-level permission config conservative. A repository-local config can require extra approval or deny access, but it cannot grant itself persistent allow rules.
For multi-path tools such as
apply_patch, the implementation remains conservative:Tests
Validated with:
Depends On
This PR is stacked on top of PR1: feat/execpolicy-typed-rules
Part of #1186
Depends on #2046