LLMs + Security = Trouble

📅 2026-02-09
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitations of current large language models (LLMs) in generating secure code, which predominantly rely on post-hoc detection mechanisms that struggle to cover long-tail vulnerabilities and are vulnerable to zero-day exploits. To overcome this, the paper proposes integrating security constraints—such as formal rules—directly into the code generation phase. By leveraging constrained decoding within diffusion-based code models, the approach embeds modular, hierarchical security mechanisms that enforce “secure-by-construction” outputs. This paradigm eliminates reliance on probabilistic detection or manual intervention, significantly reducing the need for downstream validation while enhancing the intrinsic security of generated code. The method thus offers a more robust and reliable pathway for secure LLM-assisted programming.

Technology Category

Machine Learning: Large Multimodal Models (LMMs)Natural Language Processing: Code Generation / Program Synthesis from Natural LanguageComputer Vision: Large Vision Models

Application Category

User Modeling, Personalization and Recommendation: Large Language Models (LLM) for user modeling and recommendationSearch and Retrieval-Augmented AI: Large language models for searchEconomics, Online Markets and Human Computation: Cost models of using LLMs in production systems
📝 Abstract
We argue that when it comes to producing secure code with AI, the prevailing"fighting fire with fire"approach -- using probabilistic AI-based checkers or attackers to secure probabilistically generated code -- fails to address the long tail of security bugs. As a result, systems may remain exposed to zero-day vulnerabilities that can be discovered by better-resourced or more persistent adversaries. While neurosymbolic approaches that combine LLMs with formal methods are attractive in principle, we argue that they are difficult to reconcile with the"vibe coding"workflow common in LLM-assisted development: unless the end-to-end verification pipeline is fully automated, developers are repeatedly asked to validate specifications, resolve ambiguities, and adjudicate failures, making the human-in-the-loop a likely point of weakness, compromising secure-by-construction guarantees. In this paper we argue that stronger security guarantees can be obtained by enforcing security constraints during code generation (e.g., via constrained decoding), rather than relying solely on post-hoc detection and repair. This direction is particularly promising for diffusion-style code models, whose approach provides a natural elegant opportunity for modular, hierarchical security enforcement, allowing us to combine lower-latency generation techniques with generating secure-by-construction code.
Problem

Research questions and friction points this paper is trying to address.

secure code generation
zero-day vulnerabilities
LLM-assisted development
security guarantees
long-tail security bugs
Innovation

Methods, ideas, or system contributions that make the work stand out.

constrained decoding
secure-by-construction
diffusion code models
neurosymbolic methods
LLM-assisted development