How to Take a Vibe-Coded App to Production: A Hardening Checklist
A step-by-step checklist for turning an AI-built prototype into production software, plus how to decide between hardening it and rebuilding.
Quick answer
To take a vibe-coded app to production: get the code into version control you own, audit it, then fix things in order of risk. First make sure every user can only access their own data (server-side authorization and database row-level security), move all secrets out of the front end and rotate them, and review the data model and migrations. Then check dependencies, add automated tests for critical journeys, set up separate environments, error monitoring, logging and backups, and deploy through a pipeline with rollback. If the audit shows a flawed data model or tangled code, rebuild using the prototype as the specification instead.
Before you start: own the code
Production software needs a home you control. Export or sync the project to a Git repository owned by your company account, not a personal one, and make sure you can build and run it outside the builder. Record which services it depends on (database, authentication, storage, email, payments, AI APIs) and who holds the accounts. Many teams discover at this point that the app's database and keys sit in a founder's personal account.
- Code in a company-owned Git repository with history
- Can be built and run locally or in CI from documented steps
- List of every external service, account owner and billing owner
- Admin access to the database, authentication provider and hosting
Step 1: Audit before you change anything
Spend a few days understanding what you have. A good audit reads the code paths that matter, maps the data model, lists every place data is read and written, tests access controls directly against the API or database, and scans for secrets and vulnerable dependencies. The output is a prioritized list of issues and a recommendation: harden or rebuild.
| Audit area | What to look for |
|---|---|
| Data access | Tables or endpoints any user, or the public key, can read or write |
| Authentication | Missing checks on routes, client-side-only guards, weak password reset |
| Secrets | API keys, service-role keys or tokens in front-end code or the repository |
| Data model | Missing relations and constraints, duplicated data, no migrations |
| Dependencies | Unknown, unmaintained or non-existent packages; known vulnerabilities |
| Business logic | Prices, discounts, limits or permissions enforced only in the browser |
| Operations | No backups, no monitoring, single environment, manual deploys |
Step 2: Fix authentication and data access
This is where most AI-built apps fail, and the consequences are the most serious. Generated code often checks permissions in the user interface (hiding a button) but not on the server or database, so anyone who calls the API directly can read or change other people's data.
If the app uses a hosted database accessed from the browser, such as Supabase or Firebase, enable row-level security or security rules on every table and write policies that restrict each row to its owner or organization. Supabase's documentation is explicit that tables exposed through its API need row-level security. CVE-2025-48757 records apps built with one AI builder whose tables were readable or writable without authentication because of missing row-level security (the vendor disputes the record, saying each customer is responsible for their app's data). Whatever the platform, that responsibility is yours.
- Every table or collection has row-level security or rules enabled, with tested policies
- Every API route checks the user's identity and permission on the server
- Prices, discounts, quotas and roles are enforced server-side, never trusted from the client
- Admin functions live behind separate roles and are not reachable by normal users
- Password reset, email change and invitation flows cannot be abused to take over accounts
- Test access as two different users and as a logged-out visitor, directly against the API
Key takeaway
If you fix only one thing before launch, make it this: prove that user A cannot read or change user B's data by calling your API or database directly.
Step 3: Remove and rotate secrets
AI tools often place API keys where they make the demo work: in front-end code, in committed environment files, or in prompts pasted into chat. Anything shipped to the browser is public. Move secret keys (database service keys, payment secret keys, AI provider keys, email and SMS keys) to server-side functions, store them in your host's secret manager, and rotate every key that was ever exposed in code, a repository or an AI tool. Use separate keys for development, staging and production.
Calls to paid AI APIs deserve special care: an exposed key or an unauthenticated endpoint that proxies to a model can run up large bills quickly. Put rate limits and per-user quotas on them.
Step 4: Review the data model and migrations
Prototypes tend to grow their database one prompt at a time. Look for missing foreign keys and constraints, duplicated fields that drift apart, text fields used for numbers or dates, and no record of how the schema was created. Introduce migrations so every schema change is versioned and repeatable, add constraints that protect data integrity, and set up automated backups. Then restore a backup to a test environment to prove it works.
If the data model is fundamentally wrong for the business (for example, single-user tables in what must be a multi-tenant product), that is the strongest signal to rebuild rather than patch.
Step 5: Check dependencies
Review every package the app installs. Remove what is unused, replace abandoned packages, and confirm each one is the real, widely used package rather than a lookalike. Research presented at USENIX Security 2025 found code models hallucinated package names in 19.7 percent of suggestions, and attackers register those names. Turn on automated dependency and vulnerability scanning in your repository and lock versions.
Step 6: Add tests where failure hurts
You do not need complete coverage before launch. You need automated tests for the journeys that would cost you most if they broke, running on every change.
- Sign-up, login, logout and password reset
- Access control: users cannot see or change each other's data
- Payments and subscription changes, including failures and refunds
- The core task the product exists for
- Any calculation involving money, quantities or dates
Want a second opinion on your AI-built app?
ZSpace Labs audits vibe-coded apps, fixes security and data issues, adds tests and sets up production deployment, or rebuilds from your prototype when that is faster. See web application development and mobile app development.
Step 7: Environments, monitoring and deployment
Production needs to be separate from where you experiment. Set up at least a staging and a production environment with separate databases and keys. Deploy through a pipeline that runs tests and checks on every change, and make rollback a one-step action. Add error monitoring for front end and back end, structured logs, uptime checks and alerts that reach a person. Decide who responds when something breaks.
| Need | Minimum for launch |
|---|---|
| Environments | Staging and production, separate data and keys |
| Deployment | Automated pipeline with tests, one-step rollback |
| Monitoring | Error tracking, uptime checks, alerts to a named person |
| Logging | Structured logs without passwords, tokens or sensitive personal data |
| Backups | Automated, tested restore |
| Performance | Check key pages and queries with realistic data volume |
Step 8: Privacy, compliance and terms
Real users bring legal obligations. Publish a privacy policy that matches what the app actually collects, add consent where required, decide data retention, and check where each service stores data. If you are in a regulated sector (health, finance, children's data), get specific advice before launch. Check that AI features do not send personal data to providers in ways your policy does not allow; see AI data privacy.
Harden or rebuild: how to decide
| Signal | Harden | Rebuild |
|---|---|---|
| Data model | Sound, needs constraints | Wrong for the business (tenancy, relations) |
| Code structure | Readable, modest size | Tangled, duplicated, untestable |
| Stack | Mainstream and supported | Platform cannot meet security, compliance or performance needs |
| Scope of fixes | Targeted | Would touch most files |
| Team | Can maintain this stack | Would need to learn an unfamiliar or proprietary setup |
Worth noting
Rebuilding does not waste the prototype. It answers most product questions, gives developers a precise reference and can cut the time to a production version substantially.
After launch: keep using AI safely
Going to production does not mean giving up AI tools. It means using them inside a process: changes on branches, reviewed diffs, tests that must pass, and no AI tool with direct access to production data or credentials. Our guides to AI-generated code security and securing AI coding agents cover the guardrails.
Conclusion
A vibe-coded app is a strong starting point and a weak finishing point. Own the code, audit it, fix data access and secrets first, put the data model under migrations, check dependencies, test the journeys that matter, and deploy with monitoring and rollback. When the audit says the foundations are wrong, rebuild from the prototype rather than patching around it. For the strategic view, read vibe coding vs production software.
Common questions.
It depends on size and how sound the foundations are. A small app with a reasonable data model might need one to three weeks of focused hardening; a larger app with tangled code or a flawed data model may be faster to rebuild. An audit of a few days usually answers the question.