For Replit apps
Is my Replit app exposing API keys?
Direct answer
A key in Replit Secrets is not automatically private. If any frontend file, client component, or browser-prefixed env var reads that value, the published JavaScript will contain the secret. Anyone who opens your live URL can copy it. Rotate it, keep the new value on the server, and republish.
This is the same class of leak as on Lovable, Bolt, and Cursor apps: the build inlines whatever the client is allowed to see. LeakLatch is a free, read-only scan of a live URL you own. It checks the page and its JS bundles for leaked secrets, reports Supabase tables that are readable without Row Level Security when a public anon key is already on the page, and notes missing security headers. You get a risk score, redacted findings, and a prompt you can paste into Cursor, Claude, or your Repl.
Owner checks
How to check your own Replit site
Use these on an app you own or have permission to test. They are pre-ship checks, not a penetration test, and they do not involve writing to the database or logging into your Replit account.
Step 1
Open the published URL, not only the Replit editor
The leak that matters is whatever visitors download. Open your production address — a .replit.app URL, a custom domain, or the Autoscale/Reserved VM deployment — in a private window. The editor preview and the published build can differ. If you only searched the Repl source, you can miss a secret that was inlined at build time and is still in the live bundle.
Step 2
Search the live HTML and JavaScript for server secrets
View source on that live page. Note every script src, plus any modulepreload or preload-as-script links. Open those files and search for sk_live, sk_test, sk-proj-, sk-ant-, AKIA, ghp_, github_pat_, re_, service_role, sb_secret_, and eyJ (the start of a JWT). A Supabase anon or sb_publishable_ key, or a Stripe pk_ key, is expected in the client. A Stripe secret, OpenAI key, AWS access key, GitHub token, Supabase service_role JWT, or sb_secret_ key is not. If you find one, treat it as public.
Step 3
Check how the secret got into the client build
Replit Secrets stay on the server only if server-side code is the only thing that reads them. If a frontend file, a client component, or any env var prefixed for the browser (VITE_, NEXT_PUBLIC_, PUBLIC_) reads the same value, the bundler copies it into a file every visitor can download. Search your Repl for those prefixes and for direct fetch calls to api.openai.com, api.stripe.com, or similar from UI code. A later AI prompt can put a key back into a client file after you thought you had moved it.
Step 4
If you use Supabase, check Row Level Security as well
Shipping the anon key is normal. It is only safe when RLS is on and the policies are tight. In the Supabase dashboard, open Advisors → Security Advisor and fix tables marked publicly accessible. A leaked service_role key is a separate, more serious incident: that key bypasses RLS, so rotate it before you do anything else.
Step 5
Rotate first, then redeploy, then search the new bundle
Deleting a line in the Repl or removing a Secret does not revoke a key that already shipped. Rotate the credential at the provider so the copied value stops working, keep the new secret in Replit Secrets and in server-only code, republish, and search the new production JavaScript to confirm the old value is gone. Repeat this after every deploy that touches env vars or client code.
Why this comes up
The published bundle is what leaks
Replit makes it easy to ship a working frontend and backend from one Repl. The usual path into a leak is not “Secrets appeared in the public source tree.” It is a fetch to OpenAI, Stripe, or another provider written in a file the browser loads, often after a chat prompt that pastes a key so the preview works. The published site then serves that value to every visitor.
Vite and Next.js make this worse if you prefix the variable for the client. VITE_ and NEXT_PUBLIC_ values are substituted into the bundle at build time. Changing or deleting the Secret later does not edit an already-published file. You have to rotate the key and publish a new build. See also whether VITE_ and NEXT_PUBLIC_ variables are public and how to check a live website for leaked API keys.
LeakLatch does not read your Replit Secrets or your repository. It looks at the same HTML and JavaScript a visitor already receives — the page, inline scripts, and up to 15 linked or preloaded script files — and matches known secret formats. A clean result means those patterns were not in the files it could fetch, not that every route and every possible secret is safe.
Copy-paste fix
Prompt you can paste into Cursor or Claude
After you rotate any secret that already shipped, paste this into Cursor, Claude, or your Repl and point it at your own project.
You are helping me fix security issues on my own Replit app. Do not introduce new secrets into client-side code. Keep existing product behavior working. 1. Search the repo and any built frontend bundles for server secrets (Stripe sk_live / sk_test, OpenAI, Anthropic, AWS access keys, GitHub tokens, Resend, Supabase service_role or sb_secret_ keys, and similar). Move every secret into Replit Secrets and into server-only code (API routes, server handlers, or backend services). Never put them in VITE_, NEXT_PUBLIC_, PUBLIC_, or other client-exposed env vars, and never read them from a file the browser loads. 2. If the app uses Supabase, enable Row Level Security on every table in an exposed schema. Replace policies that allow the anon role to read or write all rows (for example USING (true)). 3. Rotate any secret that was already shipped in a public bundle, then confirm the old value no longer works. 4. Do not log or print full secret values.
FAQ
Straight answers about Replit and keys
Are Replit Secrets automatically safe?
No. The Secrets tab keeps values out of the Repl’s public source view, but it does not stop you — or an AI assistant — from reading those values in client-side code. Once a secret is in a file the browser loads, anyone can copy it. Secrets are safe only when they stay on the server.
Is a Supabase anon key or Stripe publishable key in my Replit app a leak?
No. Those keys are designed to be in the browser. The risk is a different secret in the same bundle, or a Supabase table that is readable because Row Level Security is off or a policy is too broad.
Does LeakLatch log into my Replit account or read the Secrets tab?
No. You paste a live URL you own. LeakLatch fetches that page, its inline scripts, and up to 15 linked or preloaded JavaScript files, then looks for known secret patterns. If a public Supabase URL and anon key are already on the page, it may make a read-only GET to list table names and row counts. It never logs into Replit, never reads your Secrets, never writes to your app, and never stores or shows database row contents.
Can I scan someone else’s Repl?
No. You must confirm you own the site or have permission to scan it. Unsolicited scanning of other people’s apps is not allowed.
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