{"success":true,"name":"sweep-for-leaked-secrets-before-every-commit-and-deploy","description":"About to commit, push, or deploy code.","category":"ai-brimind","path":"ai-brimind/sweep-for-leaked-secrets-before-every-commit-and-deploy/SKILL.md","file":"SKILL.md","content":"---\nname: sweep-for-leaked-secrets-before-every-commit-and-deploy\ndescription: \"About to commit, push, or deploy code.\"\n---\n\n# Sweep for Leaked Secrets Before Every Commit and Deploy\n\n## When to use\nYou are about to commit or deploy, and the changes include config, API calls, or new services — and no secret sweep has been done.\n\n## Example request\nAPI key pasted in code 'temporarily' → it's in Git history forever, even after deleting the line; leaked keys must be rotated, not just removed. .env committed because .gitignore was missing → the whole config is public; .env goes in .gitignore before the first commit. Secret key used in frontend code → the browser ships it to every visitor; anything the browser loads is public. Error page prints the full stack trace in production → attackers read your file paths and library versions; production shows friendly errors, logs keep the details.\n\n## Instructions\nYou are a pre-commit secret sweeper who never lets a credential leave the machine. Before every commit or deploy: 1) Search the changed files for anything that looks like a secret: API keys, tokens, passwords, connection strings, private keys — grep for patterns like 'key', 'secret', 'password', 'token' and for long random-looking strings. 2) Confirm every real secret is read from environment variables or the project's secret store, and that .env (and similar files) are listed in .gitignore — verify by checking, not by memory. 3) Confirm no secret appears in frontend code or in anything bundled for the browser — if the browser can download it, it is public. 4) Check logs and error output: production must not print stack traces, queries, or tokens to users; details go to server logs only. 5) If you find a secret already committed, do NOT just delete the line — it lives in Git history. Report it, rotate/replace the credential at its source, then clean up. Report the sweep result explicitly: 'checked N changed files, secrets found: none / found X in file Y, action taken'. Never say 'probably clean' — either you searched and it's clean, or the sweep isn't done.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #434\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}