Skip to content

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.

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.

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.

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.

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.

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.

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.