Teardown: An AI-Built App Before and After an Engineering Review
A 76-line invoice tracker works fine for its owner and fails 8 of 9 security checks. Here is the review order, the findings ranked, and the fixes.
Open tables, leaked keys, users who can read each other's data, and the auth mistakes AI tools make. Each guide has a check you can run today.
A 76-line invoice tracker works fine for its owner and fails 8 of 9 security checks. Here is the review order, the findings ranked, and the fixes.
Use a hosted auth provider like Supabase Auth or Clerk, not code your AI wrote. What a provider covers, and the three auth bugs it still leaves to you.
Authentication asks who you are. Authorization asks what you may touch. How the second goes missing in AI-built apps, and 25 tests that catch it.
If you committed .env, rotate every key in it first. Deleting the file or rewriting history does not undo the exposure. The fix in order, with a test.
A 20-minute security check for your AI-built app: ask your database for data you should not get, hunt keys in shipped code, play burglar with two accounts.
Your frontend is a public document. Five places API keys leak out of AI-built apps, how to check each, and how to rotate without locking yourself out.
Six things a password reset must do, from identical answers to single-use links, with an eight-test file you can run against what your AI tool wrote.
Revoke-first locks out your own app. The safe order is fix the leak, create a new key, deploy it, then retire the old one. With a test that proves the order.
Your Supabase publishable key is public by design, so row level security decides what it can touch. What RLS is, a first policy, and how to prove it.
A session is a ticket your server looks up. A JWT is a signed note it reads. Which to pick, why logout is the real difference, and what to check in your app.
Why users see someone else's data: Steam in 2015, ChatGPT in 2023, and three ways your app can do it too, with tests that catch each.
Supabase ships a live API over your public schema, and new tables often start reachable. The two-minute check, the fix, and a test that keeps it fixed.
A pgTAP suite that fails when strangers can read or write your Supabase tables. Run it before launch, and after every policy change.
A pre-launch checklist for apps built with Cursor, Lovable, Bolt, Replit or Claude Code: secrets, data access, backups, staging, limits and logs.
Six things that go wrong after the demo when an AI-built app meets real users and real traffic, and the engineering habit that stops each one.
Stuck with a vibe-coded app? I'll fix it.
Email me