Add governed-workflow: hook-enforced safety harness for Claude Code#20
Open
AidenHiew wants to merge 2 commits into
Open
Add governed-workflow: hook-enforced safety harness for Claude Code#20AidenHiew wants to merge 2 commits into
AidenHiew wants to merge 2 commits into
Conversation
Most CLAUDE.md templates are advice the model can ignore. This bundle pairs the prose with hooks that actually enforce the rules at the harness level. Contents (under governed-workflow/): - CLAUDE.md: intent layer (operating model, hard stops, prompt-injection defence, commit workflow) - settings.json: deny-list for irreversible/destructive commands plus wiring for the four hooks - hooks/sentinel-watch.ps1: detects typed sentinel phrases that unlock pushing for the session - hooks/push-guard.ps1: two-tier branch-push gate; force-push blocked unconditionally; catches shell-wrapper evasion - hooks/secrets-guard.ps1: blocks read/edit of .env, *.pem, id_rsa, secrets, credentials and similar - hooks/session-audit.ps1: session-end audit line; clears this session's unlock flags so the next session starts locked down - README.md: install, tuning notes, and porting guidance for mac/Linux Hooks are PowerShell (Windows); the model and deny-list are cross-platform. A POSIX shell port is welcome.
These gh subcommands carry markdown --body content that frequently mentions the push command in code spans or examples, but the subcommands themselves cannot invoke a push. Short-circuit at the top of the hook so authors of PR/issue bodies don't hit a false-positive from prose-about-push.
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.
Summary
Adds governed-workflow/, a self-contained safety bundle for Claude Code:
Two-tier push gate
The model cannot type the phrase as the human, so it cannot unlock itself; flags are per-session and cleared on session end.
Caveats
Test plan