Prompt: move secret API keys out of your app’s browser code

By the LaunchPal team · Updated 20 October 2026 · Works in Lovable, Bolt, Replit, v0, Base44, Cursor and Claude Code

Prompt to paste

Find any secret keys in my front-end code, including AI provider keys (such as OpenAI), Stripe secret keys and the Supabase service role key. Move every call that uses them to a server function or edge function, store the keys as server-side secrets, and make sure none of them appear in the code sent to the browser. List every key you found and where it was.

When to use it

Before launch, and any time you add a feature that calls a paid API. It’s very common for an AI builder to call an AI model straight from the browser, with the key right there in the code. Anyone who opens the browser’s developer tools can copy it and run up your bill.

Public keys are fine where they are: Stripe publishable keys (starting pk_) and Supabase anon or publishable keys are designed to be visible.

What to check afterwards

Don’t skip this part

If a secret key was ever in the browser code, assume someone has it. Create a new key in that provider’s dashboard, put the new one in your server secrets and delete the old one. Then set a monthly spending limit in that provider’s dashboard too.

The full background is in our guide: Is your vibe-coded app leaking data? 5 things to check.

More prompts