Your Vibe-Coded App Might Be at Risk
AI coding agents make it easy to build fast, but working directly against a production database turns everyday prompts into risky, hard-to-reverse operations. This piece explains why CI/CD and separate databases matter, and lays out a minimum viable workflow to keep experimentation safe.
AI coding agents make it possible to build and launch useful software without years of development experience. They can create interfaces, connect authentication, define database tables, and deploy an application in remarkably little time.
That speed also makes it easy to skip practices whose value only becomes apparent after something goes wrong. One of the highest-risk shortcuts is allowing an AI agent, local development environment, or untested code to work directly against a production database.
If your app has real users, its database may already contain account details, customer records, payments, bookings, documents, or other information that cannot be casually reconstructed. At that point, changing the application is no longer just a coding task. It is a controlled change to a live system.
CI/CD (Continuous Integration/Continuous Delivery) workflows and separate development databases exist to make those changes safer. You do not need enterprise infrastructure to benefit from them, but you do need a basic boundary between experimentation and production.
What does “vibing on production” mean?
Vibe coding generally means building software by describing what you want to an AI coding tool, reviewing what it produces, and iterating through prompts. The term covers a wide range of practices, from experienced developers using AI as an assistant to first-time builders creating an entire application through conversation.
The risk is not vibe coding itself. The risk comes from combining fast, partially understood changes with access to live systems.
You may be working directly on production if:
- Your local app connects to the same database used by real customers.
- Your AI coding agent has production database credentials.
- Schema changes are applied through an admin console without being recorded in code.
- New versions are deployed directly from a laptop.
- Testing takes place using real customer records.
- The main branch can be deployed without automated checks or review.
- There is no reliable way to reproduce, reverse, or audit a database change.
This can feel reasonable when an app has only a few users. There is one database, one deployment, and no apparent need for additional environments. The difficulty is that a small production database can still contain irreplaceable information.
The number of users affects the scale of an incident, but it does not change the type of risk.
Why production databases require special treatment
Application code and database data behave differently.
If a new interface has a visual problem, you can often deploy an older version of the code. If a database operation deletes customer records, overwrites values, or changes the structure of a table, reverting the application code may not restore what was lost.
Consider an AI agent asked to rename a field from name to full_name. It might:
- Add the new field.
- Copy existing values into it.
- update the application code.
- Remove the old field.
That change may be perfectly reasonable. But if the copy step fails, an older version of the app is still running during the change, or another part of the system still expects name, users may see errors or data may be lost.
The same concern applies to apparently simple requests:
- “Remove duplicate users.”
- “Clean up test accounts.”
- “Change all existing subscriptions to the new plan.”
- “Delete unused columns.”
- “Reset the database and reseed it.”
- “Fix records with missing values.”
An AI agent can generate technically valid commands that are unsafe in your particular environment. It may misunderstand which records are disposable, assume a backup exists, or optimize for completing the instruction rather than protecting business data.
The database does not know whether a destructive command was intentional. If the credentials permit it, the operation will usually run.
Why CI/CD and separate databases exist
These practices were not invented primarily to add process. They developed in response to recurring failures as software teams changed systems more frequently.
Continuous integration reduced the cost of combining changes
When developers worked separately for long periods, their changes often conflicted when finally combined. A feature that worked on one machine could fail when integrated with everyone else’s work.
Continuous integration, usually shortened to CI, encourages small and frequent changes to a shared codebase. Each change can trigger automated checks such as:
- Does the application build?
- Do important tests pass?
- Is the code formatted correctly?
- Are there obvious security or dependency problems?
- Can database migrations be applied successfully?
CI does not prove that software is safe. It creates a repeatable checkpoint before a change reaches users.
For someone working alone with an AI coding agent, the integration problem still exists. You are integrating generated code with your existing application, dependencies, database structure, hosting configuration, and prior AI-generated decisions. A second human developer is not required for incompatible changes to occur.
Continuous delivery made releases repeatable
Continuous delivery or deployment, represented by the second part of CI/CD, addresses what happens after a change passes its checks.
A delivery workflow packages and releases the application through a defined process rather than relying on a sequence of manual steps remembered by one person. Depending on the setup, production deployment may happen automatically or require approval.
The practical value is consistency. The version that passed the checks is the version that gets deployed, using known commands and configuration.
Without that process, you can easily test one version locally and deploy another, forget a database migration, use the wrong environment variables, or make an emergency production edit that is never recorded in the codebase.
Separate databases created a safe place to make mistakes
Developers need somewhere to experiment, reset data, test migrations, and reproduce failures. A production database cannot safely serve that purpose once it contains information that matters.
A development database is an isolated database used while building the product. It should resemble production structurally, but it should not contain live customer data by default.
Many teams also use a staging environment between development and production. Staging provides a production-like place to test a release as a whole, including deployment configuration and database changes.
The environments serve different purposes:
- Development: Fast experimentation with disposable or synthetic data.
- Staging or preview: Validation of an integrated release in conditions similar to production.
- Production: The live system used by customers and protected from casual changes.
A small product may not need an elaborate staging platform. It almost always benefits from at least separating development from production.
What can go wrong without these boundaries?
The most obvious concern is accidental deletion, but it is not the only one.
Real data can be changed during testing
A new email feature might send test messages to actual customers. A payment workflow might change real subscription states. A script intended to repair one record might update every row because its filtering condition is incorrect.
Tests are supposed to fail occasionally. If they run against production, failure can become a customer-facing event.
Database structure can drift away from the code
If you add a table or column manually through a hosted database console, the live database changes but the instructions for recreating that change may not exist in your repository.
The application can then work in production but fail for anyone setting it up elsewhere. A later deployment may also assume a different structure.
Database migrations solve this by recording structural changes as ordered files or scripts. Instead of remembering that you added a column last Tuesday, the project contains a versioned instruction that can be tested and applied consistently.
Credentials can spread further than intended
Connecting local tools to production usually means storing production credentials on a laptop or pasting them into an AI-enabled editor, terminal, plugin, or chat interface.
Even where a tool has appropriate security controls, broad production access increases the consequences of a mistake or compromised account. Credentials may also appear in generated code, logs, screenshots, shell history, or files committed to a repository.
The safer principle is to give each environment and tool only the access it needs. Your local app should normally have development credentials. A production deployment should receive production credentials through the hosting environment, not from a developer’s machine.
A code rollback may not repair the data
Suppose a deployment changes a price field from whole currency units to cents. The migration multiplies every existing value by 100, but the application fails and is rolled back. The older code now reads the converted values using the old assumption.
A $25 product may appear to cost $2,500.
This is why database changes often need to be compatible with both the current and next application versions during deployment. It is also why teams treat migrations as part of release design rather than a final setup step.
Troubleshooting becomes guesswork
If changes are made manually and deployed without a recorded process, it becomes difficult to answer basic questions:
- Which version is currently running?
- What changed before the problem began?
- Were all database migrations applied?
- Can the previous version still work with the current database?
- Was the issue caused by code, configuration, or data?
- Can the release be reproduced?
CI/CD provides a history of changes, checks, and deployments. That history becomes especially valuable when an AI agent has generated many files or revisions faster than one person can remember them.
Backups help, but they do not replace a safe workflow
Production databases should be backed up, and the recovery process should be understood before it is needed. A backup can provide a route out of a serious incident.
It is not permission to experiment on production.
Restoring a database may involve downtime, lost changes since the backup, manual reconciliation, or coordination with external systems. If orders arrived after the last backup, restoring the earlier state may remove those orders. If emails or payments were already sent, restoring the database cannot undo them.
A useful backup plan answers more than “Are backups enabled?”
You should know:
- How frequently recovery points are created.
- How long they are retained.
- Whether you can restore to a separate database for inspection.
- Who can initiate a restore.
- How long recovery is likely to take.
- Whether the restore process has ever been tested.
Backups reduce the consequences of some failures. Environment separation and controlled deployments reduce the likelihood of those failures occurring.
A minimum viable workflow for a vibe-coded app
A safe setup does not have to look like the infrastructure of a large software company. For a small application, the following controls address much of the avoidable risk.
1. Create a separate development database
Use the same database technology as production where practical, but create a separate instance or project. Populate it with fictional or generated data.
Point your local environment and AI coding tools to this database. Make the environment obvious through names such as myapp-development and myapp-production, rather than relying on similar identifiers.
Avoid copying customer data into development unless there is a specific, controlled reason and appropriate privacy handling.
2. Keep production secrets out of local code
Store development credentials in local environment configuration that is excluded from version control. Store production credentials in your deployment platform’s secret-management system.
Do not hard-code passwords, access keys, or database connection strings. Check your repository history as well as the current files, since deleting an exposed secret from the latest version does not remove it from earlier commits.
3. Put every change in version control
Version control gives you a history of what changed and allows you to compare or restore code. AI coding agents can make broad edits quickly, so review the changed files before accepting them.
Use small commits that describe a coherent change. “Add password reset flow” is easier to inspect and reverse than a single commit containing authentication, billing, interface, and database changes.
4. Represent database changes as migrations
Use your framework or database tool’s migration system rather than making unrecorded production edits.
Test migrations against development data. For important changes, test with enough sample records to expose performance or conversion problems. A migration that succeeds on ten rows may behave differently on a large table.
Destructive operations, such as dropping columns or deleting records, deserve an additional pause. Often the safer approach is to stop using the old field first, confirm the new version works, and remove the field in a later release.
5. Add a small CI pipeline
Start with checks that catch likely failures:
- Install dependencies from a locked version list.
- Build the application.
- Run automated tests for critical workflows.
- Check code quality and types where the project supports them.
- Validate or test database migrations.
A small set of reliable tests is more useful than a large test suite that is routinely ignored. Prioritize account access, permissions, payments, data creation, and other workflows whose failure would materially affect users.
6. Deploy through one defined route
Connect production deployment to the main branch or a designated release branch. Require the CI checks to pass before deployment, and consider a manual approval step for database changes.
Avoid editing production code directly. If an urgent fix must be made, record the same fix in version control immediately so the deployed system and repository do not diverge.
7. Restrict what the AI agent can reach
An AI agent generally does not need unrestricted production access to write application code.
Prefer read-only access when inspection is necessary. For changes, have the agent generate a migration or script that can be reviewed and tested rather than allowing it to execute commands directly against production.
The goal is not to distrust AI categorically. It is to keep the consequences of an incorrect interpretation proportionate to the task.
How much process is appropriate?
A prototype with no real users and disposable data does not need the same release controls as a healthcare platform or financial product. Process should follow consequence.
You should strengthen the workflow as soon as any of the following becomes true:
- Users would care if their data disappeared.
- The app stores personal, confidential, or regulated information.
- Money, bookings, inventory, or contractual records are involved.
- More than one person or agent can change the system.
- A period of downtime would harm customers or the business.
- You cannot reconstruct the database from another authoritative source.
For an early experiment, separate development and production databases, version-controlled migrations, automated build checks, and usable backups may be enough. Products handling sensitive or valuable records will need more, including access controls, audit logs, security review, monitoring, and tested recovery procedures.
The correct standard is not “enterprise-grade” versus “move fast.” It is whether a plausible mistake has been given an acceptable blast radius.
Decide what to change before the next release
If your app is already running directly against one database, you do not need to stop all development while designing a perfect platform. Start by reducing the largest risks.
First, create a development database and remove production credentials from local tools. Then make database structure changes reproducible through migrations. Add automated checks for the workflows that matter most, and route production releases through a consistent deployment process. Finally, verify that backups can actually be restored.
Vibe coding can remain fast after these controls are in place. The difference is that experimentation happens where mistakes are recoverable, while production changes become deliberate and traceable.
If a database now contains information that your users or business cannot afford to lose, it is no longer part of the prototype. Your development workflow should reflect that.
Written by Foundri Studio
Talk to us about agents in your business →