Skip to content
Production Review Services Checklist img-forge Plans Company Docs Blog
stackbilder.com / production-readiness-checklist

Before you ship to real users

AI App Production
Readiness Checklist

59 controls in 12 areas for taking an AI-generated app from demo to production. Cover auth, secrets, data access, billing, AI-specific risk, logging, tests, governance, rollback and supply chain before real users arrive, or have your own AI check them for you.

✓59 controls ✓12 areas ✓Free, open-source skill

Why this checklist exists

AI app builders — Lovable, Bolt, v0, Cursor, Claude Code — generate functional prototypes fast. They do not generate threat models, test plans, or deployment contracts. This checklist is the gap between "it works in my browser" and "it survives contact with real users."

How to use it

Work through it category by category before your first production deployment. If you cannot check an item, that is a conscious decision you are deferring — document it in your CHANGELOG. Do not skip items without writing down why.

What this does not cover

Physical security, network perimeter controls, and formal compliance audits (SOC 2, ISO 27001) are out of scope. This checklist addresses the application-layer controls that are the prerequisite for any of those programs.

Free · open source · MIT

Have your own AI run this checklist on your repo

Open Risk Review is a skill for Claude Code, Cursor and other AI coding tools. It reads your repository without changing your code, gives each of these 59 controls a status, cites the file and line for every finding, re-checks every Critical and High, and writes a report with a fix plan and a fix prompt you can paste back into your tool.

It runs entirely in your own tool, and your code is never sent to us. It is an AI self-review: it can miss things or be wrong, and it is not a penetration test.

Claude Code

/plugin marketplace add Stackbilt-dev/open-risk-review
/plugin install open-risk-review@open-risk-review

Then ask: "Run an open risk review on this repo." Cursor and other tools: see the install guide.

Auth & Sessions

8 controls
A1

Auth check on every protected route, API handler, server action and RPC method

List every entry point and find the check that rejects an anonymous caller. Auth on /dashboard but not /api/user is the classic miss.

A2

Session revocation: logout and password change invalidate sessions server-side

Deleting a cookie or clearing local storage is not logout. The server-side session or token must stop working.

A3

JWT algorithm allowlisted (for example HS256 or RS256), never taken from the token

Libraries that accept the algorithm from the token header allow alg:none forgery. If your auth provider verifies tokens for you, say which.

A4

Second factor or recent re-authentication for high-privilege actions

Billing changes, user deletion and role changes. Sign-in MFA is often a provider setting; step-up re-auth before a sensitive action is code.

A5

OAuth redirect URIs exact-match allowlisted, and redirect parameters validated

Wildcard or prefix matching allows open redirects and token theft. Check every redirect, returnTo and next parameter the app follows.

A6

Session cookies set HttpOnly, Secure, SameSite and a sensible max-age

Check what your auth library actually sets. Some leave cookies readable on purpose, and some don't set Secure by default.

A7

Admin actions check a platform role, not "owner of their own workspace"

If every signup becomes the owner of a workspace, an owner check is no gate at all.

A8

CSRF protection on cookie-authenticated requests that change state

SameSite cookies, a CSRF token or an Origin check, and no GET requests that change state.

Secrets & Environment

6 controls
S1

Secrets in environment variables, never in source, config, docs or client bundles

Search for sk_live_, AKIA, service_role, -----BEGIN and token =. Anything prefixed NEXT_PUBLIC_ or VITE_ ships to every browser. Include tool config such as .mcp.json and .cursor/.

S2

Secrets rotation plan documented: who rotates which key, how, and when

A secret that has never been rotated is a secret you can't revoke quickly when it leaks.

S3

.env files in .gitignore, and git history checked for any earlier commit

git log --all --full-history -- '**/.env*' shows whether one was ever committed.

S4

Every incoming webhook checks its signature before acting

Not just payment webhooks. Any endpoint that a third party calls should prove the call came from them.

S5

API keys scoped to the minimum permissions the app needs

A Stripe key used only for checkout doesn't need refund or dispute permissions.

S6

Separate secrets and databases for development, preview and production

Production keys in development, or one database shared by every environment, turns a test into an incident.

Database & Data Access

6 controls
D1

Every query on user or tenant data is scoped to the caller

A tenant filter on every query, or row-level security with policies that check the signed-in user, never an id the client sent.

D2

Parameterized queries everywhere, with no SQL built from user input

String concatenation or template literals with user input is SQL injection. No exceptions.

D3

Database errors never reach API responses

Postgres, SQLite and D1 errors often include table names, column names and constraint details.

D4

Migrations reversible, with a down migration or a written rollback

Know how to undo each schema change before it runs in production.

D5

The browser never holds a privileged database key or a database URL

A public anon key is fine only when row-level security is on. A service-role key in the bundle is full database access.

D6

Backups exist and a restore has been tested at least once

An untested backup is not a backup. Restore to a staging environment to confirm.

API & Input

5 controls
I1

Request bodies, query strings and form data validated by schema

Zod, Valibot, Pydantic or equivalent. Validate shape, type, length and allowed values, not just presence.

I2

Rate limits on sign-in, signup, password reset and expensive operations

Login and OTP endpoints invite credential stuffing; AI calls, uploads and email sends cost you money before you notice.

I3

CORS configured explicitly, with no wildcard or reflected origins on authenticated endpoints

A regex like .*example.com also matches evil-example.com.

I4

Request size limits on JSON and file endpoints

Framework defaults differ: some routes have a limit, others have none. Check each endpoint that reads a body.

I5

Upload types checked on the server, not trusted from the client

The client's content type is trivially forged. Inspect magic bytes or use a safe parser.

Billing & Payments

6 controls
B1

Payment webhook signature verified on the raw body before any processing

Stripe: constructEvent() with the raw body and the webhook secret. Parsing the JSON and acting on it lets anyone forge an upgrade.

B2

Webhook handler is idempotent, so replaying an event does nothing twice

Providers retry. Store the event id, upsert, or use an idempotency key.

B3

Failed and cancelled payments leave the database consistent and downgrade access

Multi-step updates use a transaction or are safe to retry, so no account is left half-upgraded.

B4

Paid features checked on the server for every request, not just in the UI

A tier check in a React component is bypassed by calling the API directly.

B5

Checkout checks for an existing active subscription first

Without it, a double click can create two subscriptions.

B6

Credits and quotas cannot be double-spent

Decrements are atomic, and reserved credits are released when the job fails.

AI-Specific

5 controls
X1

User content in prompts treated as data, and model output never decides authorization

Tools the model can call are limited to what that user is allowed to do.

X2

Model output validated against a schema before it is stored, executed or rendered

Rendering model output as HTML without validation is an XSS path.

X3

Per-user or per-tenant limits on AI spend

One account in a loop can run up the bill for everyone.

X4

Anonymous and free-tier AI endpoints have stricter limits than paid ones

Weaker limits on the free path is the usual mistake.

X5

Logs, analytics and error trackers don't receive raw prompts, uploads or completions

Prompts often contain the user data you were careful to keep out of logs.

Logging & Observability

5 controls
L1

Errors go to a monitoring service, not only console.log

Sentry, Datadog or a log sink that survives restarts and can be searched.

L2

No personal data in logs

Log user and tenant ids, not email addresses, phone numbers, tokens or payment data.

L3

A request or trace id flows through downstream calls

Without one, debugging a production failure means matching timestamps across separate logs.

L4

Alerts on error rates, not only on downtime

A 20% error rate on one endpoint won't trip an uptime monitor.

L5

Health endpoint returns status plus build or version

GET /health returning {"status":"ok","build":"abc123"} tells you what is actually deployed.

Error Handling

3 controls
E1

Generic error messages in production, with no stack traces or internal messages

Stack traces reveal file paths, library versions and internal names.

E2

Promises and background jobs handle failure

Watch for empty catch blocks too: they hide failures instead of handling them.

E3

The app fails safe when the database, cache or an external API fails

No partial writes and no open access when a dependency is down.

Testing

5 controls
T1

Auth flow tests: login, logout, expiry and rejection of anonymous calls

Auth regressions are silent until a user reports seeing data they shouldn't.

T2

Isolation test: tenant A cannot read or change tenant B's data

Seed two tenants (or two users) and assert the cross-tenant request fails.

T3

Billing tests: checkout, webhook receipt, upgrade and failed payment

Replay real provider webhook payloads in your test environment.

T4

Rate-limit tests prove limits fire at the stated threshold

Test that the limit fires at the right count, not just that it exists.

T5

Tests run in CI on every change, and a failure blocks merge or deploy

A test suite that only runs on a laptop protects nothing.

Governance

4 controls
G1

A written threat model, even one page

A short analysis of your own architecture beats generic security advice.

G2

ADRs record key decisions: auth strategy, data isolation, key dependencies

They stop the next developer, or AI agent, from undoing decisions that have non-obvious reasons.

G3

Constraints documented for AI coding agents

CLAUDE.md, AGENTS.md or .cursor/rules saying what agents must not change: auth, tenant scoping, billing.

G4

CHANGELOG maintained with dates

It's how you connect a production incident to the deploy that caused it.

Deployment & Rollback

5 controls
R1

A documented rollback plan for every deploy

Know which redeploy, revert or down migration you'd run before you need it.

R2

Feature flags for risky changes, especially billing and auth

A flag switches off a broken feature without a redeploy.

R3

Migrations tested on a staging or preview database before production

A migration that drops one column and adds another can fail halfway.

R4

Deploys don't leave old clients calling new APIs with stale assets

Ship a new API contract, keep serving old JavaScript, and watch it send the wrong payloads.

R5

Schema changes stay backward compatible while old code is still serving

Adding a NOT NULL column without a default breaks every request from the old version mid-deploy.

Supply Chain

1 control
C1

Committed lockfile, frozen installs in CI, and every dependency checked to exist

AI-written code sometimes imports packages that don't exist, which attackers then register under that name.

Field findings

What teams commonly miss

These four gaps come up again and again in AI-generated SaaS apps. All four are easy to miss at build time and visible only when an attacker looks — or when your first enterprise prospect runs a security review.

01 B1 critical

Webhook signature not verified

The Stripe webhook handler parses the event body as JSON and acts on it — without calling constructEvent() with the webhook secret. Any attacker can POST a forged invoice.paid or customer.subscription.updated event and trigger a free tier upgrade.

fix: src/routes/api/webhooks.ts — call Stripe.webhooks.constructEvent() with raw body before any processing.
02 D1 critical

No tenant filter on multi-tenant queries

A multi-tenant app with one shared database and no row-level security must filter every query by tenant_id. A single SELECT * FROM users WHERE id = ? without AND tenant_id = ? means any authenticated user can read any other tenant's data by guessing or enumerating UUIDs. AI builders generate the CRUD; they do not generate the isolation predicate.

fix: Audit every query. Use a withTenant() helper that adds the tenant_id condition to every query.
03 B4 high

Tier gate enforced only in the UI

The Pro feature check is a conditional in a React component: if (user.tier === 'pro') return <ProFeature />. The API endpoint behind the feature has no server-side tier check. A free user with the browser dev tools can call the endpoint directly. Gating only in the UI means the gate does not exist.

fix: Every API endpoint for a gated feature must read and verify the tier from the session or database before returning data.
04 A2 high

Logout does not invalidate the session server-side

The logout handler deletes the session cookie client-side. The session token in KV is never invalidated. The cookie is gone — but anyone who captured the token value (via XSS, log file, or shoulder-surfing) can still authenticate with it for however long the TTL lasts. Real revocation requires deleting the server-side session record.

fix: POST /api/auth/logout → KV.delete(sessionToken) before clearing the cookie.

When the checklist is not enough

Get a source review, Critical and High findings verified by a named reviewer, before you decide to launch.

The Production Risk Review runs the same 59 controls on one application for you, with every Critical and High finding verified by a named reviewer. You receive evidence-linked findings ranked by business risk, a remediation order, and a 30-minute findings call.

Delivered within three business days after access is ready. The fee is credited toward a Hardening Sprint started within 30 days if you want Stackbilder to implement the fixes.

Prefer the self-serve path? Generate a free governed scaffold →

What ships with every scaffold

.ai/threat-model.md
STRIDE-based security analysis for your specific architecture. Gives you G1 (threat model).
.ai/adr-001.md + adr-002.md
Architectural decisions documented with context, alternatives, and consequences. Gives you G2 (ADRs).
.ai/test-plan.md
Integration test specs for auth, billing, tenant isolation and rate limiting (T1–T4). You still write the tests and run them in CI (T5).
.ai/constraints.yaml
Machine-readable guardrails for AI coding agents. Gives you G3 (constraints for AI agents).
wrangler.toml
D1, KV, secrets, and triggers configured correctly. Environment separation built in.
generation time ~20ms
free tier scaffolds / month 3
credit card required no

Questions about this checklist

Can my AI coding tool run this checklist on my code?

Yes. Open Risk Review is a free, open-source skill (MIT licence) for Claude Code, Cursor and other AI coding tools that runs these 59 controls against your repository. It doesn't change your code: the only things it writes are its report and, if you agree, a .gitignore line that keeps the report private. Every control gets a status, every finding cites the file and line, and the report ends with a fix plan and a fix prompt for each finding. It runs entirely in your own tool, so your code is never sent to Stackbilder. It is an AI self-review and can miss things or be wrong: it is not a penetration test or a guarantee.

How should I use this checklist?

Work through it area by area before your first production deployment with real users or real money. Treat it as a gate, not a guideline: if you cannot check a control, that is a decision you are consciously deferring, not an oversight. Write down what you are skipping and why.

What do teams commonly miss before shipping?

Four gaps come up again and again: (1) payment webhooks processed without checking the signature, which allows forged billing events (B1); (2) queries on multi-tenant data with no tenant filter (D1); (3) paid features gated only in the UI (B4); (4) logout that doesn't invalidate the session on the server (A2). All four are easy to miss at build time and invisible until someone exploits them.

Does Stackbilder automate all of this?

No. A Stackbilder scaffold generates the governance documents (a threat model for G1, ADRs for G2 and constraints for AI coding agents for G3) and a test plan that specifies the T1 to T4 tests. You still write and run those tests, gate them in CI (T5), keep a changelog (G4), and handle deployment, secret rotation and observability yourself. The generated threat model identifies the risks; you still implement the mitigations.

Does passing this checklist mean I am SOC 2 compliant?

No. SOC 2 requires an independent auditor to review your controls over a trust service period; it cannot be achieved by self-attestation. This checklist covers technical controls that are prerequisites for a SOC 2 engagement, and without them an audit surfaces them as gaps immediately. For teams preparing for formal compliance, our bespoke services include dedicated security review engagements.

Related pages