Enforce rules across compound POSIX commands - #46
Open
ronheichman wants to merge 4 commits into
Open
Conversation
ronheichman
marked this pull request as ready for review
August 28, 2026 20:13
Remove expanded interpreter input analysis, preserve detection-only script handling, and cover pipeline grouping and native hook regressions. Built with Codex.
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
Enforce shell rules against eligible static commands inside compound POSIX input. Keep direct pipeline members together and retain the complete command list for detection. Sequence rules use the same decisions and invalidate stored verdicts from the prior behavior.
Interpreter scripts, unsafe pipelines, malformed input, and compound PowerShell/CMD input remain detection-only. Both sides of
&&and||count as requested intent. Static commands in invoked function bodies can qualify independently. There are no rule-schema, wire-format, or dependency changes.Why
An enforce-enabled rule can detect
cat .envinsideecho ready; cat .env, but the existing whole-input safety check prevents a deny. Independent command evaluation closes that gap while preserving the existing interpreter restrictions.How we verified it
The compiled
hook pre-toolcommand returned three expected denies and six expected no-overrides with temporary local rules, output files, and state. The cases included compound commands, pipelines, and invalid interpreter options.The race suite, final affected tests, lint, formatting, vet, module checks, vulnerability scan, and shell fuzzing passed. macOS, Linux, and Windows builds passed. Installed-host behavior and Linux/Windows runtime tests were not exercised locally.
🤖 Built with Codex.