Replit Agent Security: What Your App Exposes and How to Lock It Down

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

Replit Agent Security: What Your App Exposes and How to Lock It Down

Replit Agent takes you from prompt to public URL faster than anything else — and that speed is the security story. Agent optimizes for a working app at a public address. Locking it down is a separate pass, and nobody runs it for you. Here's what Replit Agent apps typically expose and how to check each one.

Check 1: Is Your Repl (and Its Code) Public?

Replit workspaces have visibility settings, and Agent-built projects sometimes end up more visible than their owners realize. Check your repl's privacy setting right now: who can view the code? If the answer is "anyone with the link" or "public," then your source code — including every mistake the Agent made — is readable.

This matters more than it sounds, because of Check 2.

Check 2: Secrets in .env Files and Code

Replit offers a Secrets tool (environment variables managed outside your code) — use it for everything sensitive, and verify the Agent actually did. Agents frequently take shortcuts: hardcoding keys into source files, writing them into .env files that get committed when you connect GitHub, or echoing them into the console output that stays in the repl's history.

Check it:

# In the Replit shell: search the whole project for key patterns
grep -rniE 'sk_live|sk-[a-zA-Z0-9]{20,}|AIza|api[_-]?key\s*=\s*["\x27][^"\x27]{10,}|secret\s*=\s*["\x27][^"\x27]{10,}' . --exclude-dir=node_modules --exclude-dir=.git | head -20

Also open your connected GitHub repo (if you linked one) and check the commit history for secrets — .env files committed to git stay compromised even after deletion. Anything found gets rotated, not just removed.

Then check the running app's exposure from the outside:

# Secrets the browser can see: download the served JS and grep
curl -s https://your-app.replit.app | grep -o 'src="[^"]*\.js"' | head -3

If a key the Agent referenced from frontend code got baked into the bundle, it's public. Move secret-touching logic server-side.

Check 3: Endpoints Without Authentication

Agent builds API endpoints the way it builds everything else: to make the demo work. An endpoint like /api/users or /admin/stats that returns data to your logged-in browser will usually return the same data to a stranger's curl with no cookies at all — unless someone added an auth check, and Agents rarely do unprompted.

Test it — in a logged-out browser or straight from the terminal:

curl -s https://your-app.replit.app/api/users | head -c 400
for p in /admin /debug /test /api/debug /api/admin; do
  echo "$p -> $(curl -s -o /dev/null -w '%{http_code}' https://your-app.replit.app$p)"
done

Every data endpoint needs a server-side auth check. Every debug/admin page the Agent created while iterating needs to be deleted or put behind real authentication before the app serves real users. An unlinked URL is not access control.

Check 4: The Database Is Reachable — By Whom?

Agent typically wires up a database (Replit's Postgres offering or an external one like Neon/Supabase) using a connection string. Two things to verify:

  1. The connection string lives in Replit Secrets, not in code or .env files. Grep for postgres:// and DATABASE_URL across the project and git history.
  2. The database itself requires authentication. If the Agent created a database with a weak password, a default password, or — worst case — trust authentication, then anyone who finds the host can connect. Check your database provider's dashboard: strong unique password, TLS required, and access restricted to expected sources where the provider allows it.

A leaked connection string plus an open database is game over. Verify both halves.

Check 5: Deployment vs. Development URL

Replit has two ways your app is reachable: the development repl URL (while you're building) and the production deployment (Replit Deployments). They have different properties:

curl -sI https://your-app.replit.app | grep -iE 'strict-transport-security|content-security-policy|x-content-type-options|x-frame-options'

Replit won't set application headers for you. Add them in your app's server code or at your edge (a Strict-Transport-Security, a reasonable Content-Security-Policy, X-Content-Type-Options: nosniff, and clickjacking protection are the baseline).

Check 6: File Uploads and Static Serving

If Agent added file uploads, check two things: uploads are validated by content type (not file extension), and uploaded files aren't served from a path that executes them. Also check what your static server exposes — Agent sometimes serves the project root, which can make .env, config files, or backup files fetchable:

for p in /.env /.git/HEAD /config.json /.replit; do
  echo "$p -> $(curl -s -o /dev/null -w '%{http_code}' https://your-app.replit.app$p)"
done

Anything returning 200 that isn't an intentional public page needs to be blocked or removed.

Check 7: Cookies and Sessions

If your app sets session cookies, inspect them in DevTools → Application → Cookies. They should carry HttpOnly, Secure, and SameSite=Lax (or Strict). Agent-generated session handling frequently omits all three — which makes session theft via XSS or network sniffing much easier than it needs to be.

Check 8: Rate Limiting on Auth

Agent doesn't add rate limiting. Your login, signup, and password-reset endpoints accept unlimited attempts, which makes credential stuffing and password guessing trivially cheap for an attacker. Add throttling in your server code for auth endpoints (a simple per-IP attempt counter with exponential backoff is enough to start), and verify: 50 rapid login attempts should start returning 429s.

The Replit Agent Lockdown Pass

In order: repl visibility → project-wide secret grep → git history check → logged-out endpoint sweep → database credential and access review → production URL vs dev URL → HTTPS + headers check → exposed-file probes → cookie flags → rate limiting. Then make it a habit: re-run the sweep after every Agent session that touches auth, APIs, or integrations, because the next prompt can undo the last lockdown.

Don't Want to Do It by Hand?

This pass takes an afternoon the first time, and the step you skip is the one that matters. PreShipIt probes your app the way an attacker would: from the outside, with no login and no access to your source code. Paste your URL, attest that you own the app, and for $29 (one time) you get a plain-English prioritized report of what's actually exposed.

PreShipIt runs an outside-in, unauthenticated scan of the single host you submit. It doesn't test anything behind a login, doesn't review your source code, and doesn't guarantee your app is secure — it shows you what an unauthenticated visitor can see and reach, so you can fix it first.

Get your pre-ship inspection at preshipit.com

The PreShipIt Brief — a short weekly email for people shipping vibe-coded apps: the week's important vulnerabilities and launch-safety checks, in plain English.

New and free. Double opt-in: we email you a confirmation link before anything else arrives. Unsubscribe any time.

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

← Back home · Run a free mini-scan · Scan my app — $29 · See a sample report