Blog · November 6, 2026 · 10 min read

Is my Replit app secure? Check before you share the link

Is my Replit app secure? Check Secrets, public repls, exposed files, open databases and API routes before you share your .replit.app link.

You built something in Replit, hit Deploy, and now you have a .replit.app link. It works. Friends can open it. Then the question hits: is it actually safe to share? Can a stranger read my users' data? Did the Agent leave a secret key somewhere public?

Short answer: Replit makes it easy to ship, and Secrets is the right place for keys — but a working deployment is not a locked-down one. This is a practical self-check for vibe-coded Replit apps. You need about 20 minutes, your live URL, and a private browser window.

For a shorter prompt-only version, see our guide to securing a Replit app. This post goes deeper on what to look for and why.

Why Replit apps leak in the first place

Three Replit-specific habits trip people up:

  1. The repl is public by default in many tutorials. Anyone who can open the project can read every file. A key written in source is then public, even if you never meant to share it.
  2. The Agent (or any AI chat) wants things to "just work". When a call fails because a key is missing, the quick fix is often to paste the key into a file, or to turn an auth check off. That ships.
  3. Deploy serves whatever your web server exposes. If the server points at the whole project folder, visitors can fetch .env, .git/config and database files the same way they fetch your homepage.

None of that means Replit is unsafe. It means the checks below are yours to run before you post the link.

1. Secrets panel vs keys in source

Open the Secrets (or Environment Variables) panel in your Replit project. That is where keys belong. Your server code should read them with process.env.YOUR_OPENAI_KEY (Node) or os.environ["YOUR_OPENAI_KEY"] (Python) — never with the raw value written next to the name.

Then search the project for anything that looks like a real key:

If a key is in a source file, a .env committed to the repl, a notebook cell, or a comment the Agent left behind, treat it as stolen. Rotate it at the provider first, then move the new value into Secrets only.

Public repls make this urgent: anyone with the project URL can browse the files. Private repls help in the editor, but the deployed app can still leak keys through the browser or exposed files (sections 2 and 3).

Paste into Replit Agent: "Search the whole project for hard-coded API keys, tokens and passwords. Replace each with a read from an environment variable and list the exact Secret names I need to add in the Secrets panel. Do not print the values. Confirm nothing secret remains in source files."

2. Keys that reach the browser

If your Replit app has a frontend (React, Next, Vite, plain HTML with fetch calls), anything the browser loads is public. Visitors download your JavaScript. They can open DevTools and read it.

Two patterns cause most of the damage:

How to check: open your live .replit.app site, press F12, go to Sources (Chrome) or Debugger (Firefox), and search across files for the names of your secrets and for common key prefixes. You should find nothing secret. Finding the public anon key is normal.

If you find a secret, rotate it, put the new value in Replit Secrets, and have only a server route or backend function call the paid API. The frontend should call your route, not the provider directly. Your API key is probably sitting in your JavaScript walks through this pattern in more detail.

Paste into Replit Agent: "Find every VITE_ and NEXT_PUBLIC_ variable and every secret used from frontend code. Move any real secret into Replit Secrets and call it only from server-side code. The browser must never see OpenAI, Stripe secret, Resend or database secret keys."

3. Visit the dangerous URLs yourself

Before you share the link, open these on your live deployment (replace with your real host):

Each should show a normal "not found" page — not a file of settings. If .env or .git/config returns text, the web server is serving too much of the project folder. Rotate every key that appeared, then serve only the public/static build output.

This is one of the fastest outside checks you can do, and it catches mistakes that never show up in the editor.

Paste into Replit Agent: "Make sure the web server only serves the public or static build folder. Confirm that requests for /.env, /.git/config and any .db or .sqlite file return 404. Do not change business logic."

4. API routes that trust the caller

Replit apps often expose Express, FastAPI, Flask or Next API routes at paths like /api/orders or /api/generate. From the outside, a route that returns 401 to a stranger looks fine. The expensive bugs are usually one step further in:

How to check: list every data route. Where does the user identity come from — session on the server, or the request? Does every query also filter on that user? Sign up as two different people, create private data as the first, and open that item URL as the second. If they can see it, the route or database rules are wrong.

Paste into Replit Agent: "For each API route, add a server-side authentication check that returns 401 when there is no valid session. Every read or write must filter on the signed-in user from the session, never on a user id from the request body. List each route and what you changed."

5. Supabase RLS or Firebase rules (if you use them)

A lot of Replit apps store data in Supabase or Firebase. The default "open so I can build" setup must not go live.

Supabase: turn on Row Level Security on every table with user data. A policy that says "any signed-in user may read" (using (true) for the authenticated role) means anyone who signs up can read everyone else's rows. Each policy on private data should compare a column to auth.uid(). Our guide on checking whether your Supabase database is exposed shows how to test this from the outside with the public key.

Firebase: open the Realtime Database or Firestore rules. Rules that look like ".read": true or ".write": true on user data are an open door. Rules should check auth != null and that the path matches the signed-in user. See Firebase security rules check for a plain walkthrough.

Paste into Replit Agent: "If this project uses Supabase, list every RLS policy and flag any on user data that does not compare a column to auth.uid(). If it uses Firebase, show the current rules and rewrite them so each user can only read and write their own path. Do not leave open test rules in place."

6. Agent shortcuts that "just work"

Replit Agent is great at unblocking you. The same shortcuts are how insecure apps ship: pasting a secret into a file because Secrets "didn't load", returning mock admin data while building the UI, creating a table with no ownership column, adding a public route that calls a paid model with no per-user limit, or committing a .env for a teammate.

Before launch, skim the last few Agent changes and ask: did this fix remove a check, expose a key, or widen who can read data? If yes, put the check back.

Paste into Replit Agent: "Review the most recent changes for security shortcuts: hard-coded keys, auth checks that were removed, open database rules, and API routes that call paid services without a signed-in user and a per-user limit. List each issue with the file path. Do not change code until I say so."

7. Short self-check before you share the link

Run this on the live .replit.app URL, not only in the editor:

  1. Secrets live in the Secrets panel; source search finds no real keys.
  2. Live JavaScript has no OpenAI / Stripe secret / database secret keys.
  3. /.env and /.git/config on the live host return not found.
  4. Every data API route checks the session and ownership on the server.
  5. Supabase RLS or Firebase rules restrict each user to their own rows (or you confirmed you don't use either).
  6. Sign up as two different people and confirm the second cannot open the first person's private items.
  7. Any route that calls a paid API requires a signed-in user and has a per-user limit.
  8. You rotated any key that was ever in source, in a public repl, or in a scraped .env.

For the wider launch list across tools, use the pre-launch security checklist.

Prompts you can paste into Replit Agent

Copy these one at a time. Check the result yourself after each — Agent can miss things or claim a fix that did not stick.

Search the project for hard-coded API keys, tokens and passwords. Replace each with a Secrets / environment variable read. List the Secret names to add. Do not print values.

Ensure the web server only serves the public/static folder. Requests for /.env, /.git/config and database files must return 404.

For every API route: require a valid session (401 if missing), and filter every query by the signed-in user from the session. Summarise each route.

Review Supabase RLS or Firebase rules. Private data must be limited to the owning user. Remove open "any authenticated user" or public read/write rules.

Move any secret used from frontend code into Replit Secrets and call it only from the server. Remove VITE_ / NEXT_PUBLIC_ secrets that are not meant to be public.

Check it from the outside

Start with the stranger's view. Run the free Greenlight Scan on your live Replit URL and get a traffic-light result in about a minute: it looks for secret keys in your JavaScript, weak headers and cookies, and known-vulnerable libraries. The $19 Full Scan adds the deeper checks once you verify you own the site, like exposed files, open Supabase or Firebase data (counted, never downloaded) and API routes that answer without a login, with a fix prompt for Replit Agent for every finding. You can also start from our Replit tool page.

If your app takes payments or stores personal data, the code-level issues above are where the real risk sits — ownership checks, webhook verification, policies that only look safe. The $79 Launch Audit connects read-only to your GitHub repo, scans for committed secrets, and runs a deep AI review of auth, database policies and payment logic. A second AI double-checks every finding, and you get a prioritized fix plan and a launch verdict. It is automated, not a pentest, so it won't replace a human review for a high-stakes app, but it catches the mistakes AI tools make most often before your users do.

Newsletter

The Friday leak report

One short email a week: the newest ways AI-built apps leak data, and the one-line fix for each. No spam, unsubscribe any time.