ContactBook a call

Security

Replit app to production: a checklist

Taking a Replit Agent app live: separate dev and production databases, production secrets, backups, and what the July 2025 database deletion taught.

Cover for “Replit app to production: a checklist”, with the line: Keep the agent working on a copy, and keep production somewhere it can only read.
Keep the agent working on a copy, and keep production somewhere it can only read. Image: SBD.

To take a Replit Agent app to production, you need a separate production database the agent cannot change, production secrets kept apart from development ones, a published deployment with sign-in checked on the server, and a restore you have tested. Replit now builds most of this in. Every app has a development database for building and a production database for the published app, and Replit's documentation says the Agent can only read production, through a read-only replica. The checklist below confirms those protections are switched on for your app, then covers the parts Replit leaves to you.

This post is for founders who built an app with Replit Agent and are about to put paying users or real company data on it. It starts with the incident that changed how Replit handles databases, then goes through the checklist.

The short answer

Before launch, confirm your published app's DATABASE_URL points at the production database and not the development one. Put every live API key in Production app secrets. Check that each API route verifies who is calling it. Restore a backup once so you know how long it takes. Older apps, especially ones that predate the dev and production split, need the most attention.

What happened in July 2025

In July 2025, Jason Lemkin, founder of SaaStr, was running a twelve-day trial building an app with Replit Agent. He reported that the agent deleted his production database during a declared code freeze, after being told not to make changes. Coverage by The Register and Fortune reported that the database held records on more than 1,200 executives and roughly 1,190 companies. Lemkin also said the agent had produced fake data and misreported test results, and that it initially told him the data could not be recovered. The rollback did in fact work.

Replit’s CEO, Amjad Masad, called the deletion unacceptable. Replit said it had begun rolling out automatic separation of development and production databases that weekend, pointed to its existing backups and one-click project restore, and promised Lemkin a refund and a postmortem.

The lesson for anyone shipping on any agent platform is plain. An agent with write access to the live database can delete it, whatever it has been told in chat. Instructions are not permissions. The protection that works is one the agent cannot get round: a database it has no write access to, and a backup stored somewhere else.

How Replit handles databases now

Replit’s development and production documentation describes the current setup:

  • Every app has two databases. The development database is where you and the Agent build, and the production database serves the published app.
  • The Agent cannot modify the production database. It reads production through a read replica, which can lag slightly behind.
  • Both environments use a variable called DATABASE_URL, with a different value in each. In the workspace and Shell it points at development. When you publish, the app gets its own value pointing at production.
  • Schema changes made in development are applied to production when you publish.
  • Production values live under Publishing, in Production app secrets, separate from development secrets.

Apps created on older infrastructure may still have a single shared database or a leftover NEON_DATABASE_URL secret. Replit has a separate guide for migrating a shared database. If your app was built before the split, assume nothing until you have checked.

The checklist

Work through this with the Replit project open. Each item has a test you can run.

  1. Confirm the published app uses the production database. Open Publishing, choose Adjust settings, and find DATABASE_URL under Production app secrets. Compare its host with the connection string in the production database’s Settings tab. Replit warns that both values contain your password, so compare them on your own screen.
  2. Look for a database URL you added yourself. If there is a DATABASE_URL in development Secrets that you created, your app may be talking to a database Replit is not managing. Find out which one before launch.
  3. Move live keys into Production app secrets. Payment, email and AI provider keys should be set only for production, and development should use test keys. Search the code for any key pasted directly into a file.
  4. Check the front end for secrets. If the app has a React or Vite front end, build it and search the output for key prefixes such as sk_, sk- and re_. Anything found there is public.
  5. Check every API route for auth. For each route that reads or changes data, confirm the server checks the session and the user’s permission to touch that record. A route that trusts a user id sent from the browser lets anyone read anyone’s data by changing a number.
  6. Review schema changes before publishing. Because development schema changes apply to production on publish, read what changed. A dropped column in development means dropped data in production.
  7. Test a restore. Use the project restore or a database backup to bring back an earlier state on a copy. Note how long it takes and who has to do it.
  8. Keep your own export. Schedule a daily pg_dump of the production database to storage outside Replit. If the platform, your account or the agent has a bad day, you still have yesterday’s data.
  9. Set up a custom domain and monitoring. Point your domain at the deployment and add an uptime check so you hear about an outage before a customer does.
  10. Limit who can run the Agent on the live project. Collaborators with Agent access can make changes. Keep that list short.

What the checklist does not cover

These checks deal with the database, secrets and the obvious auth gaps. They do not test business logic, such as whether a user can apply a discount twice or see another team’s invoices through a report. They also do not cover rate limits, abuse of sign-up forms, or how the app behaves when a third-party API is down. Those need someone reading the code with the business rules in mind.

When to bring someone in

If customers will put money or personal data into the app, get it reviewed before launch. Our vibe-coded app audit starts at $500 and you receive a written report within a week, ranked by risk, covering the database setup, secrets, auth on each route, backups and restore. Harden starts at $1,000 if you want us to make the fixes, and Rebuild starts at $8,000 when the app needs a new server layer.

If parts of the app were built in other tools, the related reviews are Is my Bolt.new app secure? and Cursor app security review. Apps on Supabase have the extra row-level security step described in Your Lovable app is probably public, and our Supabase integration page shows how we set it up on client builds.

Questions we get asked

Can Replit Agent still delete my production database?

Replit’s documentation says the Agent cannot modify the production database on current infrastructure and reads it through a read-only replica. Check your app is on that setup, and keep an external backup regardless, because an agent with access to your code can still publish a schema change you did not read.

Do I need to use Replit’s database?

No. You can connect an external Postgres such as Supabase or Neon. You then own the separation between development and production yourself, which means two databases and two sets of credentials.

Is Replit fine for production?

Plenty of small apps run on Replit deployments. The questions are the same as on any host: is production data isolated, are secrets kept out of code, does every route check the user, and can you restore. Answer those and the host matters less.

Where did the 1,200 executives figure come from?

From news reports of Lemkin’s posts, including The Register and Fortune. We have not seen the data ourselves.

Sources and further reading

  • Replit
  • Vibe coding
  • Security
  • MVP audit

Keep reading

Cover for “Cursor app security review: what to check”, with the line: Review the app, the packages it pulled in, and the files that tell the editor what to do.

Security

Cursor app security review: what to check

Reviewing an app built with Cursor: secrets in the repo, auth on API routes, hallucinated packages, rules file and MCP injection, and the 2025 Cursor CVEs.

Cover for “Is my Bolt.new app secure? The checks to run”, with the line: The database is reachable from the browser, so the rules on each table decide who sees what.

Security

Is my Bolt.new app secure? The checks to run

How to check a Bolt.new app before launch: row-level security on Supabase or Bolt Database, keys in the bundle, Netlify secrets and the Security page.

Cover for “Exposed API keys in AI-built apps: find and fix them”, with the line: A key in browser code belongs to everyone who opens the page, and deleting it later does not take it back.

Security

Exposed API keys in AI-built apps: find and fix them

How API keys leak from Lovable, Bolt, v0, Replit and Cursor apps, how to search your bundle and Git history for them, and how to rotate and move them safely.

Find out what is worth automating

About 95% of AI pilots never reach the profit line. We start with the work your team still does by hand and measure each build by the hours it saves.

See how we work

Cookie preferences

Choose what this site may use on your device. You can change this at any time from “Cookie settings” in the footer.

Strictly necessary

Keep the site working and remember the choices you make here. These cannot be switched off, and none of them track you.

Always on
What this includes (4)
NameProvider PurposeDuration
sbd-consentThis site Remembers your cookie choices12 months
Vercel Web AnalyticsVercel Inc. Counts page views in aggregate. Sets no cookie and stores nothing on your deviceNone
ticker-dismissed, sbd-note-offThis site Remembers that you closed a notice or language tipUntil the tab closes
sbd-voice-resume, sbd-voice-prefillThis site Carries a voice conversation across pages, only if you start oneUntil the tab closes

Analytics

Tell us which pages are read and where visitors leave, so we can improve them. IP addresses are anonymised and nothing is used for advertising.

What this includes (2)
NameProvider PurposeDuration
_gaGoogle Analytics (Google LLC) Distinguishes visitors with a random ID13 months
_ga_FPXDMQPRV1Google Analytics (Google LLC) Keeps the session state for this site13 months

Functional

Embedded services that set their own cookies. Without them the site still works; you get a link to open the service instead.

What this includes (1)
NameProvider PurposeDuration
Booking calendarCal.com Inc. Shows live availability and books the call on the booking pageSet by Cal.com

Advertising

Not used. This site has no advertising, retargeting or social media tracking, and we never sell data.

Not used

Questions about your data: hello@smallbaydigital.com