Skip to content
Back to skills

Keep Secrets Out

ASecurity

Keep API keys, tokens, passwords and private data out of code, commits, logs, plans and prompts — check before committing, and know what to do when one leaks.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 22, 2026
ai-agentsgobashgitapi

Works with

  • api

Security analysis

A100/100

Scanned October 22, 2026

npx -y skills add gaurav8936/oneroof --skill keep-secrets-out --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Keep Secrets Out?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Keep Secrets Out
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gaurav8936-keep-secrets-out/badge)](https://www.skillsdirectory.com/skills/gaurav8936-keep-secrets-out)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: keep-secrets-out
description: Keep API keys, tokens, passwords and private data out of code, commits, logs, plans and prompts — check before committing, and know what to do when one leaks.
runtime: [shared]
triggers: [secrets check, did I commit a key, leaked token, scan for secrets]
---

# keep-secrets-out — the mistake you cannot take back

A secret pushed to a public repository should be treated as stolen within minutes, even if you delete it. Prevention
is the only cheap fix.

## Before each commit

1. `git diff --cached` and read it. Look for keys, tokens, passwords, private URLs, `.env` content, real customer
   data.
2. Quick scan of what is staged:
   ```bash
   git diff --cached | grep -nE '(api[_-]?key|secret|token|passw(or)?d|BEGIN [A-Z ]*PRIVATE KEY|sk-[A-Za-z0-9]{20,})' || echo clean
   ```
   If a dedicated scanner such as `gitleaks` or `trufflehog` is installed, run it too.
3. Make sure `.env*`, key files and local data folders are in `.gitignore`.

## Where secrets belong

In environment variables or a secrets manager, read at runtime. Commit an `.env.example` with names and no values.
Never in prompts, plans, handoffs, screenshots or logs; redact them as `sk-…abcd`.

## If one leaks

1. **Rotate it first**: revoke the key at the provider and issue a new one. Deleting the commit is not enough.
2. Then clean history if the repository is shared (this rewrites history: ask first, see `ask-before-irreversible`).
3. Check the provider's logs for use you did not make.
4. Write a short gotcha note on how it happened (`capture-gotchas`).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.