The 10-Point Security Checklist Before Launching an AI-Built App
I audited 24 apps built with Cursor, Lovable, and Bolt. 19 of them leaked customer data or admin keys on day one. Here is the terminal checklist I run before launch.
01Run this check right now
Diagnostic TestThe Rapid Pre-Launch Security Scan
Run this search across your source code and built production assets. If production administrative credentials appear in plain text or client bundles, resolve them before making your application publicly accessible.
grep -rnE "(sk_live|service_role|ACCESS_TOKEN_SECRET)" src/ dist/ 2>/dev/nullFindings from the Field
- /01I audited 24 production prototypes built with AI assistants: 19 had critical security holes including public user tables or leaked Stripe keys.
- /02AI assistants optimize for immediate execution, skipping defensive constraints unless explicitly commanded.
- /03A 10-point terminal checklist allows a single developer to verify database security, secret management, and network boundaries in under an hour.
- /04Checking RLS, bundle outputs, and IDOR ownership eliminates over 80% of real-world prototype data breaches.
- /05Concrete bash and curl commands you can run against your repository right now with zero external dependencies.
The 24-codebase security audit
Over the past six months, I have audited 24 web applications built primarily using AI coding assistants like Cursor, Lovable, Bolt, and v0. These were not hobby experiments; they were real startups handling beta users and processing commercial transactions.
The results were eye-opening: 19 out of the 24 codebases had at least one critical vulnerability live in production. 11 leaked their entire user table to unauthenticated curl requests, 6 had Stripe live secret keys or Supabase `service_role` tokens baked into public JavaScript bundles, and 4 had edge functions that let anyone delete database records without logging in.
It is not that the developers were careless. It is that AI assistants are trained to write code that compiles and runs immediately, not code that defends against hostile traffic. So I compiled the exact 10-point checklist I run before approving any application for launch.
The pre-flight checklist analogy
Think of it like an aircraft pre-flight checklist. When a pilot steps into a cockpit, they do not assume the plane is safe just because the glass avionics screens glow brightly and the engines idle smoothly. They walk around the wings, verify the control surfaces, check the fuel drains for water contamination, and test the altimeter.
In software, looking polished in Chrome is not proof of security. You need a fast, mechanical checklist that verifies the underlying systems before you carry passengers.
Checks 1 to 3: Database access rules
1. **Confirm Row Level Security is active on every table.** Run an unauthenticated curl command against your PostgREST endpoint. If it returns user records, enable RLS immediately in SQL.
2. **Audit for permissive `USING (true)` policies.** AI models frequently add public SELECT policies to silence permission errors during development. Verify that SELECT and UPDATE policies enforce `auth.uid() = id`.
3. **Check for IDOR in backend mutation routes.** Verify that any SQL UPDATE or DELETE query includes both the record ID and the tenant organization ID.
-- Ensure all public tables have Row Level Security active
SELECT tablename, rowsecurity
FROM pg_tables
WHERE schemaname = 'public';Checks 4 to 6: Secrets and environment hygiene
4. **Search compiled client bundles for master keys.** Build your project locally and search `dist/` or `.next/` for `sk_live_`, `service_role`, or API secrets before deploying assets to public CDNs.
5. **Check Git history for committed `.env` files.** Run `git log -p .env` to verify private credentials were never committed in earlier prototypes.
6. **Verify edge function authentication.** If an edge function uses `SUPABASE_SERVICE_ROLE_KEY`, confirm that `verify_jwt = true` is set in your `config.toml` so anonymous visitors cannot invoke it.
Checks 7 to 10: Network boundaries and rate limits
7. **Configure restrictive CORS rules.** Never leave `Access-Control-Allow-Origin: *` on endpoints that read session cookies or handle sensitive billing data.
8. **Implement idempotency on payment webhooks.** Store incoming Stripe event IDs in a PostgreSQL ledger with an atomic `ON CONFLICT DO NOTHING` statement to prevent duplicate billing.
9. **Add rate limiting on public auth and AI routes.** Use Upstash Redis or Cloudflare to prevent automated bots from brute-forcing passwords or draining your OpenAI token balance.
10. **Automate pre-commit and CI verification.** Add automated security scans (`bun pm audit`) and static linting into GitHub Actions so new AI prompts cannot silently re-introduce vulnerabilities.
# 15-second local secret verification
bun run build && grep -rnE "(sk_live|service_role|ACCESS_TOKEN_SECRET)" dist/ 2>/dev/nullReflections: 45 minutes to peace of mind
Running through these ten checks takes about 45 minutes on a fresh repository. In almost every project I audited, catching these issues before launch turned what could have been a catastrophic data breach into a routine 20-minute SQL fix.
AI lets us ship at warp speed. Taking 45 minutes to run the checklist ensures you stay in flight. Now let's get back to building, because yolo.
Production Hardening & Audits
Stuck on prompt regressions, leaked keys, or database scaling in an AI-built app? Explore our platform-specific teardowns:
Diagnostic & Rescue
1 business day replyThink your prototype is vulnerable or hitting scale limits?
Send us a note with your repository, Supabase link, or project details. A senior engineer will review your policies and reply within one business day.
