Your AI-built app works. The preview shows every screen responding correctly. The login flow completes. Data saves to the database. The deployment finishes with a green checkmark. You ship it.
Then real users arrive. Within hours, someone can see another user's data. A payment webhook fails silently. The database locks up under a query the AI wrote. The error logs show exceptions that never appeared in development.
This pattern repeats across every AI coding tool: Cursor, Lovable, Bolt, Replit, Claude Code. The preview environment forgives mistakes that production punishes. Here are the five failure patterns we see most often when auditing AI-built apps before launch.
1. Database rules that exist in theory but not in practice
The AI writes a migration that creates a profiles table with user_id references. It adds a comment saying "RLS policies enforce data isolation." The migration runs. The app works in preview because you're the only user.
In production, Row Level Security is either not enabled on the table, or the policies reference auth.uid() but the auth context isn't set when the API route runs. The result: any authenticated user can read every row.
We see this in roughly 60 percent of Supabase projects we audit. The AI knows the syntax for RLS policies. It does not know whether your API routes actually run with the user's JWT attached.
Check this: run a query as a second test user against your production database. Can you read the first user's data? If yes, RLS is not working.
2. Secrets that live in the repository
The AI needs an API key to call OpenAI, Stripe, or SendGrid. It suggests process.env.OPENAI_KEY in the code. You paste the key into .env.local for development. The AI then writes a deployment script that copies .env.local to the server, or you commit it by accident because the .gitignore pattern didn't match.
We have found live Stripe secret keys, database connection strings, and AWS credentials in repositories that were "private" but accessible to contractors, CI runners, or compromised tokens.
Check this: search your repository history for any string matching sk_, pk_, Bearer, or connection string patterns. Rotate anything you find.
3. Error handling that swallows failures
The AI wraps a Stripe webhook handler in try/catch and returns 200 OK in the catch block so Stripe doesn't retry. The error gets logged to console.error. Nobody reads those logs.
In production, a malformed payload causes the handler to crash silently. The order is marked paid in Stripe but never fulfilled in your database. The customer emails support. You have no record of what happened.
Check this: every external integration (webhooks, cron jobs, background workers) must either retry with exponential backoff or write to a dead-letter queue you actually monitor. A console.error is not monitoring.
4. Authentication that passes the happy path only
The login page works. Registration works. Password reset works. The AI generated all three flows using the standard library for your framework.
What the AI misses: session fixation, token replay, missing Secure and HttpOnly flags on cookies, refresh token rotation, and what happens when the auth provider returns an error code the AI didn't anticipate.
We tested twelve AI-built auth implementations last month. Eleven allowed session fixation. Nine stored refresh tokens in localStorage. Seven didn't validate the aud claim on the JWT.
Check this: use a tool like auth-scanner or manually test session fixation. Log in, copy the session cookie, open an incognito window, paste the cookie, refresh. If you're logged in, your sessions are not bound to the browser.
5. Performance queries that work on ten rows
The AI writes a dashboard query that joins orders, customers, and line_items with no index on the foreign keys. It returns fifty rows in development. The page loads in 200ms.
In production with ten thousand orders, the same query takes twelve seconds. The database CPU hits 100 percent. The connection pool exhausts. Every other request times out.
The AI does not know your data volume. It does not know which columns need indexes. It does not know that SELECT * on a wide table with a join prevents index-only scans.
Check this: run EXPLAIN ANALYZE on every query your dashboard and API endpoints execute, using a production-sized dataset (or a representative sample). Look for sequential scans, missing indexes, and sort operations that spill to disk.
What to do next
These five patterns cover the majority of critical issues we find in launch-readiness audits. They are not exotic vulnerabilities. They are the basics that the preview environment hides.
If you have an AI-built app heading toward launch, run these five checks yourself. Or use the free surface check at Vibe Code Guardian. It automates the database rules and secrets checks, and the launch-readiness audit covers all five patterns with a developer reviewing the code.
Either way, do not assume the green deployment badge means your app is ready for strangers.