-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Refactor execpolicy fallback evaluation #7544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
00d6382 to
505b845
Compare
65b6984 to
0d121de
Compare
505b845 to
09a1786
Compare
09a1786 to
d49a447
Compare
86b1d98 to
31c5e11
Compare
d49a447 to
01a8814
Compare
bolinfest
approved these changes
Dec 4, 2025
1cc4c2d to
27804c3
Compare
Add explicit prefix-approval decision and wire it through execpolicy/UI snapshots update doc mutating in memory policy instead of reloading using RW locks clippy refactor: adding allow_prefix into ApprovedAllowPrefix fmt do not send allow_prefix if execpolicy is disabled moving args around cleanup exec_policy getters undo diff fixing rw lock bug causing tui to hang updating phrasing integration test . fix compile fix flaky test fix compile error running test with single thread fixup allow_prefix_if_applicable fix formatting fix approvals test only cloning when needed docs add docstring fix rebase bug fixing rebase issues Revert "fixing rebase issues" This reverts commit 79ce7e1. fix rebase errors
c12dd09 to
4488061
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refactor of the
execpolicycrateTo illustrate why we need this refactor, consider an agent attempting to run
apple | rm -rf ./. Supposeappleis allowed byexecpolicy. Before this PR,execpolicywould considerappleandpearand only render one rule match:Allow. We would skip any heuristics checks onrm -rf ./and immediately approveapple | rm -rf ./to run.To fix this, we now thread a
fallbackevaluation function intoexecpolicythat runs when noexecpolicyrules match a given command. In our example, we would runfallbackonrm -rf ./and preventapple | rm -rf ./from being run without approval.