Expensive mistakes
People learn from concrete disasters better than from abstract rules. Here are the ones that actually cost money, data, or work — and the one-line fix for each.
1. The leaked API key
Section titled “1. The leaked API key”What happens. A secret key gets committed to a public GitHub repo. Bots scan GitHub constantly; within minutes the key is found and used. You wake up to a bill for thousands of dollars of someone else’s usage.
Avoid it. Keep keys in .env, make sure .env is in .gitignore, and never
paste keys into code. See Level 4.
2. Experimenting on production
Section titled “2. Experimenting on production”What happens. You ask the AI to “clean up the database” or run a migration — on the live system. Real user data is deleted. There’s no undo.
Avoid it. Keep dev and prod separate. Try destructive things in dev first. Never run a command you don’t understand against production.
3. Working without commits
Section titled “3. Working without commits”What happens. Hours of good work, then one AI prompt rewrites half the project and breaks it. With no commit to return to, the working version is simply gone.
Avoid it. Commit early and often, especially before a big AI session. Level 2 is the insurance policy.
4. Trusting “it looks done”
Section titled “4. Trusting “it looks done””What happens. The AI says it’s finished and the screen looks right — but the button does nothing, or data isn’t really saved. You find out from a user, in production.
Avoid it. Verify behavior, not appearance. Click the thing. Refresh. Check the data actually persisted. See Level 5.
5. Rolling your own auth and payments
Section titled “5. Rolling your own auth and payments”What happens. “Write a login system from scratch” produces something that looks fine but leaks passwords or lets anyone in. Same story with hand-rolled payments.
Avoid it. Use established services (Clerk, Auth0, Supabase Auth; Stripe for payments). These are exactly the parts where the cost of a subtle bug is highest.
6. Runaway bills
Section titled “6. Runaway bills”What happens. A loop calls a paid API thousands of times, or a server scales up and nobody set a spending limit. The bill arrives at the end of the month.
Avoid it. Set billing alerts and spending caps on every paid service before you build on it.
- Keeping secrets out of your repository (GitHub) — Why committed API keys get stolen, and how GitHub helps catch it.
- 6 steps before taking your vibe-coded app to production (Convex) — The best description of the 'boring 20%': auth, DB, payments, deploy.
- Store config in the environment (12-Factor) — The principle behind .env files: keep secrets out of code.