Skip to content

PROOFFORGE GUIDES

What to do when an API key is exposed

SHORT ANSWER

If a private key reached browser code or a public file, treat it as compromised. Revoke it with the provider, review available usage, and replace the client-side operation with a protected server path.

Last updated

Scan an app you own

Respond in the right order

First identify the provider and key type without republishing the value. Revoke or rotate a confirmed private credential, update the server-side secret, and deploy a clean build. Then review provider activity for unexpected use.

Do not assume that deleting a line from the current source invalidates a key already copied from a public bundle or old commit. Credential rotation is what prevents further use.

Do not mistake public keys for private keys

Some identifiers and publishable keys are designed to be visible. Confirm the key's role with its provider and check the policy that limits it; do not rotate a public key solely because a scanner recognized its format.

BROWSE THE LIBRARY

My Supabase service_role key is exposed. What now?Understand an exposed Supabase service_role k in an AI-built app. Learn what a public check proves, how to apply a safe fix, and what to verify before you ship.An OpenAI API key is exposed in my app. How do I fix it?Understand an exposed OpenAI API key in an AI-built app. Learn what a public check proves, how to apply a safe fix, and what to verify before you ship.An Anthropic API key is exposed in my app. What should I do?Understand an exposed Anthropic API key in an AI-built app. Learn what a public check proves, how to apply a safe fix, and what to verify before you ship.A Stripe secret key is exposed in my app. How do I fix it?Understand an exposed Stripe secret key in an AI-built app. Learn what a public check proves, how to apply a safe fix, and what to verify before you ship.Free exposed API key checkerUnderstand an exposed API key checker in an AI-built app. Learn what a public check proves, how to apply a safe fix, and what to verify before you ship.

Frequently asked questions

Should I delete the key from Git first?

Revoke or rotate it first. History cleanup helps reduce future exposure but does not invalidate copies.

Can a public key be safe?

Yes. Verify its provider role and the backend rules that limit it.

Can a scanner tell if the key was abused?

No. Review provider usage and audit information.

Last updated November 25, 2026 · Reviewed by ProofForge