The AI Code Production Checklist
50 checks to run before you put AI-generated code in front of real users.
Security (15)
- Search the repo, mobile bundle, and prompt history for API keys, passwords, and connection strings, then rotate anything you find.
- Require a real login on every route that reads or changes a user's data. Do not trust a hidden button.
- Check authorization on the server for each record. A user must not open another account by changing an id in the URL.
- Set session cookies to HttpOnly, Secure, and SameSite, and expire them when the user signs out.
- Confirm password reset and email change cannot hand the account to someone who only knows the address.
- Limit upload type and size, and store files outside the public web folder.
- Send SQL and NoSQL queries with parameters. Do not build queries by gluing user text into a string.
- Encode user text before it is rendered as HTML so a comment cannot run script.
- Turn off debug pages, stack traces, and default admin logins in the production environment.
- Set CORS to the real site origins only. Do not leave it on *.
- Run a dependency vulnerability scan and patch or remove packages with a known critical issue.
- Scope third-party API keys to the minimum permissions and write down how to rotate them.
- Verify webhook signatures before you trust the payload.
- Rate-limit login, signup, password reset, and any public API.
- Make sure production error pages do not print stack traces, SQL, or environment variables.
Performance (10)
- Measure the slowest database queries against a realistic amount of data, not an empty local database.
- Add indexes for the columns you filter, sort, and join on.
- Paginate every list. Do not return the whole table to the browser.
- Remove N+1 loops that query the database once per row inside a loop.
- Cache repeated reads that do not change every request, and set an expiry.
- Serve images at the size the screen actually uses, in a compressed format.
- Defer or split JavaScript the first screen does not need.
- Move email, exports, and AI calls out of the web request and into a background job.
- Turn on database connection pooling and set a sane pool size.
- Record a load-time budget for the main screens and check it before launch.
Scalability (8)
- Load-test at the number of concurrent users you expect in the next six months.
- Confirm the app can run as more than one instance without users losing their session.
- Do not keep session or upload state only in the memory of one server.
- Store uploads in object storage, not on one machine's disk.
- Put slow work on a queue so a traffic spike does not freeze the site.
- Write down host limits: CPU, memory, database connections, and cold starts.
- Check that the database stays responsive at the target concurrency, and check the web app in the same run.
- Document how to roll back if the new version fails under traffic.
Reliability and monitoring (8)
- Add an uptime check on the public URL and send it somewhere a person will see.
- Send application errors to a log with the request id, and review it after deploy.
- Take backups of the database and files, and restore one backup onto a scratch environment.
- Keep development and production data separate. Do not test against the live database.
- Deploy production through CI. Do not copy files up from a laptop.
- Expose a health check the host can call without logging in.
- Store secrets in the host or a vault. Do not print them in the build log.
- Name who is contacted when production is down, and how.
Code quality and maintainability (9)
- Make sure a new engineer can explain the folder structure in about ten minutes.
- Keep each business rule in one place. Do not copy the same check across the UI, API, and database trigger.
- Handle errors on purpose. Do not catch them and continue as if the write succeeded.
- Add tests for payments, permissions, and any path that deletes or emails data.
- Rewrite or delete AI-generated code you cannot explain.
- Remove unused packages, sample routes, and commented-out blocks before launch.
- Validate input at the API boundary, even if the form already checks it.
- Write a short README that says how to run the app locally and how it is deployed.
- Have a senior engineer read the diff before it goes to production.
Get the PDF
The PDF is ready
Thanks. Download the checklist, then run it against the app before launch.
Want a senior engineer to run this for you? Get a Production Readiness Audit.