Leaked secret
One of your secrets got leaked, what now?
Notchlet found a key in one of your AI chats on this Mac. It is fixable in about ten minutes. Do the steps in order.
What happened. And what did not.
Somewhere in a chat the key ended up in plain text. You pasted a .env, or the agent ran cat .env or a curl with the key in a header, and the output landed in the transcript. The CLI writes every transcript to disk and sent the conversation to its maker to get an answer. So the key now lives in two places you do not control much: a file on this disk and a log on their servers.
Nobody at an AI lab is going to use it. Treat it as burned anyway. A new key costs nothing, and the old one might also be in a Time Machine backup, a shared session or a screenshot you forgot about. Rotating takes ten minutes. Finding out someone used it takes a lot longer.
Notchlet read the file on your Mac and hashed what it found. The key never left the machine and Notchlet does not keep it either, only the first six and last two characters so you can tell which one it is.
The fix. Make a new one, swap it in, kill the old one.
- 01
Make a new key
Make a new key with the same permissions as the old one and copy it somewhere for a minute. If the page has a Roll or Regenerate button, use it: that is steps one and three in one click.
Sign in to the service the key belongs to. Look under Settings for something called API keys, Tokens, Developer or Credentials.
- 02
Put it where the old one was
The old key is in at least one place: a
.envfile, a hosting dashboard (Vercel, Netlify, Railway and Render all call it Environment Variables), a GitHub Actions secret or a config file. Swap each one and redeploy.Not sure where it lives? Search the project for the first characters Notchlet showed you. In VS Code and Cursor that is Cmd Shift F.
- 03
Delete the old key
Once the new one works, go back and delete the old one. Not disable, delete. If you cannot tell whether something still uses it, delete it anyway and see what breaks. A broken deploy is a five minute fix. A stranger's usage on your card is not.
- 04
Look for damage
Open the usage, billing or logs page and look for anything since the chat you do not recognize: requests from places you have never been, spend you did not cause, new users or keys you did not make.
Found something? Email their support today, say the key leaked and ask for the charges to be reversed. They have a process for this.
- 05
Tell Notchlet
Hover the notch and hit Ignore on this key. Notchlet remembers it by its hash and stays quiet about it, even when the same key turns up in another chat.
Deleting the transcript is optional. A dead key in a file opens nothing.
Next time. The key never enters the chat.
Do not paste a key into a chat. Put it in .env yourself and tell the agent the variable name. STRIPE_SECRET_KEY is all it needs to write the code.
Stop Claude Code from opening the file. Add this to .claude/settings.json in the project, or to ~/.claude/settings.json for every project:
{
"permissions": {
"deny": ["Read(./.env)", "Read(./.env.*)"]
}
}Claude Code then refuses to read those files with its own tools. It can still run cat in a terminal, so when a command touches .env, say no.
Build with test keys. Stripe, Twilio and most payment or email services have a test mode whose keys move nothing real. Switch to live keys at deploy time, in the hosting dashboard, never in the chat.