secret-scanning
Skill2 starsChanged 45 days agoMITView on GitHub
Scan git repos and directories for committed credentials with gitleaks and keep credentials out of repos. Use before making a repository public, before a new repo's first push, before copying evidence, logs, transcripts or skills into a repo, when adding secret scanning to CI or a pre-commit hook, when auditing a public repo's history, and whenever a task handled credential copies (auth.json, models.json with apiKey). Also for 'is this safe to publish?', 'did we leak a key?', gitleaks.
- Reads credentials
- Deletes or force-pushes
7 other projects use a version of this.
Adopted by
Most recently taken up by
- kaandgnsh/Claude-Bluetheir own version, first seen Nov 1, 2026
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- PracticalSwan/agent-skillstheir own version, first seen Oct 19, 2026
- mihaimurra001/preConfigProjecttheir own version, first seen Sep 13, 2026
- firstsun-dev/firstsun-bottheir own version, first seen Jul 22, 2026
- ReaperOAK/ForgeOStheir own version, first seen Jun 8, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- github/awesome-copilot★ 41ksame name
- PracticalSwan/agent-skills★ 22same name
- github/copilot-advanced-security-plugin★ 20same name
- mihaimurra001/preConfigProject★ 1same name
- firstsun-dev/firstsun-bot★ 0same name
- kaandgnsh/Claude-Blue★ 0same name
- ReaperOAK/ForgeOS★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- skills/web-asset-generator/CLAUDE.mdCLAUDE.md
- academic-writingSkill
- agent-os-childSkill
- agy-pSkill
- amazon-uk-scraperSkill
- artifact-variationsSkill
- audio-transcription-workflowSkill
- capture-dashboardSkill
- claude-channelsSkill
- claude-pSkill
- code-documenterSkill
- context7-docsSkill
- context7-searchSkill
- deep-researchSkill
- docx-draftSkill
- grill-meSkill
- handoffSkill
- long-horizon-waiting-strategiesSkill
- openapi-schemaSkill
- opencode-pluginSkill
- pi-extensionSkill
- pi-web-ui-internal-api-orchestrationSkill
- pptx-draftSkill
- saas-idea-finderSkill
- scraping-redditSkill
- scraping-twitterSkill
- socialmedia-optimizationSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- text-to-speechSkill
- thematic-analysisSkill
- transcribe-audioSkill
- video-deep-understandingSkill
- video-useSkill
- web-asset-generatorSkill
- web-crawlingSkill
- web-create-assetsSkill
- web-data-acquisitionSkill
- webfetch-skillSkill
- youtube-captionSkill
- youtube-searchSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Always pass
--redact: Never print, paste, quote or store a matched value, including in reports, commit messages, chat or evidence files. - Distinctive: line 37
Treat that block as correct.
- Distinctive: line 60
Treat it as real until the operator confirms otherwise.
- Distinctive: line 110
Add the CI job.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secret scanning
The goal is to keep credentials out of repositories. Scanning is the check; the design rule comes first:
Credentials live outside the repo tree. Code reads them from paths or environment variables that point outside the repository (for example
$HOME/.pi-web-ui/internal-api-token), and should refuse a credential path that resolves inside its own repo..gitignoreis only a backstop: onegit add -for one renamed file defeats it.
The tool: gitleaks
gitleaks is a single binary and needs no account or human step. Check it with
gitleaks version. If it is missing, install a pinned release and verify the checksum:
V=8.30.1; D=$(mktemp -d); cd "$D"
curl -sSfL -o gl.tgz "https://github.com/gitleaks/gitleaks/releases/download/v$V/gitleaks_${V}_linux_x64.tar.gz"
curl -sSfL -o sums.txt "https://github.com/gitleaks/gitleaks/releases/download/v$V/gitleaks_${V}_checksums.txt"
grep "gitleaks_${V}_linux_x64.tar.gz" sums.txt | sed "s/gitleaks_${V}_linux_x64.tar.gz/gl.tgz/" | sha256sum -c -
tar xzf gl.tgz gitleaks && install -m 0755 gitleaks /usr/local/bin/gitleaks; cd /; rm -rf "$D"Never print a secret
Always pass --redact. Never print, paste, quote or store a matched value,
including in reports, commit messages, chat or evidence files. Not even partly, and
not "masked in context". Triage from metadata only: rule id, file, line, commit,
the key name that matched, and whether the file still exists at HEAD. On some hosts
the agent's permission layer blocks commands that would expose credential values.
Treat that block as correct; do not work around it.
Commands
| Need | Command |
| Full history of a repo (before publishing; public-repo audit) | gitleaks git --redact -v <repo> |
| Working tree or any directory (evidence before copying it into a repo) | gitleaks dir --redact -v <path> |
| Only unpushed commits | gitleaks git --redact --log-opts="origin/main..HEAD" <repo> |
| Staged changes (pre-commit) | gitleaks git --pre-commit --staged --redact -v |
| Machine-readable triage | add --report-format json --report-path /tmp/gl.json (the report is redacted too; delete it afterwards) |
Exit code 1 means findings; 0 means none were found.
Triage
Classify every finding. Most hits of the broad generic-api-key rule are harmless.
- Identifier false positive: idempotency keys, UUIDs, digests, config words
(for example
NoNewPrivileges). Allowlist them. - Deliberate test fixture: a fake key planted to test redaction. Prefer an
obviously fake shape (
TEST-FAKE-…), and allowlist it. - Possibly real: anything else, especially in docs, scripts, logs or evidence. Treat it as real until the operator confirms otherwise.
For a possibly real credential:
- Rotate or revoke it first. Rewriting history does not un-leak a secret that was ever public: clones, forks and caches keep it.
- Then tell the operator, with the location (file, line, commit), never the value.
- Rewriting history (
git filter-repo) and force-pushing are the operator's decision. Never do them unasked.
Allowlisting without hiding real leaks
.gitleaksignoreholds finding fingerprints (commit:file:rule:line, no secret values). Add a fingerprint only after triage says it is a false positive or a fixture.- An inline
gitleaks:allowcomment on a fixture line also works. - Baseline for legacy history:
gitleaks git --report-path baseline.json …once, then run--baseline-path baseline.jsonin CI, so only new findings fail. A baseline accepts the old findings; triage them before baselining, and never baseline a possibly real credential.
CI and hooks
GitHub Actions (the official action needs no licence for a personal account's repo):
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: gitleaks/gitleaks-action@v2
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }A local pre-commit hook (.git/hooks/pre-commit) is a personal choice: describe it
in the repo's maintainer docs, and don't install it into someone else's clone:
#!/bin/sh
exec gitleaks git --pre-commit --staged --redactBefore publishing checklist
gitleaks git --redact -v .over full history, thengitleaks dir --redact ..- Grep for host-specific or personal data a scanner won't flag: absolute host paths, internal hostnames, emails, real session ids, private repo names.
- Confirm code reads credentials only from outside the repo, and prove the tests
pass on a machine without your private checkout (for example,
HOMEpointed at an empty temp dir). - Add the CI job.
- An independent reviewer re-runs the scan before the first public push.
This skill is the pre-publication check used by the Pi Web UI orchestration pack: scan the artefacts a wave produced before they leave the machine.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

