Skip to content

Superseded - #454

Closed
jamesrochabrun wants to merge 1 commit into
mainfrom
jroch-leak-guard
Closed

Superseded#454
jamesrochabrun wants to merge 1 commit into
mainfrom
jroch-leak-guard

Conversation

@jamesrochabrun

@jamesrochabrun jamesrochabrun commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Superseded. Not pursued.

@jamesrochabrun
jamesrochabrun force-pushed the jroch-leak-guard branch 2 times, most recently from 6db0d47 to 8fabc54 Compare August 16, 2026 22:11
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
jamesrochabrun deleted the jroch-leak-guard branch August 16, 2026 22:17
@jamesrochabrun jamesrochabrun changed the title Add a leak guard hook so internal names cannot reach this public repo Superseded by #455 Aug 16, 2026
@jamesrochabrun jamesrochabrun changed the title Superseded by #455 Superseded Aug 17, 2026
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.

1 participant