SECURITY6 min read

AI coding agents and your production data: six guardrails

AI agents can run commands and change databases. Six guardrails that keep them away from live customer data, from separate environments to backups you own.

AI coding agents don't just suggest code any more. They run commands, change databases and deploy. That's what makes them fast, and it's also why a single wrong step can reach your live customer data. Replit has described a 2025 incident where an AI agent deleted a customer's database data, which was restored by rollback, and it has since added stronger safeguards.

You don't have to stop using AI to build. You do need a few guardrails between the agent and the data your business runs on.

Where agents meet live data

The line between test and production is often blurrier than it looks on AI platforms:

  • Base44: remote dev mode runs your front end against the hosted backend, and writes go to production data.
  • Replit: the default DATABASE_URL points to the development database, which is good for safety but easy to confuse with production during a move.
  • Emergent: the Database Manager edits live data with no undo, and deleting a project permanently removes the code and the database.
  • Any app: an agent given your production connection string or a database admin key can do anything that key allows.

Six guardrails worth having

1. Separate development and production

Give the agent a development database with realistic but non-sensitive data. Production credentials shouldn't be anywhere the agent can read them.

2. Backups you own, and have restored

Platform backups exist for the platform's resilience. Emergent, for example, says its production backups aren't a self-serve restore service. Keep your own regular exports in an account you control, and test a restore before you need one.

3. Least-privilege keys

Where the agent needs database access, give it a role that can only do what the task requires. A key that can't drop tables can't be talked into dropping them.

4. Review changes before they reach production

Read the diff, especially database migrations that delete or rename columns. Deploy through a step a person approves, not straight from the agent.

5. Keep secrets out of the conversation

Anything you paste into a chat with an AI tool can end up in code, logs or history. Store secrets in your host's environment settings and refer to them by name. See API keys in your front end.

6. Know your way back

Write down how you'd restore the database and roll back a deploy, and who can do it, before an incident rather than during one.

DURING A MIGRATIONMoves are when data is most at risk.

Exports run, databases are restored and connection strings change. Never test a half-migrated app against live data, and take an independent backup before anything moves.

How AppExit handles your data

We use AI tools to speed up the routine parts of a migration, but every migration is reviewed and carried out by experienced developers, not left to an AI. We take an independent backup before any move, whichever platform you're on, request only the access the work needs, and review what can be revoked at handoff. Before and after the move, we check for exposed keys, data anyone can read, sign-in and access rules, and outdated packages, and tell you what we find.

Web apps from Base44, Lovable, Bolt.new, Replit and Emergent are a flat $199, code and database included. Read how we handle access, or start your order.

Sources

Sources checked November 2026. AppExit is not affiliated with any platform named. Brand names belong to their owners.

Share this guideLinkedInXReddit
KEEP READING