Skip to content
Faizan Ali home
Menu

10 vibe coding mistakes that break apps in production


Updated , 9 min read

Short answer

The vibe coding mistakes that cause the most damage are an open database, secret keys in the browser, permission checks that only happen on screen, payments the app doesn't verify, and letting an AI agent touch live data. None of them show up in a demo. Check those five before anything else, then add backups, tests and usage limits.

Vibe coding is great. You describe what you want, and an hour later you have something you can click through. I use AI coding tools every day myself.

The trouble is that a demo and a product get judged on different things. A demo needs to work once, for you. A product needs to keep working for strangers, some of whom will poke at it in ways you never imagined. Most of the mistakes below are invisible until that second part starts.

These are the ones I see most when people ask me to look at an app built with Lovable, Bolt, Cursor, Replit, Base44 or v0. They’re roughly in order of how much damage they do.

1. Leaving the database open

If your app uses Supabase, it has a setting called row-level security. It decides which rows each user is allowed to see. When it’s off, anyone who finds your database address, which sits in your app’s public code, can often read every row in every table.

This isn’t a theory. In 2025, a researcher found that 170 apps built with Lovable were exposing data this way, and it was logged as a security issue, CVE-2025-48757.

Fix: turn row-level security on for every table that holds user data, then write rules that say who can read and change what. Test it by logging in as one user and trying to read another user’s records.

2. Putting secret keys where everyone can see them

Some keys are meant to be public. Others, like your Supabase service key, your Stripe secret key or your OpenAI key, should never reach the browser. If they’re in your frontend code, anyone can open the browser’s developer tools and copy them.

With a stolen database key, someone can read or delete everything. With a stolen AI key, someone can run up your bill.

Fix: search your frontend code for words like secret, service_role and sk_. Move anything you find to the server side, and create new keys to replace the exposed ones, because the old ones should be treated as already leaked.

3. Checking permissions only on screen

Hiding the “Delete” button from regular users isn’t security. If the server doesn’t check who’s asking, anyone can send the delete request directly. The same goes for pages you’ve hidden from the menu but not protected.

Fix: every action that reads or changes data needs a check on the server: is this person logged in, and are they allowed to do this to this record? A simple test is to change an ID in the address bar while logged in as someone else.

4. Trusting the browser about payments

A common pattern in AI-built apps: the user pays, Stripe sends them back to a “success” page, and that page unlocks their account. The problem is that anyone can visit the success page without paying.

Fix: only unlock things when your server hears from Stripe directly, through what Stripe calls a webhook. Also plan for the unhappy paths: failed renewals, refunds, cancelled cards and people who upgrade halfway through a month.

5. Letting the AI agent touch live data

AI agents can run commands, and some of those commands are destructive. In July 2025, SaaStr founder Jason Lemkin described how Replit’s agent deleted his production database during a code freeze. Replit’s CEO apologised and promised to separate test and live databases by default.

Fix: keep a separate database for building and testing. Don’t give the agent keys to your live database, and read any command that deletes, resets or migrates data before you let it run.

6. Having no backups, or never testing them

Plenty of people know their database provider “does backups”. Far fewer have checked what’s included on their plan, how far back it goes, or how to restore one.

Fix: confirm that backups are switched on for your plan. Then actually restore one into a test project. A backup you’ve never restored is a hope, not a backup.

7. Fixing one thing and breaking another

You ask the AI to fix the signup form, and checkout stops working. This happens because the tool usually sees only part of your code at a time, and nothing tells it when an unrelated feature breaks.

Fix: write a short list of the things that must always work: sign up, log in, pay, and your main feature. Add automated tests for them, or at least test them by hand after every change. Save a working version before each big change so you can roll back. Git is the standard way to do this, and most AI tools can set it up for you.

8. Going round in circles with prompts

“It’s still broken, fix it” rarely works. The AI guesses, changes something, and you end up with more code and the same bug.

Fix: give it the actual error message from the browser console or the server logs, what you expected to happen, and what happened instead. Ask for one change at a time. If you’ve tried three times without progress, stop prompting and look at the code, or ask someone who can read it.

9. Leaving everything without limits

Your signup form, password reset and AI features all cost you something each time they’re used. With no limits, a bot can create thousands of accounts or send thousands of AI requests overnight, and you’ll find out from the bill.

Fix: limit how often one person or address can use each of these. Set a monthly spending cap with your AI provider. Add a captcha or email check to signup if bots become a problem.

10. Ignoring speed until real users arrive

An app that’s fast with ten test records can crawl with ten thousand. AI-generated code often loads data one item at a time, or asks the database for everything when it needs one page.

Fix: test with realistic amounts of data before launch. Look for screens that load slowly and pages that make dozens of database calls. Adding the right database indexes and pagination usually fixes most of it.

A 30-minute check before you launch

If you only have half an hour, do these:

  1. Log in as one user and try to open another user’s data.
  2. Search your frontend code for secret keys.
  3. Check that row-level security is on for every table.
  4. Make a test payment, then cancel it, and check what your app does in both cases.
  5. Confirm backups are on, and know how to restore one.
  6. Write down the five things that must always work, and test them.

If any of these turn up a problem, it’s worth fixing before more people sign up. You may not need a rebuild. Most apps I see are closer to ready than their owners fear, and I’ve written about how to decide whether to fix or rebuild. If you’d like a second pair of eyes, that’s what my vibe code rescue service is for.

Common questions

Is vibe coding safe for a real product?

It can be, if someone checks the parts the AI doesn't think about, like who can read the data, where the keys live, and what happens when a payment fails. The tools are good at building what you ask for. They're not good at protecting you from what you didn't ask about.

What is row-level security in Supabase?

It's the setting that decides which rows of your database each user can read or change. When it's off, anyone who finds your public database address can often read every row, including other users' data. It should be on for every table that holds user data.

How do I know if my vibe-coded app has these problems?

Log in as one test user and try to open another user's data by changing an ID in the address bar. Search your frontend code for words like "secret", "service_role" and "sk_". If either check finds something, have someone review the app before more users arrive.

Should I stop using AI coding tools?

No. They're a fast way to get a working product. Just treat what they produce like code from a fast junior developer. It's useful, but worth checking before you trust it with customers and money.

Got a question this guide doesn’t answer? Email me.

hi@faizanali.dev

Get new guides by email

New guides on building software and using AI, about twice a month. No spam, and you can unsubscribe anytime.

Tell me what you’re trying to solve.

Twenty free minutes. You’ll leave with a clearer scope, an honest opinion on what to build first, and no pressure to work with me.