The hidden cost of vibe coding and AI agents

The general illusion #

Collaborative workspace, group of senior developers inspect a large glowing code scroll with a magnifying glass, AI agent in the background, professional and calm atmosphere.

I see it every day now. A developer types a short prompt. The AI agent writes 200 lines of code. It looks perfect. The UI is pretty. The feature is "done" in ten minutes. We call this vibe coding. If it feels right and the demo works, we ship it.

But there is a trap. AI is very good at making things that look like they work. It is not always good at making things that actually work for a long time. In my 25 years of tech, I have seen many hypes. AI is different because it is so fast. It can create technical debt faster than any human.

We need to talk about the real price of this speed. It is not just about writing code. It is about owning it.

What changed with AI coding agents #

Before we had "Copilots". They suggested a line or a block. Now we have "Agents". They can create whole projects. They can run terminal commands. They can "fix" bugs themselves. The barrier to entry is gone. Even people who never learned how a browser works can now build a web app. This is great for ideas. But it is dangerous for systems that need to stay alive for years.

The myth of "Agent Only" code #

I hear a new idea lately. People say: "Why do we care about clean code? Why format it nicely?". They think the agent can read any mess. They say we can just recreate the code every time with a prompt. If it is ugly for humans it does not matter because humans do not read it anymore.

While it is highly likely that in the future we will not need clean code anymore—because AI will flawlessly manage and understand any mess—we are not there yet.

Right now, AI still does a lot of things wrong. When an agent makes a mistake, it is still the human who has to jump in and find the bug. Because of this, being able to read and understand code is still incredibly important. If the code has no structure, it has no logic you can follow to correct the AI's errors. "Vibe coding" should not mean "messy coding" today. Good engineering is still about clarity, at least until the AI is truly infallible.

The illusion of speed #

Speed is the main selling point. But we often confuse "shipping code" with "delivering value". If the code causes a security leak next week the speed was a lie. True speed is measured by how long the code stays in production without breaking.

Skill gap and trust in AI output #

There is a big problem called Automation Bias. When the AI gives a confident answer we tend to believe it.

Technical debt and maintainability #

AI code often lacks "soul" or what we call clean architecture.

Security risks you still see every day #

AI-generated code has 2.74 times more vulnerabilities than human code.

Example: Exposed API Key #

BAD (AI often does this for speed): #

const apiKey = "sk-1234567890abcdef";
fetch(`https://api.service.com/data?key=${apiKey}`);

BETTER: #

// Use environment variables and a backend proxy
const response = await fetch('/api/proxy-endpoint');

Performance and data architecture mistakes #

AI likes to solve things "locally". If you ask for a list of active users it might fetch 10,000 users and filter them in the browser.

Example: Client-side filtering #

BAD: #

const users = await fetch('/api/all-users').then(res => res.json());
// AI filter on client side. Very slow with 5000 users!
const activeUsers = users.filter(u => u.active === true);

BETTER: #

// Filter on the database level
const activeUsers = await fetch('/api/users?status=active').then(res => res.json());

Accessibility and why we still fail #

AI still fails at accessibility at scale. It can help with simple alt text but it struggles with complex keyboard navigation.

Example: The "Fake" Button #

BAD: #

<div onclick="submitForm()" class="blue-box">Click Me</div>

BETTER: #

<button type="button" onclick="submitForm()">Click Me</button>

Why? A real button handles spacebar and enter key by default. A div does nothing

Why "just fix it later" does not work #

Many think: "I build fast now and then I let an agent refactor it later." This is a lie.

This problem is not new #

We had bad code before AI. But AI increases speed and volume. It lowers the barrier to ship bad solutions. We are now producing mess at scale.

Training data problem "shit in shit out" #

AI learns from the internet. The internet is full of bad and old and insecure code.

Where AI actually works well #

I am not anti-AI. It is great for:

Practical mitigation playbook #

If you use AI agents in your team you need rules. Here is my "Stay Safe" list:

AI is a power tool. It is like a chainsaw. It can help you build a house fast. But if you don't know how to sue it you might lose a leg. Let's stay safe.

Sources and further reading #