Skip to content
VibeMonitor
← Blog

Why moving a leaked key isn't a fix

· 3 min read

Here is a common exchange. Someone discovers their OpenAI key is visible in their website's code. They ask their AI tool to fix it. The tool moves the key to the server, the code looks right, and everyone relaxes.

The key is still compromised. Moving it changed where it lives from now on. It did nothing about the copies already taken.

Assume it was copied

Automated scanners read public websites and code repositories all day looking for strings shaped like keys. GitGuardian's yearly report counted 28.65 million new secrets leaked in public GitHub commits in 2025, with leaked AI-service keys up 81% on the year before. A key that was public for a day should be treated as a key someone else has.

The fix has two halves

  • Replace it. In the provider's dashboard, create a new key and delete the old one. This is called rotating the key, and it is the only step that makes the stolen copy useless. An AI tool can't do this for you.
  • Then move it. Put the new key somewhere only your server can read, and make sure nothing in the browser-side code mentions it.

Check the bill

While you are in the dashboard, look at recent usage. An unexpected spike is a sign the old key was already in use by someone else, and most providers will want to hear about it.

This is why every leaked-key finding in a VibeMonitor report comes with a step marked "you need to do this part yourself". The prompt fixes the code. Only you can replace the key.

Next step

Check your own app.

Free, no sign-up, about 30 seconds.

Check my app