CatalogueSecurity & Compliance
Secrets & Credential Exposure Scan
Reads the repository and its full git history for keys, tokens, and passwords, including ones a later commit tried to delete.
What it examines
- Live credentials in code, env files, config, Dockerfiles, and infrastructure templates
- Secrets hardcoded in CI, or printed into build logs
- Secrets that remain recoverable after the file was deleted
- Credentials written to logs or bundled into client-side JavaScript
- Keys with no expiry and no rotation
- Whether a pre-commit or CI scan would have caught the next one
What you get back
A findings file. Each item has the evidence, how serious it is, and a fix.
Dependencies
- An AI coding agent that reads SKILL.md files, such as Claude Code, Codex or Gemini CLI
- Read access to the repository
- The full git history. A clean working tree proves nothing, because a secret removed in a later commit is still recoverable.
- Python 3 with the jsonschema package, to check findings.json before fixing anything
- Optional: gitleaks or detect-secrets, if you want to add a scanner as a fix
How it works
The audit is read-only. It looks for live credentials in code, config files, Dockerfiles, infrastructure templates and CI definitions, then scans the whole git history, not just the latest commit.
It also checks for secrets written to logs or bundled into client-side code, for long-lived keys with no rotation, and for missing pre-commit and CI secret scanning.
It reports where a secret is, never the secret itself. The remediate skill reads findings.json. Rotating a leaked key is always your job, because the skill cannot do it for you.
Setup
- Unzip the download. Copy the audit and remediate folders into your agent's skills folder (for Claude Code, .claude/skills/) in the repository you want to check.
- Clone the repository in full, with history, so deleted files and old commits can be scanned.
- Open the repository in your agent and ask it to run the a2-secrets-credential-exposure-audit skill.
- Check the result with the validator: pip install jsonschema, then python3 schema/validate.py findings.json.
- Ask your agent to run the a2-secrets-credential-exposure-remediate skill using findings.json. Fix some findings and leave the rest open if you like.
Run it with your agent
Copy the prompt, fill in the parts in square brackets, and paste it into your agent.
Run the a2-secrets-credential-exposure-audit skill on this repository. Scan the full git history, not just the working tree. Never print a secret value; report only where it is. Mode: audit only. Do not change any code. Write findings.json and findings.md in the repository root.
Run the a2-secrets-credential-exposure-remediate skill using findings.json. Work through the findings I choose, and leave the rest open.