My Anthropic (Claude) key leaked. What do I do?
Disable the key in the Claude Console's API keys page right away (disabling is instant and reversible), create a replacement stored only on your server, review usage for calls you didn't make, then delete the old key. A leaked key lets anyone run Claude models billed to your organization.
Last updated 2026-11-25 · Reviewed by ProofForge
Is it this key?
Format: sk-ant- (for example sk-ant-api03-…)
Blast radius: Anyone with the key can send requests billed to your organization and reach any workspace resources the key is scoped to.
The first 10 minutes
| When | Do | How |
|---|---|---|
| 0–2 min | Disable | In the Claude Console → API keys, disable the leaked key. |
| 2–4 min | Replace | Create a new key and set ANTHROPIC_API_KEY on your server. Redeploy. |
| 4–7 min | Check usage | Review Usage and Cost for the key's workspace. Set spend limits. |
| 7–10 min | Close the hole | Remove the key from frontend code and git history, then delete the disabled key. |
Stop the next leak
- Keep the key in a server-side env var. Never use a
VITE_,NEXT_PUBLIC_orEXPO_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
.envor.gitpaths.
Check your live app
A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.
FAQ
Disable or delete?
Disable first because it's immediate and reversible. Delete once nothing depends on it.
What error will old deployments show?
401 authentication_error. See /errors/anthropic-authentication-error.
Can the Claude API be called safely from the browser?
Not with a standard API key. Proxy through your server.