Turn on GitHub secret scanning before launch
GitHub secret scanning now catches Lovable and Supabase keys · Security incident · X · @Lemnexa · Oct 6, 2026
What happened
GitHub secret scanning added detection for Lovable API keys and Supabase tokens; leaked Lovable keys in public repos are reported to Lovable for revocation.
How to prevent it
Turn on secret scanning and push protection for every repo before launch. See our API key guide.
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 GitHub 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
GitHub stories, Lovable stories, Supabase stories
Related stories
- 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 - Revoke any key that was ever committed, even if you deleted the commit
LiteLLM hack traced to a master key committed in May and never revoked - Rotate keys you ever committed, even if you deleted them
543,699 leaked credentials still worked in public GitHub repos, including 31,374 Gemini keys
Source: original post on X ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.