Five ways AI-built apps break in production (and how to check each one)
AI coding tools are very good at getting you to a working demo. A demo has one user, no attackers and no bad Mondays. Production has all three. Here are five patterns we look for first when someone asks us to review an app built with an AI tool, with a way to check each one yourself.
1. Secrets in the wrong place
What happens: A key that should live on a server ends up in code the browser downloads. The common trigger is an environment variable with a public prefix: in Vite it is VITE_, in Next.js NEXT_PUBLIC_, in Create React App REACT_APP_. Anything with those prefixes is shipped to every visitor. Keys also leak into git history and chat transcripts.
Check it: Search your project for your provider's key prefixes. Open your live site, press F12, search the Sources tab for part of a key. Look at your .gitignore for .env. Run git log --all -- .env to see if an env file was ever committed.
Fix it: Move the third-party call to a server route that reads the key from the host's environment settings. If a key was ever exposed, rotate it. Deleting the line does not un-leak it.
2. Checks that only exist in the interface
What happens: The admin page is hidden unless you are an admin, but the API route it calls answers anyone. Or a signed-in user can read another user's data by changing an id in the request.
Check it: Open your browser's network tab, copy a request as curl, then (a) run it with no sign-in and (b) change the id to another user's. If either returns data, you have the problem. Do this for every route that reads or writes user data.
Fix it: Enforce sign-in and ownership on the server, on every request, by default. Filter queries by the signed-in user id. If you use Supabase or Firebase, turn on Row Level Security or the equivalent rules, and never put the service-role key in browser code.
3. Money paths that trust the client
What happens: The success page unlocks paid content, so visiting /success grants access. Or the payment webhook handler never checks who sent the event, so anyone can post a fake "payment succeeded" message to your endpoint. Or the price comes from the browser.
Check it: Visit your success URL directly in a private window. Search your webhook handler for the provider's verification call (for Stripe, constructEvent in Node or construct_event in Python, using the raw request body and the signing secret). Try changing the price in a request.
Fix it: Grant access from the verified webhook or a server-side lookup, take prices from the server, verify signatures, and make handlers safe to run twice (store processed event ids).
4. No way to see or undo damage
What happens: An error breaks sign-up for three days and nobody knows. A bad deploy cannot be rolled back. The database has "backups" nobody has restored.
Check it: Cause an error on purpose in production and see whether you are alerted. Find your latest backup and restore it into a scratch database. Find the button or command that returns you to the previous deploy.
Fix it: Add error monitoring with an alert to a channel someone reads. Turn on automated backups and test one restore. Keep database changes in versioned migrations so a rollback does not strand your data. Set spending caps on every AI and API provider so a loop does not become a bill.
5. Nobody can maintain it
What happens: There is no README, no tests, no lockfile, and the logic lives in a prompt history. The first change after launch breaks something else, and nobody can tell what.
Check it: Ask someone who did not build it to run the app from scratch using only the README. Count your tests for sign-in and payment. Check that a lockfile is committed. Look at the dependency list for packages you do not recognize; confirm each one exists on the official registry and is the one you meant.
Fix it: Write ten lines in a README. Add one test each for sign-in, payment success and payment failure. Commit the lockfile. Add a basic CI job that runs lint and tests on every change.
A note on scope
This list is a starting point, not a security audit. If your app handles health records, card numbers, children's data or money movement, get a professional review. A clean self-check means you did not find obvious problems, nothing more.
Want help?
If you want to run these checks yourself first, the Launch Readiness Kit is the 90-minute checklist, an offline scanner, and seven review prompts. It is $39.
If you would rather have a person look at your app, App Rescue is a production-readiness audit with written findings on access rules, secrets, auth and your core flows, then a fixed-price quote for fixes with the audit credited. It runs $750 to $2,000, scoped on a free intro call.