This AI-generated Code Can Destroy your Business

AI can now generate code with incredible autonomy, something we often call "vibe coding." This means more people can code, and we're seeing "citizen developers" pop up all over the globe.
It's boosting productivity and turning ideas into reality faster than ever before.
But… there's a big hidden cost that's still massively overlooked: security. This risk is super high, especially for folks who aren't tech-savvy and can't easily tell if the code is safe. That's a huge problem.
In this blog post, I'll show you a recent example of code generated by a colleague of mine (a project manager) that included a security flaw. This flaw wouldn't just have destroyed our business; it could have caused serious reputation damage and even legal issues.
Let's dive into it.
What Happened
The idea was to build a simple app that connects to a Supabase database to display personalized data for a SaaS application.
Our setup was pretty straightforward:
- A table with customer data, including names, companies, addresses, etc.
- A bunch of tables with personalized data, linked to the corresponding customer.
How the Code Was Generated
The process was really straightforward:
- We gathered the requirements.
- We connected Supabase via an AI-powered platform (MCP) with Claude.
- We gave the requirements to Claude and asked it to generate both the code AND all the necessary tables in Supabase.