Terms & acceptable use
🔑 Free leaked key check

Rotated your key? Now make sure no other secret is still in your live app. Paste your link and we look for secret keys in the code your site sends to every visitor. Free.

FreeJust your email to see results10 seconds

The free scan shows your problems. The $9 fix report gives you a copy‑paste fix prompt for each one.

Guide · API keys · Updated

I Leaked My API Key. What Do I Do Now? How to Rotate OpenAI, Stripe, Supabase and Google Keys

It happens a lot with AI-built apps. A key ends up in the browser code, a public GitHub repo, a screenshot or a chat. Don't panic, and don't start by editing code. Here is what to do, in order.

1. Do this first: rotate the key

Rotate means: make a new key, use it in your app, and turn off the old one. Once the old key is off, a copy of it is useless.

  1. Find out which key leaked. Look at the start of it. sk- or sk-proj- is OpenAI. sk_live_ or rk_live_ is Stripe. sb_secret_ or a long eyJ… service_role key is Supabase. AIza is Google.
  2. Check if it is really secret. A Stripe pk_ key and the Supabase publishable or anon key are made to be public. You don't need to rotate those. See which keys are secret.
  3. Rotate it at the provider. Steps for each one are below.
  4. Put the new key in a safe place. That means your platform's secrets, used only by server code. Not in the browser code.

If the key was in your live app's code, fix the code soon after. Otherwise your next publish leaks the new key too.

2. How to rotate OpenAI, Stripe, Supabase and Google keys

OpenAI

Go to the API Keys page and rotate the key (OpenAI says to do this right away if you think it leaked). Update your app with the new key. Then check the Usage page and set a monthly spend limit with hard enforcement. OpenAI says spend alerts alone do not stop traffic.

Source: OpenAI: API key safety

Stripe

On the API keys page, open the ⋯ menu next to the key and pick Rotate key. Choose when the old key expires. Now deletes it right away. A later time keeps both keys working for up to 7 days so you can switch with no downtime. Save the new key at once, because live keys you make can't be shown again. Stripe suggests restricted keys (rk_) that can only do what your app needs.

Source: Stripe: API keys

Supabase secret or service_role key

In Settings → API Keys, make a new secret key (sb_secret_). Put it everywhere the old key was used and check every part of your app uses it. Then delete the old secret key (this can't be undone), or turn off the legacy JWT keys if it was a service_role key. Supabase says to fix the cause of the leak first, so the new key doesn't leak the same way.

Source: Supabase: Rotate a leaked key

Google Cloud (AIza keys)

On the Credentials page, open the key and click Rotate key. The new key keeps the same limits. Update your app, then delete the previous key from the new key's page. Many Google keys, like Maps keys, are meant to sit in the browser, but only with limits on which sites and APIs can use them.

Source: Google Cloud: Manage API keys

Other keys (Anthropic, Resend, GitHub, AWS and more)

The pattern is the same. Open the provider's dashboard, make a new key, update your app, then delete or turn off the old key. Then look at the provider's usage or billing page. For an AWS key, make it inactive in IAM first and check CloudTrail: Is my AWS access key safe in my frontend? For an Anthropic sk-ant- key, delete it in the Claude Console and set a spend limit: Is my Anthropic API key safe in my frontend? For a Gemini key, make a new key first, then disable the old one: Is my Gemini API key safe in my frontend?

3. Why deleting it from your code is not enough

Bots scan public sites and GitHub for keys all the time. If your key was public for even a short while, assume someone has it.

  • Git history keeps it. Deleting a line in a new commit leaves the key in old commits. GitHub says that for a leaked secret, the first step is to revoke or rotate it. After that, rewriting your history may not even be needed.
  • Old deploys can still have it. On Vercel, changes to environment variables only apply to new deployments, not old ones. Redeploy after you change a key.
  • Copies spread. Forks, clones, screenshots and chat logs are out of your hands.

Sources: GitHub: Removing sensitive data · Vercel: Environment variables

4. After you rotate: 5 more steps

  1. Check usage and bills. Look for use you didn't make in the provider's dashboard. Contact their support if you see strange charges.
  2. Set a hard spend limit. OpenAI lets you set monthly limits with hard enforcement. A budget alert only warns you. It does not always stop spending.
  3. Move the code to the server. If the key was in your browser code, move the code that uses it into a server function. A name starting with VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ gets built into the code every visitor downloads, so never use one for a secret. See is NEXT_PUBLIC_ safe for API keys?
  4. Use smaller keys. Stripe suggests restricted keys with only the access your app needs (more in which Stripe keys are safe in the browser). Resend suggests a Sending access key, which cannot read your contacts even if it leaks (more in is my Resend key safe?). Supabase suggests a separate secret key for each part of your app, so one leak means rotating only one key. Google says to give every Maps key Websites and API restrictions (more in is my Google Maps key safe?). Clerk lets you add a new Secret Key before you delete the leaked one, so login keeps working (more in is my Clerk secret key safe?). Twilio suggests Restricted API keys instead of the Auth Token, and says to create a new Auth Token before you disable a leaked one (more in is my Twilio Auth Token safe?).
  5. If it was a Supabase secret key, check your data. That key skips Row Level Security, so someone could have read or changed any table. Look at your tables for changes you didn't make. Then make sure each table has RLS on for the public key. See Supabase anon vs service_role key and the Supabase RLS check.

5. Copy-paste fix prompts for Lovable, Bolt and Cursor

Paste one into your AI builder's chat. Review the changes, publish again, then check your live app.

After a leak: move the key to the server
One of my API keys leaked because it was in my frontend code. Find every place this project uses a secret key, like OpenAI, Anthropic, Stripe sk_ or rk_ keys, or a Supabase secret or service_role key. Move each call that uses one into server-side code (a Supabase Edge Function, API route or server function) and read the key from the platform's secrets, not from a variable that starts with VITE_ or NEXT_PUBLIC_. Do not put the new key in the code. List every key you moved so I can rotate each one at the provider.
After a leak: add limits so a leak costs less
Add a login check and a simple rate limit to every server function that calls a paid API (like OpenAI or an email service). Only logged-in users should be able to call it, and each user should have a max number of calls per hour. Return a clear error when the limit is hit. Show me what you changed.
Cursor: find old copies of the key
Search this whole project and its git history for API keys: anything starting with sk-, sk-proj-, sk-ant-, sk_live_, rk_live_, sb_secret_, AKIA, ghp_ or github_pat_, plus any service_role key. List the file, line and commit for each. Do not print the full key. Then tell me which ones were in files sent to the browser.

6. Check your live app

One leak often means there are more. After you rotate and publish, check your live app the way a stranger would. VibeCheck searches the JavaScript your homepage loads for secret keys like OpenAI, Anthropic, Stripe, AWS, GitHub and Supabase service_role keys. It also checks for open Supabase tables, security headers, Google basics and broken links.

It only looks. It never logs in, fills in forms or tries to break in. It shows only part of any key it finds, so the report itself never leaks it.

Pricing: the problems list is free (just add your email). A fix report with a copy-paste prompt for every problem is $9. Or get 10 fix reports for $29. No subscription.

No tool can promise your app is safe. VibeCheck catches common, costly mistakes so you can fix them first.

7. FAQ

I leaked my API key. What should I do first?

Rotate it. Go to the provider (OpenAI, Stripe, Supabase, Google and so on), make a new key, and turn off the old one. Do this before you clean up your code. Deleting the key from your code does not help if someone already copied it.

Is deleting the key from my code or GitHub enough?

No. Old builds, git history, forks and clones can still have it. GitHub says the first step for a leaked secret is to revoke or rotate it. Once the old key is turned off, it can no longer be used, and that may be all you need.

What does it mean to rotate an API key?

Rotating means you make a new key, put it everywhere your app uses the old one, and then turn off the old key. Some dashboards do this in one click. Stripe has a Rotate key button, and Google Cloud has one on each API key page.

My app is in production. Will rotating break it?

It can for a short time, until your app uses the new key. Stripe lets the old and new keys both work for up to 7 days when you rotate in the dashboard, unless you pick Now. For a key that is clearly public, turning it off fast matters more than a few minutes of downtime.

Which keys do I NOT need to rotate?

Keys made to be public, like a Stripe pk_ key or the Supabase publishable (or legacy anon) key, are fine in the browser. They are not secret. For Supabase, your data is protected by Row Level Security on each table, so check that instead.

How do I know if someone used my leaked key?

Check the provider's usage or logs. OpenAI has a Usage page. Stripe has request logs for each key. Look for use you did not make, and contact the provider's support if you see charges you don't recognize.

More questions? See the VibeCheck FAQ. Not sure if your key is public? Read how to check if your API key is exposed. Built with Lovable? See Is my Lovable app safe? Before you launch again, run the vibe coding security checklist.