Skip to content

My Anthropic (Claude) key leaked. What do I do?

Short answer

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

WhenDoHow
0–2 minDisableIn the Claude Console → API keys, disable the leaked key.
2–4 minReplaceCreate a new key and set ANTHROPIC_API_KEY on your server. Redeploy.
4–7 minCheck usageReview Usage and Cost for the key's workspace. Set spend limits.
7–10 minClose the holeRemove 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_ 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.

Check your live app

A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.

Read-only. No writes or row contents.

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.

Sources

Related

Read as Markdown · Scan methodology