feat(security): implement shell execution policy and runtime bypass guardrails - #4
Merged
Merged
Conversation
…uardrails - Revoke run_command from P1-P4 personas to enforce PoLP - Implement plan-guard.mjs PreToolUse hook intercepting run_command (S-01, S-02, S-03) - Harden branch-guard.mjs isArtifactPath to block workspace path escapes (S-04) - Register plan-guard in hooks.json and validate in validate-docs.sh - Add scripts/test-runtime-guardrails.mjs test suite Closes #3
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.
Closes #3
📌 Summary
Branch:
feat/issue-3-shell-execution-guardrails→mainType:
feat(security)Related Issue: #3 feat(security): implement shell execution policy and runtime bypass guardrails
run_commandfrom Inception persona P4 (p4-system-architect.md), confining shell execution strictly to delivery personas P5 and P6.plan-guard.mjs): Interceptsrun_commandto reject airbag circumvention (--no-verify,-n), hook path overrides (-c core.hooksPath,GIT_HOOKS_PATH), and direct commits/pushes to protected branches (main,master), closing findings S-01, S-02, and S-03.branch-guard.mjs): HardenedisArtifactPathto eliminate looseendsWithchecks and strictly validate external brain artifact canonical paths, preventing path evasion onmainand closing finding S-04.scripts/test-runtime-guardrails.mjsverifying 18 deterministic test vectors across PoLP, plan-guard, and branch-guard.📂 Affected Files
.agent/personas/p4-system-architect.md+1 -1run_command(PoLP).agent/hooks/branch-guard.mjs+40 -35.agent/hooks/plan-guard.mjs+144 -0.agent/hooks.json+16 -0plan-guardhook forrun_commandscripts/validate-docs.sh+1 -0plan-guard.mjsscripts/test-runtime-guardrails.mjs+276 -0✅ Quality Airbag —
./scripts/quality-check.sh./scripts/validate-docs.sh⚡ FinOps & Agent Efficiency
📸 UI Snapshots / Roborazzi Visual Diffs
N/A — Pure runtime governance, persona security, and hook enforcement changes. Zero UI or composable modifications.
Caution
Zero Auto-Merge — Explicit approval required.
This PR will NOT be merged until the author explicitly confirms: "Tu peux merger" or equivalent.
Persona 6 presents this PR link and stops. Merge is a deliberate human action.