Get secret keys out of your frontend bundle
Scan of 978 vibe-coded apps finds 1 in 26 ship a secret key to every visitor · Web · Oct 2026
What happened
A developer scanned 978 public apps built with Lovable, Bolt and v0. 37 of them shipped at least one secret key in client code, mostly Telegram bot tokens and AI provider keys, because they were stored in VITE_, NEXT_PUBLIC_ or REACT_APP_ variables.
The honest numbers
- Reports 37 of 978 apps exposed at least one secret key
- Reports 17 Telegram bot tokens and 9 AI provider keys among the leaks
- Reports 8.8% of sites served public source maps
As stated by the source. Not independently verified.
The lesson
Anything in a VITE_, NEXT_PUBLIC_ or REACT_APP_ variable is public. Keep secret keys on a server route and rotate any key that was ever in the bundle.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
I'm a beginner and want to make sure my API keys are safe in my Lovable project. 1) Search the code for hardcoded keys or tokens and for secrets in variables that ship to the browser (NEXT_PUBLIC_, VITE_, REACT_APP_). List the file and line, but don't print the values. 2) For each one, tell me whether it's meant to be public (like a Supabase anon key) or secret. 3) For secret ones, show me how to move them to server-side env vars and call the provider through a server route. 4) Give me the steps to rotate each exposed key in the provider's dashboard and set a spending limit. 5) Make sure .env is in .gitignore and in my AI tool's ignore file. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: leaked secrets & api keys
Secret keys placed in front-end code, mobile bundles or public repositories can be found by automated scanners and abused, often running up large bills on AI or cloud accounts before anyone notices.
A quick checklist before you ship
- Keep secret keys only in server-side environment variables, never in browser or app code.
- Set spend limits and usage alerts with every AI and cloud provider.
- Turn on secret scanning and push protection for your repositories.
- If a key leaks, revoke and replace it first; deleting the file is not enough.
More on this: every leaked secrets & api keys story and our related guide.
Tools involved
Lovable stories, Bolt stories, v0 stories
Related stories
- Check your repo for committed .env files and open tables
Scan of 25,000 AI-built repos: Bolt leaked most, Lovable led on committed .env files - Turn on GitHub secret scanning before launch
GitHub secret scanning now catches Lovable and Supabase keys - If you self-host n8n with several users, upgrade to 1.123.96, 2.47.6, 2.48.3, 3.2.2 or later and check active workflows for triggers using credentials their owner didn't set
n8n let a member activate a workflow using someone else's credential if they knew its ID
Source: original post on Web ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.