Superseded - #454
Closed
jamesrochabrun wants to merge 1 commit into
Closed
Conversation
jamesrochabrun
force-pushed
the
jroch-leak-guard
branch
2 times, most recently
from
August 16, 2026 22:11
6db0d47 to
8fabc54
Compare
This repository is public, and published git text is not reliably retractable. This adds a fast local guard so a configured term cannot reach a commit message, a staged path, or an added line. - `scripts/git_hooks/commit-msg` scans the commit message. - `scripts/git_hooks/pre-commit` scans staged paths and added lines. - `scripts/git_hooks/leak_guard.py` is the shared scanner. - `scripts/install-git-hooks.sh` points `core.hooksPath` at the tracked directory, so the guard is version-controlled and shared rather than living untracked in `.git/hooks`. Run once per clone. Terms are stored as SHA-256 hashes in `blocked-terms.sha256`, never as plaintext: a readable denylist in a public repo would defeat its own purpose. Hashing resists casual grep and search indexing; it is not meant to withstand a dictionary attack. `--add-term` prompts for the term instead of taking argv, so it never lands in shell history. Matching is on whole alphanumeric tokens of the lowercased text, which covers the realistic shapes (prose, paths, `org/repo#123`, CamelCase run together) while a term buried mid-word is deliberately out of scope, to keep false positives near zero. The guard is regex-only and instant. It does not run tests -- that stays the agent's responsibility, per the existing policy, and CLAUDE.md is updated so the note about hooks stays accurate. Hooks cannot see PR bodies or issue comments, since those never pass through git. `leak_guard.py --stdin` is provided so that prose can be checked before it is published. Verified: blocks a configured term in a commit message and in a staged file, passes clean text, does not false-positive on similar-looking words, and `--no-verify` still bypasses.
jamesrochabrun
force-pushed
the
jroch-leak-guard
branch
from
August 16, 2026 22:12
8fabc54 to
a81eeef
Compare
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.
Superseded. Not pursued.