agentleFS
magia187magia187/premium-agent-skills/skills/secrets-hygiene/SKILL.md

secrets-hygiene

Skill0 starsChanged 2 months agoMITView on GitHub

Use when committing, opening a PR, editing configs, or pasting logs. Scan diffs and config for credentials and secrets; never commit API keys, tokens, private keys, or passwords — redact and rotate if exposure is suspected.

  • Reads credentials

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 4

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Do not push, force-push, or amend shared history to "hide" a leaked secret without an explicit incident plan (rotation first).

    line 27
  2. Distinctive:

    Do not print full live secrets into chat, logs, or PR bodies.

    line 28
  3. Distinctive:

    Before staging, scan the diff and any new config files for secret-shaped values.

    line 32
  4. Very specific:

    Ensure .gitignore / example env files cannot accidentally track real values.

    line 34
  5. Distinctive:

    If a secret may already be in history or a remote, stop and plan rotation + scrub with the user.

    line 35

“Common” is measured: kept by at least 6 in 10 of the 6 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Secrets Hygiene

When to use

  • Preparing a commit, PR, patch, or shareable log/snippet.
  • Editing .env examples, CI configs, Dockerfiles, Terraform, or Helm values.
  • The user pastes credentials or asks to "wire up" a third-party API.

When not to use

  • Discussing secret-management architecture at a pure design level with no files touched.
  • Working exclusively with already-public, non-sensitive sample data clearly marked as fake.

Assumptions

  • Access to git diff / git status and the working tree.
  • Ability to search the repo for high-entropy strings and known secret patterns.
  • Secret stores (GitHub Actions secrets, Vault, cloud SM) may exist — prefer them over files.
  • Do not push, force-push, or amend shared history to "hide" a leaked secret without an explicit incident plan (rotation first).
  • Do not print full live secrets into chat, logs, or PR bodies.

Workflow

  1. Before staging, scan the diff and any new config files for secret-shaped values.
  2. Move real secrets to the environment or a secret manager; keep only placeholders in git.
  3. Ensure .gitignore / example env files cannot accidentally track real values.
  4. If a secret may already be in history or a remote, stop and plan rotation + scrub with the user.
  5. Proceed with commit/PR only when the diff is clean of credentials.

Steps

  1. Diff scan — Review git diff and untracked files for keys named *SECRET*, *TOKEN*, *PASSWORD*, *_KEY, Authorization, PEM blocks, and connection strings with credentials.
  2. Pattern check — Flag JWTs, AWS-like keys, private key headers (BEGIN … PRIVATE KEY), and long high-entropy literals in source.
  3. Separate concerns — Real values → env / secret manager. Docs and examples → obviously fake placeholders (sk_test_…, REPLACE_ME).
  4. Ignore rules — Confirm .env, key files, and local overrides are ignored; commit .env.example without real values only.
  5. Output hygiene — Redact secrets in logs, screenshots, and PR text. Never echo printenv wholesale.
  6. Leak response — If exposure is plausible: revoke/rotate first, then discuss history rewrite. Do not assume "delete the file" is enough.

Success criteria

  • No live credentials, private keys, or password-bearing URLs appear in the staged diff.
  • Examples use placeholders; real secrets live outside version control.
  • .gitignore (or equivalent) covers local secret files.
  • Suspected leaks triggered a rotation plan before further pushes.
  • Chat/PR output does not contain full secret values.

Out of scope

  • Implementing a full company-wide secrets platform.
  • Cryptographic key ceremony design beyond basic hygiene.
  • Legal/compliance attestation (SOC2 evidence packs).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.