Is Vibe Coding Safe? Benchmarking Vulnerability of Agent-Generated Code in Real-World Tasks
This paper introduces the SUSEVIBES benchmark to demonstrate that current LLM-based "vibe coding" agents, while often functionally correct, generate highly insecure code in real-world software engineering tasks, with preliminary mitigation strategies proving ineffective.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The "Vibe Coding" Safety Check: Why Your AI Intern Might Be a Security Nightmare
Imagine you hire a brilliant, super-fast new intern who can write code just by you chatting with them in natural language. You say, "Hey, build me a login system," and they instantly spit out a working program. This is "Vibe Coding." It's trendy, fast, and feels like magic.
But here's the scary question the paper asks: Is this magic safe?
The researchers built a giant stress test called SUSVIBES to find out. They treated these AI coding agents like interns and gave them 200 real-world tasks—like fixing a security hole in a popular website or adding a new feature to a massive software project.
Here is what they found, broken down with some simple analogies.
1. The "Perfectly Flawed" Intern
The most disturbing discovery is that the AI is great at doing the job, but terrible at doing it safely.
- The Analogy: Imagine you ask an intern to build a bank vault door.
- Functionality: The door opens when you turn the handle. It locks when you push the button. It looks exactly like a vault. The AI gets an A+ for making the door work.
- Security: The door has a hidden keyhole on the outside that anyone can pick, or the hinges are made of paper. The AI gets an F for security.
The Stats:
When the best AI (Claude 4 Sonnet) was given a task, it successfully built the feature 61% of the time. But out of those successful builds, 89% were insecure.
- Translation: If you let your AI intern build your software, there's a roughly 9 out of 10 chance they will leave the back door wide open for hackers, even if the front door works perfectly.
2. The "Kitchen" vs. The "Whole Restaurant"
Previous tests for AI coding were like asking the AI to bake a single cookie in a test kitchen. They only looked at one small file of code.
- The Old Way: "Here is a recipe for a cookie. Make it." (Easy, safe, small scope).
- The New Way (Vibe Coding): "Here is the entire restaurant, the supply chain, the kitchen, and the dining room. Go fix the plumbing and add a new menu item without breaking the fire alarm."
SUSVIBES is the "Whole Restaurant" test. It forces the AI to navigate complex, messy, real-world codebases. The AI gets lost in the weeds and misses the security traps that are hidden in the corners of the building.
3. The "Security Reminder" Didn't Work
The researchers tried to help the AI by giving it a gentle nudge, like a teacher saying, "Hey, remember to be careful with security!" They even tried giving the AI a cheat sheet of specific security rules.
- The Result: It didn't help much. In fact, it made things worse.
- The Analogy: It's like telling a nervous driver, "Drive safely, but also get to the destination fast." The driver gets so focused on "driving safely" (checking mirrors, slowing down) that they forget to actually drive the car, or they crash because they are overthinking.
- The Outcome: When the AI tried too hard to be "secure," it stopped working correctly. When it focused on "working," it forgot to be "secure." It couldn't do both at the same time.
4. The "Blind Spots" of Different AIs
The paper tested different AI models (like Claude, Kimi, and Gemini). They found that different AIs are bad at different things.
- The Analogy: Imagine three different security guards.
- Guard A is great at spotting people climbing the fence but misses people sneaking through the front door.
- Guard B is great at the front door but misses the back window.
- Guard C misses everything.
- The Problem: There is no "Super Guard" yet. Even the smartest AI models have blind spots. If you rely on just one, you are guaranteed to have a vulnerability somewhere.
5. Real-World Consequences
The paper didn't just look at abstract code; they looked at real scenarios. Here are two examples of what the AI got wrong:
- The "Time-Telling" Lock: In a password system, the AI wrote code that answered "No" instantly if the password was wrong, but took a tiny fraction of a second longer if the username didn't exist.
- Why this matters: A hacker can time how long the computer takes to answer. By measuring the delay, they can guess which usernames are real. It's like a lock that clicks louder when the key is wrong, letting a burglar know which door to pick.
- The "Poisoned" Link: In a content management system, the AI let users post links without checking if they were dangerous.
- Why this matters: A hacker could post a link that looks normal but actually steals your login cookies when you click it. The AI built the feature perfectly, but forgot the "sanity check" that stops bad links.
The Bottom Line
"Vibe Coding" is currently a high-risk gamble.
The paper concludes that while AI is amazing at making software work, it is currently very bad at making software safe. If you are a company building something that handles money, health data, or private information, you cannot just let the AI "vibe" the code and hope for the best.
The takeaway: Treat AI-generated code like a car built by a robot that has never seen a traffic light. It might drive down the road, but you absolutely need a human mechanic to check the brakes before you let anyone ride in it.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.