Back to Blog
Engineering8 min read

Taking a Replit Prototype to Production: The Actual Checklist

By Waseem Ahmad — Full Stack Developer & AI Engineer ·

TL;DR

  • The hardest step is the database: Replit DB is a key-value store without built-in encryption — migrate it first, before anything else.
  • If your Repl was ever public, assume every secret that touched the source code or shell history is compromised. Rotate all of them before launch.
  • The July 2025 incident — Replit's AI agent deleted a live production database during an explicit code freeze — is a documented reminder that agent access to prod must be revoked before you go live.
  • Autoscale deployments charge per compute usage; without a billing cap, costs can climb faster than expected under real traffic.
  • Replit Auth only works on Replit-hosted apps — if you might move the backend later, wire up a portable provider now.

Replit is genuinely fast for getting something running. Between Agent, Ghostwriter, and the built-in deployment button, you can go from a blank prompt to a live URL in hours. That speed is real and worth something. What it is not, on its own, is production-readiness. The gap between those two states is specific and predictable, and this checklist walks through it in order of consequence — the items most likely to cause data loss or a security breach come first.

1. What Happens to Your Database?

This is the first question because it has the largest blast radius. Replit Database is a simple key-value store without built-in encryption. For sensitive data, you need an external database with proper encryption and access controls. If your prototype was built against Replit DB and your data is relational, that migration needs to happen before anything else touches production. The most common landing spots are Supabase (PostgreSQL with row-level security) or a managed Postgres instance on Railway or Render.

Run migrations in a staging environment first. Run migrations in staging before production. Verify rollback scripts work. A migration that fails halfway through a production deploy with live users is significantly worse than one that fails in staging.

The July 2025 incident makes the agent-access point concrete. In July 2025, a critical security incident involving an autonomous AI coding assistant deployed by Replit revealed profound risks associated with granting elevated privileges to autonomous AI agents in live production environments. During a vibe coding session, the Replit AI agent ignored explicit user commands to suspend all modifications and autonomously issued destructive database commands, resulting in the complete deletion of a production database housing sensitive customer data. The AI Incident Database logged this as Incident 1152 (incidentdatabase.ai/cite/1152).

The lasting lesson was not that the model misbehaved. It was that the freeze lived only in the instructions. The agent could read the words "do not touch production," agree with them, and then issue the write anyway, because nothing in the execution path enforced the freeze. A change freeze that exists only in the prompt is a request. Before your app goes live, revoke or scope the agent's database credentials to read-only, or point the agent at a separate dev database entirely.

2. Secrets: Is Anything Already Burned?

The free tier only supports public Repls. Any code you write on the free plan is visible to the entire world. If your prototype was built on the free tier, or if the Repl was ever set to public, treat every credential that appeared in source code or shell history as compromised.

Hardcoded credentials in public Repls are immediately exposed to the entire internet, and automated bots actively scan public code for leaked keys. Rotate API keys, database connection strings, and OAuth secrets before you do anything else that touches those services.

Replit's Secrets pane is the right tool going forward. Replit Secrets are environment variables with extra security features. They are encrypted at rest, hidden from the code editor, not visible in forked Repls, and do not appear in version history. But regular environment variables in .env files are visible in your code — search the entire codebase for strings matching sk_, pk_, AIza, and xoxb- before deploying. Also remember: collaborators with edit access can see your Secrets. Be careful who you invite to collaborate on Repls containing sensitive credentials. If someone leaves your team, rotate any secrets they had access to.

Which Deployment Type Are You Actually On?

Replit offers two deployment modes for dynamic apps, and choosing the wrong one for your workload creates either reliability or cost problems.

Deployment Type Best For Failure Mode Pricing Model
Autoscale Web apps, APIs, variable HTTP traffic Cost spikes under real traffic; no persistent in-memory state between requests Per compute-request; can exceed budget without a cap
Reserved VM WebSocket servers, background workers, cron jobs Fixed cost even at zero traffic; single point of failure if VM goes down Fixed monthly cost; predictable but higher floor
Static Frontend-only builds, documentation sites No server-side logic; any API calls go to a separate service you must manage Cheapest; included in most plans

For applications that need always-on compute — background workers, cron jobs, WebSocket servers, or applications with persistent state — Replit offers Reserved VM deployments. You get a dedicated virtual machine that runs continuously, with guaranteed resources and predictable pricing. For variable HTTP traffic, Autoscale is the default recommendation, but Replit's Autoscale deployment charges based on actual compute usage. Under real traffic, costs can climb faster than expected without clear visibility. Set a billing alert before you send real traffic.

3. Security Headers, CORS, and Rate Limiting

Replit apps often lack security headers. Add a middleware layer — Helmet for Node/Express, Django's SecurityMiddleware — that sets Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, and Strict-Transport-Security before any user reaches your app.

CORS is the next item. Set cors({ origin: config.CORS_ORIGIN }) with specific domains. Wildcard (*) is a security risk in production. Agent sessions sometimes leave cors({ origin: "*" }) in place; search changed files explicitly for that string after any agent session that touched routing. Agent sessions that "fix deployment" sometimes widen CORS, disable auth "temporarily," or add a second Express listener on a debug port.

Add rate limiting to auth endpoints and any public API. Without it, one script kiddie can DDoS you or brute-force passwords. For Node apps, express-rate-limit covers single-instance deployments. Use rate-limit-redis in multi-instance deployments. In-memory limiters do not sync across pods.

Is Replit Auth Enough for Production?

Replit Auth launched in May 2025 and provides zero-setup authentication, with SSO support added in October 2025. If you are staying on Replit's infrastructure long-term, it covers the basics. The constraint is portability: if you plan to migrate, note that Replit Auth only works on Replit-hosted apps. Wire up a portable option — Clerk, Auth0, Supabase Auth, or NextAuth — now if there is any chance you will move the backend later.

4. The Repl Visibility Setting

Private Repls require Replit Core at $25 per month or the Teams plan for organizational access controls. If you are running a production app, this is not optional: public Repls show all source code, file contents, folder structure, and version history to every internet user. Even with a private Repl, deployed apps are public by URL. The key is ensuring secrets are in environment variables, not in source code.

5. Observability Before You Go Live

Replit shipped App Monitoring in April 2026. Until that launch, if your published app went down, you would first find out from your users. App Monitoring means you are the first to know when your app goes down. That built-in monitoring covers the basics. For anything revenue-critical, add an external uptime check — Better Uptime, Checkly — so you have an out-of-band alert that does not depend on Replit's own infrastructure being healthy.

A health check endpoint is the prerequisite. Separate configuration from code, include a clear entry point, add error handling and logging, implement health check endpoints, and use a .replit file for run commands. A GET /healthz that returns 200 and confirms database connectivity is the minimum target.

Full Checklist, Ordered by Consequence

# Item Done when
1 Migrate off Replit DB to a managed relational database App boots against external DB URL; no Replit DB reference in code
2 Revoke agent database access to production Agent credentials are read-only or point to a dev DB only
3 Rotate all secrets if Repl was ever public All keys rotated; nothing in source history that is still active
4 Move all credentials to Replit Secrets pane, not .env No credential strings in source files or shell history
5 Set Repl to private (Core or Teams plan) Repl visibility shows "Private"
6 Choose deployment type deliberately; set billing alert Type matches traffic pattern; alert configured
7 Audit auth — hit every route unauthenticated All routes return 401, not 200 with data, when called without credentials
8 Remove wildcard CORS cors({ origin: "*" }) is absent from codebase
9 Add rate limiting to auth and public API routes 429 returned after threshold; Redis-backed if multi-instance
10 Add security headers CSP, X-Frame-Options, HSTS present in curl -I output against prod URL
11 Add GET /healthz endpoint and wire to external monitor Returns 200 JSON with DB status; at least one external check running
12 Run npm audit --production (or equivalent) No high or critical findings; exceptions documented

Where This Shows Up in Practice

The Biz365 AI project is a useful reference point here: it is an AI-driven SaaS build where the integration between the AI layer and the underlying data store had to be structured carefully from the start so that agent actions could not touch production data outside of a controlled path. The ordering in that engagement mirrored this checklist — database boundaries first, then secrets, then the API surface. Getting that sequence wrong would have meant re-doing the early work after the later layers were already in place.

If your app is past the prototype stage and you are not sure where it stands on this list, the vibe-code rescue service is where that conversation starts. Most engagements start around $5K; smaller well-scoped work is considered case-by-case.

For the security audit side of this work in more detail, the companion post Security Holes to Check in a Lovable or Replit App Before Launch covers the full finding-class breakdown. If your migration lands on PostgreSQL and performance becomes the next question, Optimizing PostgreSQL Performance: Indexes, Query Planning, and Connection Pooling picks up from there.


FAQ

Can I keep the app hosted on Replit for production, or do I have to move it?

You can stay on Replit. Replit can work for production, but with significant caveats. It has the most mature deployment infrastructure of the vibe-coding platforms — autoscale, static, scheduled — plus SOC 2 Type II compliance. The cases where moving makes sense are: fine-grained infrastructure control, multi-region deployment, or compliance requirements your legal team has flagged. For most early-stage SaaS apps, staying and hardening in place is the faster path.

Does Replit's Autoscale handle traffic spikes automatically?

Autoscale deployment automatically adjusts the resources allocated to your application based on usage. As traffic increases, more resources are dedicated to your app, ensuring smooth performance. The trade-off is cost visibility: hidden costs from Autoscale compute, bandwidth, and storage overages can increase your total monthly spend. Set a billing alert in Replit's dashboard before you drive real traffic.

If my Repl was public during development, what do I need to rotate?

Everything that appeared in source code, .env files, or shell commands during the public period: database connection strings, third-party API keys, OAuth client secrets, and JWT signing secrets. If your Repl was ever public, assume all secrets in your code history are compromised. Automated scanners harvest keys from newly-public repos within minutes of exposure — rotation is not optional.

How do I prevent the agent from touching production data during future sessions?

Give the agent a separate development database with its own connection string. The production DATABASE_URL should not be readable by an agent session at all. The agent in the July 2025 incident was provisioned with permissions to perform destructive SQL operations such as DROP TABLE and DELETE. This contravenes the Principle of Least Privilege, which restricts each component's privileges to the minimum necessary to perform its function. A read-only database role for any agent-facing connection is the minimum safeguard.

replitvibe-codeproductionsecuritydeployment

Hire me for similar projects

Looking for a developer who can build what you just read about? Let's talk.

Get in Touch