Is your Lovable app's GitHub repo public? How to check, make it private, and what to rotate
Making the repo private stops new visitors, not copies. A two-minute check, GitHub's documented steps, and the rotation order that actually closes the leak.
You connected your Lovable project to GitHub so you'd have a backup. Weeks later you wonder who can actually see that repository, and whether anything secret is sitting in it. Maybe a friend mentioned they could open it. Maybe GitHub or a provider emailed you about an exposed key.
Here is how to check in two minutes, how to lock it down, and the part most guides skip: what to rotate afterwards, because making a repo private doesn't undo the time it was public.
Does Lovable make the repository public?
Lovable's GitHub docs say the repository it creates is "private by default, so nobody can see your code unless you change its visibility on GitHub." Visibility is controlled in GitHub, not in Lovable. So a public repo is almost always a change made on the GitHub side:
- you or a teammate switched it to public to share the code
- an organization owner changed it
- you're looking at a different, older repository from an earlier export or test
Disconnecting a project in Lovable only removes the link between the project and the repository. Lovable's docs describe it as removing the link, not as changing visibility, so check GitHub directly.
Check from the outside in 60 seconds
Your own browser is the wrong test, because you're signed in and can see private repos.
- Open a private or incognito window and don't sign in to GitHub.
- Go to
https://github.com/your-name/your-repo. - If you can see the code, it's public. A 404 means private.
Or from a terminal:
git ls-remote https://github.com/your-name/your-repo.git
If it lists branches and commit hashes without asking for credentials, the repo is public. If it asks for a username or fails, it's private. Only run this on repositories you own.
Check every repo Lovable created for you, not just the current one. Each connected project has its own.
Make it private
GitHub's documented steps:
- Open the repository and click Settings.
- In the Danger Zone, next to "Change repository visibility", click Change visibility.
- Choose Private and confirm.
GitHub's docs list what changes when a public repo becomes private, and a few of these matter for a leak:
- Public forks stay public. GitHub detaches them into a new network, but "public forks are not made private." Anyone who forked your code keeps their copy.
- Stars and watchers are erased.
- If an organization owner has restricted visibility changes, you'll need an owner to do it.
Don't delete the repository as your first move. Deleting stops Lovable's sync and removes your own record of what was exposed.
The part that matters: assume anything in it was copied
While a repository was public, anyone could clone it, and clones keep the full history. Making it private stops new visitors. It doesn't pull back copies.
GitHub's own guidance on a leaked secret is direct: "It is not sufficient to simply remove the secret from your codebase. The most important remediation step is revoking the secret with the secret's provider." So the real fix is a rotation, not a deletion.
Find what's in there
Search both the current files and the history:
git grep -nE "service_role|sk_live|sk-|whsec_|BEGIN PRIVATE KEY"
git log --all -p -S"service_role" --oneline
git log --all --diff-filter=A --name-only -- .env .env.local
Things that often show up in AI-built repos:
- a committed
.envor.env.local - a Supabase service_role key pasted in to get past a permissions error
- Stripe, OpenAI or Resend keys written directly into a component
- values in
VITE_orNEXT_PUBLIC_variables, which are compiled into the public JavaScript anyway - database URLs with passwords
The Supabase anon / publishable key is different. It's meant to be public and appears in every Supabase site's JavaScript. What decides whether it's safe is Row Level Security. See https://proofforge.live/guides/supabase-anon-key-vs-service-role-key
Rotate in the right order
- Treat every secret you found as stolen, even if you deleted it from the code long ago. It's still in the history.
- Create the new key at the provider, move your app to it, then revoke the old one. Provider-specific steps:
- Store the new values as server-side secrets, never in a public-prefixed variable: https://proofforge.live/fix/vite-env-secrets
- Check each provider's logs for use you don't recognize, covering the window the repo was public.
- Redeploy so the old values aren't in the live app.
If you also want to scrub the history, be careful. GitHub's docs warn that rewriting history means coordinating with everyone who has a clone, that someone who pulls and pushes from an old clone "will bring the sensitive data back," and that branch protections blocking force pushes have to be turned off temporarily. For most small projects, rotating every secret and keeping the repo private is the safer path, and a history rewrite is optional once nothing in it works anymore.
If a push was blocked by GitHub's secret detection, this explains what it found and what to rotate: https://proofforge.live/errors/github-push-protection-secret
What a repo check can't tell you
A private repository tells you your source isn't public. It tells you nothing about what your deployed site serves to every visitor. Those are two different exposures:
- a key in your repo may also have been compiled into the live JavaScript
- a key that's only in the live JavaScript may not be in the repo at all, if your builder injected it at build time
- the database rules decide what the public anon key can read, and neither the repo nor its visibility changes that
So after you've locked the repo and rotated keys, check the live site from outside.
- Signed out, open your live site, then DevTools → Sources, and search all files for
service_role,sk_live,sk-andwhsec_. - Run ProofForge's free scan on your live URL. It reads what a visitor receives, with no login: secret keys in the bundle, tables an anonymous visitor can read, exposed
.envand source map files, and missing headers. It shows your grade, every finding's severity and impact, and the top fix in full: https://proofforge.live - Test from a second account whether users can see each other's rows: https://proofforge.live/two-account-test
The scan checks the live app, not your GitHub repository, and it says so in its methodology: https://proofforge.live/methodology
Why the $9 helps here
After a leak, the slow part is the loop: ask your builder to fix, check, it breaks something, ask again, each round using credits. $9 once unlocks every finding with exact code fixes and prompts written for your builder, so each problem is one precise prompt. Fix + Guard ($29 once) adds deploy-hook rescans for 30 days, so a later prompt can't quietly put a key back into the bundle. There's a 14-day refund and no subscription: https://proofforge.live/pricing
Sources, checked December 1, 2026:
- Lovable docs, "GitHub" integration, docs.lovable.dev/integrations/github
- GitHub docs, "Setting repository visibility," docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility
- GitHub docs, "Remediating a leaked secret in your repository," docs.github.com/en/code-security/tutorials/remediate-leaked-secrets/remediating-a-leaked-secret
- GitHub docs, "Removing sensitive data from a repository," docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
- ProofForge tiers, proofforge.live/pricing.json
Comments
Join the discussionNo comments yet. Be the first to comment.