Vibe Coding Is Not Secured by Default: What a New Study Tells Us About AI‑Generated Code

January 15, 2026
Insights

Over the last 18 months, “vibe coding” has shifted from online trend to widespread practice. Developers drop a natural‑language request into tools like Cursor, Claude Code, or GitHub Copilot Agents and let an LLM agent implement a feature end‑to‑end.

Surveys now show that about 75% of developers already vibe code, and most are happy with the results.[1] But a new study from Carnegie Mellon University and collaborators asks a simple question:

When AI agents implement “real” features in “real” repositories, how often is the resulting code actually secure?

The answer is uncomfortable: even when the code “works,” it is usually vulnerable.[1]

In this article, we unpack the main findings of this study and translate them into practical takeaways for engineering and security teams, and into how we think about guardrails at Symbiotic Security.[1]

1. What the study actually measures

Most AI‑security benchmarks look at toy snippets: a single function or file, one‑shot generated by a model.

This study is different. It focuses on vibe‑coding agents working on real‑world repositories:

Crucially, the benchmark used in the study covers 77 different CWE types, far more than previous benchmarks.[1]

Takeaway #1

The study finally evaluates AI coding agents in settings that look like your real codebase: big repos, multi‑file edits, complex tests, and subtle security bugs.

2. The headline: “Works” does not mean “secured”

The authors evaluate multiple agent frameworks (SWE‑Agent, OpenHands, Claude Code) on top of several frontier models (Claude 4 Sonnet, Kimi K2, Gemini 2.5 Pro). The numbers that matter:

In other words:

Roughly 8 out of 10 “functionally correct” agent‑generated patches are still vulnerable.

And this is not a single‑model issue. Across agents and models, the pattern repeats: functional success is much higher than secure success.

Takeaway #2

If your acceptance criterion is “tests pass” or “it seems to work in staging,” you are almost certainly shipping vulnerabilities when you rely on vibe coding for feature implementation.

3. The types of failures: subtle, realistic, and impactful

The paper includes several case studies that look very familiar to anyone doing AppSec in real systems:

  1. Timing side channel in password verification (Django)
    • The agent re‑implements a helper like verify_password.
    • The insecure version returns early for None or unusable passwords, creating a measurable timing gap between “user exists” and “user does not exist”.
    • Result: user enumeration becomes feasible.
  2. CRLF injection in HTTP redirects (Buildbot)
    • Redirect URLs are used directly in the Location header with no sanitization.
    • An attacker injects \\r\\n to add forged headers (e.g., cookies).
    • Result: header injection, cache poisoning, or session fixation.
  3. Unbounded session lifetime (aiohttp_session)
    • Session data is always restored if decryptable.
    • No check that created is within max_age.
    • Result: expired sessions remain valid, defeating session timeout as a control.
  4. Unvalidated external links in CMS (Wagtail)
    • Draft.js link entities become <a href="..."> without URL scheme validation.
    • Result: stored XSS via javascript: URLs.

These are not “weird” synthetic bugs. They are the same classes of issues that red teams and bug bounty hunters exploit in high‑value systems.

Takeaway #3

AI agents are very good at “making it work” and very bad at respecting the deep invariants that underpin security: constant‑time checks, safe URL handling, strict session lifetime, and so on.

4. “Let’s just prompt it for security” doesn’t work

The authors also test several prompt‑based mitigation strategies:

Intuitively, you might expect this to help. In practice:

The reason is important:

Takeaway #4

Security “by prompt engineering” hits a ceiling fast. LLMs cannot reliably trade off functionality and security just by being told to “be secure.”

You need external guardrails and checks, not just nicer prompts.

5. Agents and models have different security “blind spots”

Another interesting finding: different LLMs and agent frameworks:

For example (in the paper):

This suggests that:

Takeaway #5

Security behavior is non‑uniform across models and agents. A single AI coding setup may be particularly blind to certain vulnerability classes in your stack.

6. What this means for engineering leaders

The study is not saying “never use vibe coding.” It is saying:

Using vibe coding as‑is in production, without guardrails, is a security‑incident generator.

Concretely, if you let agents:

…then you should assume that:

Takeaway #6

AI‑assisted coding needs system‑level safety, not just “model alignment” or better UX.

You need policies, guardrails, and automated checks around the model and the agent.

7. How this maps to guardrails and MCP‑based workflows

The study focuses on code security, but the implications extend to agentic workflows more broadly, especially with MCP‑style agents that:

From our point of view at Symbiotic Security, the study reinforces several design principles we already believe in:

  1. Guardrails wrap the whole workflow, not just the model
    • Restrict which repos, branches, services, and tools an agent can touch.
    • Enforce policy checks on planned actions before they are executed.
  2. Security checks must be independent of the agent
    • Detection engines that run outside the LLM.
    • Tests and scans that do not rely on the agent “remembering” to be secure.
  3. Deep remediation is a separate capability
    • Once detection finds issues (in human or AI‑generated code), you need multi‑file, end‑to‑end remediation—again evaluated by independent checks.
  4. Developers remain the final control point
    • Agents can propose patches and plans, but humans must:
      • See the full diff
      • Understand risk signals
      • Approve or reject with context

Takeaway #7

The right mental model is: “We do not trust individual AI outputs; we trust the guarded system that surrounds them.”

8. From this study to a secure AI‑era SDLC

This study delivers a clear message to teams scaling AI copilots and coding agents:

To move from “experiments” to safe scale, organizations will need:

This is exactly the journey we are working on at Symbiotic Security: bringing guardrails, MCP‑aware checks, deep remediation, and developer‑centric training into a single workflow, so teams can benefit from vibe coding without inheriting its security liabilities.

About the author
Jerome Robert
CEO - Symbiotic
With over 20 years of experience in cybersecurity and 15 years as a CxO, Jérôme has a proven track record in driving successful outcomes. He has been instrumental in five successful exits, including Lexsi (acquired by Orange in 2016) and Alsid (acquired by Tenable in 2021)
Icon line
See all articles

Book a demo

See how our solution empowers teams to grow their security maturity and to code securely & efficiently.
Book a demo
Icon line
Demo illustration