Repository navigation
feat(core): replace the shell classifier with fixed stops - #483
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7b5bd14aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Auto now runs every call except a short list of fixed stops: force-push and remote ref deletion, rm/mv/chmod -R of / or home, sudo and friends, disk and power commands, and commands naming credential files. Ask holds every non-read call and denies stops without asking; Full runs everything. The stops keep the tree-sitter parse and wrapper peeling, so cd/env/timeout/sh -c forms are caught. The allow/prompt/forbidden rule table is deleted, and the plan drops the per-action reviewer.
… and read $HOME in redirects
5e283bf to
2067bcb
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Replaces the shell classifier's allow/prompt/forbidden tiers with a short list of fixed stops. Stacked on #482.
What changes for users
read_onlyaskautorm,git push,curl, and dynamic commands no longer need a grant.fullThe fixed stops are: force-push or deleting remote refs;
rm -r,mv, orchmod/chown -Rof/, home, or a directory directly under either;sudo/doas/su/pkexec; disk formatting and device writes; shutdown and reboot; and any command naming~/.ssh,~/.aws,~/.gnupg,~/.netrc, gh/docker/kube config,~/.git-credentials, or QQ's credential files. A stop is a tool error:permission_denied: fixed_stop: <reason>; <what to do instead>. Do not retry it in another form.No grant lifts one.The stops reuse the existing
tree-sitter-bashparse and wrapper peeling, socd x && …,env A=b …,timeout, pipes, subshells andsh -c '…'are all caught. The docs call it an accident net, not a security boundary.The approval prompt no longer shows "asks because: …", since there are no prompt rules to report.
ShellCommandPreview.verdict/reasonsstay on the wire but are not set; removing them is left for the protocol bump in B.The plan (
docs/plans/README.md) drops the per-action reviewer and the routine list in favor of this design (see the fx/pi comparison in Direction). A user-leveldeny_shell_prefixesis marked TODO.Verification
approval/stops.rstests cover every stop bare and in 5 wrapped forms, plus false positives (rm -rf target,mv target/qq ~/bin,git push -u origin x,dd of=disk.img,cat .ssh/config).approval.rstests cover the mode table, including Auto running unknown and dynamic commands and Full running stops.sudocommand without approvals.cargo xtask checkpassed (583 s).Notes
approval/rules.rs(2.3k lines) is gone.