And here vibe coding, Cursor, Lovable, Claude, did something that looks like magic: suddenly you can get to a working system both fast and cheap. But the principle didn't disappear. It just collected its price quietly, from the corner that's easiest to give up: security.
This isn't a malfunction of the AI. When you ask it to build a system, it maximizes the chance that the scenario you asked for works. It builds the Happy Path. What it doesn't do on its own initiative is threat modeling: stopping to ask "what happens if someone tries to mess with this on purpose?".
And that's exactly the difference between "the system works" and "the system is ready for production".
The blind spots
In the real world, attackers don't waste time trying to break into your server. They exploit the blind spots that were left open. Most of them will sound obvious to you, but in practice, when you build fast, they're exactly what falls first:
- Request flooding (Brute-Force): a flood of requests to one point, for example the login screen, that jams the app from inside.
- Open doors (Authentication Bypass): an internal path you forgot to lock, and anyone gets into it directly through the URL.
- Permission leakage (IDOR): a legitimately logged-in user changes a small number in the request, and sees someone else's invoice.
- Data leakage: a disguised query that makes the system quietly spit out the whole users table.
- Exposed secrets: an API key left in the frontend code, visible to anyone who opens the browser's developer tools.
How do you get the third corner back? Three guards
Guard 1, the network (The Edge). Keeps bots and floods from reaching the app at all. Rate Limiting will stop Brute-Force, but against a real volumetric flood (DDoS) you need an outside guard at the CDN level: Cloudflare, a WAF. Noise like that shouldn't reach your server at all.
Guard 2, the logic (input validation). Trust nothing that comes from the client. The frontend sent a value? The server validates it again. Always. The frontend is a convenience, not a source of truth.
Guard 3, the vault (access enforcement). Even if someone got around everything, the database itself still has to say "you have no permission to touch this row". In Supabase that's exactly the purpose of RLS: the vault checks on every request who you are and what you're allowed, not the interface.
Can you just write "make sure it's secure" in the prompt?
Up to a point, yes. A good prompt will get you to 80%: clean code, sound infrastructure, the basic guards in place. But there's one hole the AI can't close for you, because it doesn't know your business: a failure in business logic.
The simplest example: the client sends the server that the price in the cart is ₪0, and the server saves it, because nobody told it to recalculate. This isn't a bug in the code. A permissions guard won't catch it, the user is allowed to place an order. It's flawed business logic, and the AI doesn't spot it because it doesn't know which rules must never be broken in your system.
That 20%, the business logic, the protection against manipulation, defining the RLS rules, is where the machine stops and you come in as the architects.
To build something that will hold, you need someone who thinks like an attacker.