# My ElevenLabs key leaked. What do I do?

**Short answer:** Disable the leaked key, create a replacement with the same permissions, switch your server to it, then delete the old key. ElevenLabs auto-disables keys that GitHub secret scanning finds in public repos (reason `exposed_publicly`) and emails the owners. Keys leaked anywhere else stay live until you act. Add a credit quota and IP allowlist to the new key.

*Last updated 2026-11-25 · Reviewed by ProofForge*

## Is it this key?

**Format:** `sk_`

**Blast radius:** Generate audio on your workspace's credits, and reach whatever endpoints the key's scope allows (voices, history).

## The first 10 minutes

| When | Do | How |
|---|---|---|
| 0–2 min | Disable | Disable the key in the dashboard, or call the Disable API key endpoint with `api_key_name=self` using the leaked key. |
| 2–5 min | Replace | Create a new key and copy the old key's permissions. Add a credit quota and IP allowlist. Set `ELEVENLABS_API_KEY` on the server and redeploy. |
| 5–7 min | Delete | Delete the old key once nothing uses it. |
| 7–10 min | Check usage | Review usage and history for generations you didn't make. Remove the key from client code and git history. |

## Stop the next leak

- Keep the key in a server-side env var. Never use a `VITE_`, `NEXT_PUBLIC_` or `EXPO_PUBLIC_` variable or hard-code it in frontend code.
- Call the provider from your backend or an edge function, and add `.env*` to `.gitignore`.
- Re-scan the live site after every deploy. Keys also leak through JS bundles, source maps and exposed `.env` or `.git` paths.

> **Scan box (use the site's ScanBox component):** Check whether your live app has this problem. Paste your URL for a free outside-in scan covering exposed keys, open database rules, CORS and security headers. [Scan my app free →](https://proofforge.live/#scan)

## FAQ

### Will ElevenLabs catch a GitHub leak?
Yes. It's a GitHub secret scanning partner, and keys found in public repos are auto-disabled unless third-party disabling is turned off for the key (the default on Enterprise plans).

### Can I restrict a key?
Yes: scope restriction, a credit quota, and an IP allowlist.

### Can I call ElevenLabs from the browser?
Not with your API key. Use a server route.

## Sources

- [ElevenLabs: API keys](https://elevenlabs.io/docs/overview/administration/workspaces/api-keys)

## Related

- [Fix: secrets in VITE_ / NEXT_PUBLIC_ vars](/fix/vite-env-secrets)
- [Fix: .env file exposed](/fix/env-file-exposed)
- [Exposed API key checker](/tools/exposed-api-key-checker)
- [Fix: source maps exposed](/fix/source-maps-exposed)
- [All leaked-key guides](/leaked-keys)
