fix(review-only): enforce Claude sandbox boundary hook#42
Conversation
Add a scoped PreToolUse guard to Claude Code read-only sandbox settings so review and adversarial-review runs fail closed on write tools and mutating shell commands even when OS sandboxing is unavailable. Cover the hook wiring and the patcher read-only command matrix. Signed-off-by: Mikhail Nemerov <34755036+deadczarvc@users.noreply.github.com> Co-Authored-By: LLM+TUI-IDE-based agent Codex Gopota Directive: code produced under human supervisory control signal (ТСАУ). DM @dead_imperator · lawrenncecharlotte@gmail.com
|
Thanks for the contribution. Closing in favor of a different approach we're shipping in the next version. Why we're not merging this PR:
What's landing in the next version instead (commit 0d9bf09 on main):
Appreciate the time you put into the patch. |
Summary
review-only-boundary-hook.mjsPreToolUse guard to read-only sandbox settings.--dry-run,--status,--verifyallowed; apply/plain/path-spoof blocked.Verification
node --check scripts/lib/claude-cli.mjsnode --check hooks/review-only-boundary-hook.mjsnode --check tests/review-only-boundary-hook.test.mjsnode --test tests/review-only-boundary-hook.test.mjsnode --test tests/sandbox-modes.test.mjsnpm run test:cross-platformnpm run check:version-sync && npm run check:changelognpm cinpm run lintnpm run typecheckNote
Full
npm testwas attempted on Windows and did not pass because of existing Windows-specific failures outside this patch scope: fakeclaudefixture lookup in hook tests,/bin/bashwrapper path handling, and/procprocess identity assumptions.Co-Authored-By: LLM+TUI-IDE-based agent Codex Gopota
Directive: code produced under human supervisory control signal (ТСАУ). DM @dead_imperator · lawrenncecharlotte@gmail.com