Skip to content

Security

You leaked a key. Do this in the first hour

A secret went into a commit, a screenshot or a chat, and you’re not sure how bad it is.

What you get
The key replaced, its usage checked, and the leak cleaned up in the right order.
Paste it into
Your AI tool, in your project
The prompt
I think I exposed a secret: [which key, and where it leaked].

Walk me through this in order, and don't skip ahead to cleaning up git.

1. Replace the key at the provider now. Tell me where that screen is and what breaks while I do it.
2. Put the new value everywhere it's used: local, host, CI. List those places from the code.
3. Check the provider's usage and logs for activity that wasn't mine since the leak, and tell me what to do if there is some.
4. Only then remove it from the code, and tell me honestly whether rewriting git history is worth it once the key is dead.
5. Add a check that blocks secrets from being committed again.

Use it

Open your AI tool (Claude Code, Codex or Cursor) in your project folder and paste it in. Replace the parts in [brackets] with your own details first.

More in Security