secrets-guard
Skill1 starsChanged 54 days agoMITView on GitHub
Keep secrets out of code, git history, logs, and client bundles: detect hardcoded API keys, credentials, tokens, and connection strings; move them to the environment or a secret manager; catch client-exposed prefixes; set up gitignore and pre-commit scanning; run the rotate-first response when a secret has leaked. Use for any credential, .env, or "where do I put my key?" question.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- AL-JANEF/janefskillsword for word, first seen Sep 19, 2026
Other versions1 project uses a version of this.
Word for word · 1
- AL-JANEF/janefskills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository25 other files it gives its agents.
- janefSkill
- forgeSkill
- accessibility-qualitySkill
- api-contractsSkill
- architecture-integritySkill
- context-efficiencySkill
- database-integritySkill
- delegation-disciplineSkill
- devops-reliabilitySkill
- documentation-integritySkill
- frontend-design-qualitySkill
- git-disciplineSkill
- implementation-qualitySkill
- performance-scalabilitySkill
- review-defect-firstSkill
- root-cause-debuggingSkill
- testing-verificationSkill
- ui-ux-qualitySkill
- auth-hardeningSkill
- security-auditSkill
- security-loggingSkill
- skill-security-auditSkill
- threat-modelSkill
- variant-huntSkill
- vuln-auditSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 25
Use it whenever code touches credentials: adding an API key, wiring up a database connection, configuring an external service (payment, …
- Distinctive: line 43
If a real secret is found in code or history: flag it as compromised and requiring rotation, not just removal.
- Distinctive: line 77
Never log secrets — check that error handlers and request loggers don't print auth headers, tokens, or connection strings.
- Distinctive: line 85
When auditing, report clearly and rank by exposure:
- Very specific: line 103
Do not print the full secret value in the report — reference it by type and location (Stripe secret key in config.js:12), show at most a …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secrets Guard
A leaked secret is one of the fastest paths to a breach — a single committed API key can hand an attacker the whole system. This skill keeps secrets out of the places they leak from, and cleans them up when they've already landed there.
The rule underneath everything: a secret belongs in the runtime environment, never in the source. If it's in a file that gets committed, shipped to the browser, or printed to a log, treat it as compromised.
When to reach for this skill
Use it whenever code touches credentials: adding an API key, wiring up a database
connection, configuring an external service (payment, messaging, storage),
setting up .env files, or committing configuration. Also whenever the user asks
where to store a key or whether something is safe to commit. The presence of a
credential is the trigger.
What to do
1. Detect secrets already present
Scan for hardcoded credentials in the code and config: high-entropy strings,
apiKey = "...", connection strings with embedded passwords, private key blocks,
tokens in source. Common shapes: cloud keys, database URLs like
postgres://user:pass@host, JWT signing secrets, third-party service keys
(payment, messaging). Also check what's already committed to git history, not
just the working tree — a secret removed from the current code but still in
history is still leaked.
If a real secret is found in code or history: flag it as compromised and
requiring rotation, not just removal. Once a secret has been committed to a shared
repo, deleting it doesn't un-leak it — it must be rotated (regenerated) at the
provider. See references/leak-response.md.
2. Move secrets to the environment
Secrets load from environment variables (or a secret manager), never from source:
// wrong — in source
const key = "replace-me";
// right — from environment
const key = process.env.STRIPE_SECRET_KEY;Provide a committed .env.example with the names and dummy values, and keep the
real .env untracked. For production, prefer a managed secret store (the
platform's secret manager) over shipping .env files around.
3. Watch the client boundary
The most dangerous secret leak in modern frameworks: putting a secret in code
that ships to the browser. In Next.js and similar, anything prefixed for client
exposure (e.g. NEXT_PUBLIC_*) is embedded in the bundle and readable by anyone.
A secret must never carry a public/client prefix. Only truly public values
(publishable keys designed for the client) belong there. Verify which side of the
client/server boundary each key lives on.
4. Prevent recurrence
Set up guards so secrets can't slip in again:
.gitignoreincludes.env,.env.*(but allow.env.example).- A pre-commit secret scanner (gitleaks, or a hook) blocks commits containing secret-shaped strings.
- Never log secrets — check that error handlers and request loggers don't print auth headers, tokens, or connection strings.
See references/setup.md for concrete gitignore, .env.example, and pre-commit
scanner configuration.
Output format
When auditing, report clearly and rank by exposure:
## Secrets Audit: <target>
### Exposed / compromised (rotate immediately)
- <secret type> at <location> — committed / in history / in client bundle → rotate + remove
### Misplaced (move to environment)
- <secret> hardcoded at <location> → move to env var <NAME>
### Prevention gaps
- <e.g. .env not gitignored, no pre-commit scan>
### Verified good
- <secrets correctly externalized>Do not print the full secret value in the report — reference it by type and
location (Stripe secret key in config.js:12), show at most a masked fragment.
Printing it in full just copies the leak into a new place.
Proof before done
Demonstrate the fix: the secret no longer appears in the built client bundle (grep the build output), the app still runs reading from env, and the pre-commit scanner actually blocks a test secret. For a rotated key, confirm the old one is revoked at the provider.
References
references/setup.md— Copyable.gitignore,.env.example, and pre-commit secret-scanner config. Read it when setting up prevention.references/leak-response.md— Step-by-step response when a real secret has already been committed (rotate, purge, prevent). Read it when a live leak is found.
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.

