Leak Check
Scan what is about to leave your machine — the staged diff, or the text you're
about to paste somewhere public. Two categories, different remedies.
1. Secrets
Grep the diff for: api[_-]?key, secret, token, password, passwd,
credential, BEGIN [A-Z ]*PRIVATE KEY, AKIA[0-9A-Z]{16}, ghp_, sk-,
Bearer , connection strings (://user:pass@host), and long base64/hex blobs.
For each hit, decide: real secret or placeholder?
- Real secrets move to env or a secrets manager — never the repo. Reference
them by variable name.
- Already committed means COMPROMISED. Rotate it. Deleting the line does not
help — the value is in the history, on every clone, and in any fork or CI cache.
Rotation is the fix; removing the line is cleanup.
- Add a pre-commit secret scanner so the next one is caught mechanically, and
put the file pattern in
.gitignore.
2. Non-public context
Quieter than secrets and just as hard to retract once published:
- PII — real names, emails, phone numbers, customer or employee identifiers.
- Absolute and personal paths —
/Users/<name>/…, ~/projects/<repo>. These
also just break for everyone else.
- Internal infrastructure — hostnames, private URLs, IPs, account/project IDs,
ARNs, cluster names.
- Employer-specific names — tables, buckets, datasets, services, teams,
internal ticket IDs.
- Machine-local context — env dumps, cloud/CLI config files, transcripts, raw
logs.
Replace with placeholders that still communicate shape: user@example.com,
<account-id>, db.events, ${PLUGIN_ROOT}.
Where it actually leaks
The diff is the obvious surface. These are the ones people miss:
- Real command output pasted as an example in a README, docstring, or skill —
the most common leak in documentation.
- Test fixtures built from a production export.
- Commit messages and PR descriptions — not part of the diff, still public.
- Screenshots — a terminal or browser tab captures far more than the subject.
- Error messages and stack traces that embed a full path or a query with real
values.
- Lockfiles and configs pointing at a private registry with a token in the URL.
Judgement
Public-vs-private is contextual, and reversibility is asymmetric: leaving a detail
out costs a follow-up question, publishing one cannot be undone. When unsure,
redact and ask.
Source
Adapted from secret-scan in
loopkit by Archive228 (MIT, © 2026 —
notice in LICENSE). The secret patterns and the
rotate-don't-delete rule come from there; the non-public-context section and the
leak surfaces above are additions.
Pairs with
writing-commit-messages — the message is public too.
pr-from-diff — same review, at PR scope.
1---2name: leak-check3description: Catch secrets, PII, and non-public context in a diff before it is committed or published. Use before any commit, and before pasting output anywhere public.4---5# Leak Check67Scan what is about to leave your machine — the staged diff, or the text you're8about to paste somewhere public. Two categories, different remedies.910## 1. Secrets1112Grep the diff for: `api[_-]?key`, `secret`, `token`, `password`, `passwd`,13`credential`, `BEGIN [A-Z ]*PRIVATE KEY`, `AKIA[0-9A-Z]{16}`, `ghp_`, `sk-`,14`Bearer `, connection strings (`://user:pass@host`), and long base64/hex blobs.1516For each hit, decide: real secret or placeholder?17181. **Real secrets move to env or a secrets manager** — never the repo. Reference19 them by variable name.202. **Already committed means COMPROMISED.** Rotate it. Deleting the line does not21 help — the value is in the history, on every clone, and in any fork or CI cache.22 Rotation is the fix; removing the line is cleanup.233. **Add a pre-commit secret scanner** so the next one is caught mechanically, and24 put the file pattern in `.gitignore`.2526## 2. Non-public context2728Quieter than secrets and just as hard to retract once published:2930- **PII** — real names, emails, phone numbers, customer or employee identifiers.31- **Absolute and personal paths** — `/Users/<name>/…`, `~/projects/<repo>`. These32 also just break for everyone else.33- **Internal infrastructure** — hostnames, private URLs, IPs, account/project IDs,34 ARNs, cluster names.35- **Employer-specific names** — tables, buckets, datasets, services, teams,36 internal ticket IDs.37- **Machine-local context** — env dumps, cloud/CLI config files, transcripts, raw38 logs.3940Replace with placeholders that still communicate shape: `user@example.com`,41`<account-id>`, `db.events`, `${PLUGIN_ROOT}`.4243## Where it actually leaks4445The diff is the obvious surface. These are the ones people miss:4647- **Real command output pasted as an example** in a README, docstring, or skill —48 the most common leak in documentation.49- **Test fixtures** built from a production export.50- **Commit messages and PR descriptions** — not part of the diff, still public.51- **Screenshots** — a terminal or browser tab captures far more than the subject.52- **Error messages and stack traces** that embed a full path or a query with real53 values.54- **Lockfiles and configs** pointing at a private registry with a token in the URL.5556## Judgement5758Public-vs-private is contextual, and reversibility is asymmetric: leaving a detail59out costs a follow-up question, publishing one cannot be undone. When unsure,60redact and ask.6162## Source6364Adapted from `secret-scan` in65[loopkit](https://github.com/Archive228/loopkit) by Archive228 (MIT, © 2026 —66notice in [LICENSE](../../../../LICENSE)). The secret patterns and the67rotate-don't-delete rule come from there; the non-public-context section and the68leak surfaces above are additions.6970## Pairs with7172- `writing-commit-messages` — the message is public too.73- `pr-from-diff` — same review, at PR scope.