LeakLatch

For Bolt.new apps

Is your Bolt.new app exposing API keys?

Direct answer

Any key in a VITE_ variable, or hard-coded in your frontend, ships in the JavaScript every visitor downloads, so anyone can read it. The Supabase anon or sb_publishable_ key is meant to be public, but only safe with Row Level Security on every table. OpenAI keys, Stripe secret keys and the Supabase service_role or sb_secret_ key must never ship: rotate any that did and move those calls into an Edge Function or server route.

LeakLatch is a free, read-only scan of a live URL you own. It reports leaked secret keys in your JS bundles, Supabase tables that answer with your public anon key, and missing security headers. You get a risk score, redacted findings, and a fix prompt for Lovable, Cursor, or Claude.

What to do

Five checks for your own project

Use these on a project you own. The commands only read your own files; nothing here changes your app. Sources: Supabase Docs, API keys and Vite Docs, Env variables and modes.

  1. Step 1

    List every VITE_ variable your app uses

    Bolt.new web apps are usually Vite projects. The Vite docs say only variables prefixed with VITE_ are exposed to your client code, and that they should not contain sensitive information because they end up in the client bundle. Any API key in a VITE_ variable is readable by anyone who opens your site.

  2. Step 2

    Search the built JavaScript, not only your source

    Keys also leak when they are hard-coded in a component or pasted into a config file during a chat with the AI. Run a production build and search dist/ with the commands below. Whatever appears there is what every visitor downloads.

  3. Step 3

    Sort each key: public by design, or secret

    Supabase's API keys guide says the publishable key (sb_publishable_) and the legacy anon key are safe to expose, while the secret key (sb_secret_) and legacy service_role key bypass Row Level Security and must stay on a server. OpenAI keys, Stripe sk_live_ keys and AWS secret keys are always secret.

  4. Step 4

    Move secret calls behind a server function

    If a secret key is in the frontend, rotate it in the provider's dashboard first, then move the call into a Supabase Edge Function or another server route that reads the key from a server-only secret. The browser calls your function, never the provider directly.

  5. Step 5

    Check that Supabase tables are not open to the public key

    Even with only the anon key in the bundle, a table without Row Level Security in an exposed schema can be read through the Data API by anyone holding that key. Turn RLS on for every table and scope each policy to the signed-in user, then re-check the live site after each deploy.

# Run in your own Bolt project after downloading it and running a production build.
# Vite projects put the build in dist/

# 1. Which VITE_ variables does your code read? Each one is copied into the bundle.
grep -rEoh "import\.meta\.env\.VITE_[A-Z0-9_]+" src | sort -u

# 2. Known secret key shapes in the built JavaScript. Prints only the first characters.
grep -rEoh "(sk-(proj-)?[A-Za-z0-9]{4}|sk_live_[A-Za-z0-9]{4}|sb_secret_[A-Za-z0-9_-]{4}|AKIA[A-Z0-9]{4})" dist 2>/dev/null | sort -u

# 3. Legacy Supabase JWT keys start with eyJ. Decode the middle part and check the
#    "role" claim: anon is expected, service_role is a leak.
grep -rEoh "eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}" dist 2>/dev/null | sort -u

Copy-paste fix

Move secrets out of the browser with one prompt

Paste this into Bolt, Cursor, or Claude and point it at your own project. Review each change before you apply it, and rotate any secret key that already shipped.

You are helping me secure my own Bolt.new app. Keep existing features working.

1. List every environment variable the frontend reads (import.meta.env.VITE_*), every hard-coded key string, and any committed .env file. Only public keys (Supabase anon or sb_publishable_, Stripe pk_) may stay in frontend code.
2. For each secret key in the frontend (OpenAI, Stripe sk_, Supabase service_role or sb_secret_, AWS, any other provider), move the code that uses it into a Supabase Edge Function or server route that reads the key from a server-only secret. Remind me to rotate each old key.
3. Update the frontend to call that function instead of the provider directly, with the user's session for auth.
4. List every Supabase table in exposed schemas, enable Row Level Security on any that has it off, and write policies that limit rows to the signed-in user (for example auth.uid() = user_id).
5. Show me each change before applying it, then tell me how to rebuild and confirm no secret key appears in dist/.

FAQ

Straight answers about Bolt.new API keys

Does Bolt.new hide my API keys?

Not in frontend code. A key you put in a VITE_ variable, a .env file read by the client, or straight into a component is part of the JavaScript the browser downloads. Only code that runs on a server or in an Edge Function can keep a key private.

Is it okay that my Supabase anon key is in my Bolt app?

Yes, the anon or sb_publishable_ key is meant to be public. It is only safe when Row Level Security is on for every table and your policies limit rows to the right user. See our guide on whether the Supabase anon key is safe to expose.

My OpenAI key is in a VITE_ variable. What now?

Treat it as leaked. Revoke it and create a new one in the OpenAI dashboard, set a usage limit, and move the OpenAI call into a server function that reads the new key from a server-only secret. Then rebuild and redeploy so the old bundle is replaced.

Does a .env file keep keys out of the bundle?

Only for variables your client code never reads. Vite copies every VITE_ variable your code references into the build. A .env file is configuration, not protection, and a committed .env file can also leak through your Git repository.

How do I check the live site instead of my local copy?

Your hosting settings can hold different values than your local files. Open the live site, view the JavaScript files it loads, and search them for key prefixes, or run a scan that fetches the live bundles for you.

What does LeakLatch check here?

LeakLatch loads the live URL you give it and its JavaScript bundles, read-only. It looks for known secret key patterns such as OpenAI, Stripe secret, AWS and Supabase service_role or sb_secret_ keys, checks whether Supabase tables answer with your public anon key, and reviews security headers. Secret values are redacted in the report. You must confirm you own the site or have permission to scan it. It is not a substitute for a full security audit.

Want this check done for you, read-only?

Paste a URL you own. LeakLatch returns a score, redacted findings, and a fix prompt.

Scan my site free