← Latest papers
🤖 AI

LLMs + Security = Trouble

The paper argues that relying on probabilistic AI to detect vulnerabilities in AI-generated code is insufficient and that instead, security should be integrated directly into the generation process—such as through constrained decoding in diffusion-style models—to provide stronger, "secure-by-construction" guarantees without overburdening developers.

Original authors: Benjamin Livshits

Published 2026-02-10
📖 4 min read☕ Coffee break read

Original authors: Benjamin Livshits

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 Problem: "Fighting Fire with Fire"

Imagine you are building a massive, high-tech skyscraper. To speed things up, you hire a fleet of robot builders (LLMs) to lay the bricks and install the plumbing.

The problem? These robots are incredibly fast, but they don't actually "understand" physics or safety codes. They just look at millions of pictures of buildings and try to mimic them. Because they are just guessing based on patterns, they occasionally leave a structural beam loose or install a gas pipe right next to an electrical outlet.

Currently, the industry's solution is to hire robot inspectors (AI checkers) to look at the work of the robot builders (AI generators).

The author, Benjamin Livshits, argues that this is like "fighting fire with fire." If your builders are making mistakes based on probability and guesswork, your inspectors will likely make the same kind of mistakes. You end up with a "probabilistic loop" where both the builder and the inspector are just guessing, leaving the building vulnerable to a "black swan" event—a rare but catastrophic structural failure that neither robot saw coming.


The Three Main Arguments

1. The "Long Tail" of Danger (The Needle in the Haystack)

In a giant codebase, most bugs are easy to find. But the dangerous ones—the "zero-days"—are like tiny, microscopic cracks in a foundation. They only appear under very specific, weird conditions (like a massive earthquake happening at the exact moment a heavy truck drives by).

Because AI inspectors work on a "budget" (they can only check so many things in a certain amount of time), they tend to focus on the obvious stuff. They miss the "long tail" of rare, complex errors. A human hacker, however, is like a patient detective who will spend months looking for that one specific crack. If the defender is using a "guessing" robot, the attacker will eventually find the gap.

2. The "Vibe Coding" Trap (The Lazy Architect)

There is a new trend called "vibe coding," where developers just describe what they want in plain English and let the AI do the rest. It feels magical—you’re just "vibing" with the machine.

The paper argues that if we try to fix this using "Neurosymbolic" methods (which is a fancy way of saying "mixing AI with strict mathematical rules"), we run into a human problem. These strict methods require the human to act like a rigorous mathematician, checking every single logic step. But most "vibe coders" just want to hit "Accept All" and move on. This makes the human the weakest link; they become a "rubber stamp" for code they don't actually understand, effectively bypassing all the safety checks.

3. The Solution: "Security by Construction" (The Pre-Molded Brick)

Instead of building a house and then checking if it's safe, the author suggests we should change how the bricks are made.

Instead of letting the AI "freestyle" the code and then checking it later, we should use "Constrained Decoding."

The Analogy:
Imagine you are teaching a child to draw.

  • The old way (Post-hoc): You let them draw anything, and then you take a red marker and circle the mistakes. (This is slow and messy).
  • The new way (Constrained): You give them a coloring book with thick, black outlines. They can still be creative with the colors, but they physically cannot draw outside the lines.

The author specifically points toward "Diffusion Models" (the same tech used to create AI art like Midjourney). These models don't just write code one word at a time; they "shape" the whole program at once. This allows us to bake security rules directly into the "shape" of the code. If a piece of code is supposed to have a safety lock, the model is mathematically prevented from even "imagining" a version of the code that doesn't have it.

Summary in a Nutshell

We shouldn't try to build a "smart" police force to catch "dumb" AI criminals. Instead, we need to build "smart" factories that make it physically impossible for the AI to manufacture a broken part in the first place.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →