Skip to content

Enforce rules across compound POSIX commands - #46

Open
ronheichman wants to merge 4 commits into
perplexityai:mainfrom
ronheichman:psi/enforce-compound-shell-commands
Open

Enforce rules across compound POSIX commands#46
ronheichman wants to merge 4 commits into
perplexityai:mainfrom
ronheichman:psi/enforce-compound-shell-commands

Conversation

@ronheichman

@ronheichman ronheichman commented Aug 28, 2026

Copy link
Copy Markdown

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 .env inside echo 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-tool command 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.

@ronheichman
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants