Skip to content
Post Mortem

Do not search in a panic. Start here.

Direct links to each platform's own guides for replacing a leaked key and for handling a compromise. We link to official documentation only, so the steps stay accurate as the platforms change.

The recipe that works on every platform

If the key has leaked

  1. Cancel it first. Accept a short outage. A broken app is cheaper than a stolen key.
  2. Create a replacement with the smallest permissions that work, and a spending cap if offered.
  3. Put the new key where your app reads it (your hosting service's settings for secret keys), never in the code itself.
  4. Check the service's usage and activity records for the time it was exposed.
  5. Look for spare ways back in that the attacker may have made: new users, keys, apps, servers.

Full playbook: my secret key leaked

If you are just replacing a key (no leak)

  1. Make the new key before touching the old one.
  2. Switch your app to the new key.
  3. Confirm everything works with the new key.
  4. Disable the old key. Wait a few days, then delete it.
  5. Put a reminder in the calendar. Better yet, use keys that expire on their own, so there is less to replace.

Netlify

Website hosting and environment variables

Replace or cancel keys

Change the value in the environment variable, then redeploy so the new value takes effect.

Anthropic (Claude API)

AI APIs and usage billing

Replace or cancel keys

Sign in to the Console to view, disable or delete keys, and set spend limits for your organization.

Firebase

Databases, hosting and sign-in for mobile and web apps

Firebase security depends on your database and storage rules. Review them as well as your keys.

General incident help

These links go to third-party sites we do not control. Platforms change their pages, so if a link has moved, search the platform's documentation for "rotate keys" (that is the technical term for replacing them) or "compromised account". Logos are trademarks of their respective owners. They are shown to identify each tool or platform and do not imply endorsement or partnership.