The Verification Gap Nobody Talks About
Andrej Karpathy coined the term “vibe coding” in a February 2025 post on X, describing a practice where developers “fully give in to the vibes” and let AI write their code. Within a year, vibe coding went from a catchy phrase — named Collins English Dictionary Word of the Year for 2025 — to the default mode for a staggering share of software development.
The numbers confirm how deeply AI has penetrated the craft. DX’s research across 121,000 developers at 450+ companies found that 92.6% now use an AI coding assistant at least monthly, with roughly 75% using one weekly. According to Sonar’s 2026 State of Code survey, AI accounts for 42% of all committed code — a volume developers expect to reach 65% by 2027.
But here is where the numbers turn alarming. That same Sonar survey revealed that 96% of developers do not fully trust AI-generated code, yet only 48% always check it before committing. This verification gap — high adoption, low oversight — is the engine driving a security crisis across the software industry.
How Vulnerable Is AI-Generated Code?
CodeRabbit’s “State of AI vs Human Code Generation” report, analyzing 470 real-world pull requests, found that AI-generated code produces 1.7 times more issues than human-written code across logic, maintainability, security, and performance categories. On specific vulnerability types, the gaps widen further: AI code is 2.74x more likely to introduce cross-site scripting (XSS) flaws, 1.91x more likely to create insecure object references, and 1.88x more likely to mishandle passwords.
Independent research from Apiiro, examining Fortune 50 enterprises, found that vulnerabilities with a CVSS score of 7.0 or higher appear 2.5 times more often in AI-generated code than in human-written code.
Escape.tech’s security team put these risks into concrete terms. After scanning over 5,600 publicly deployed vibe-coded applications built on platforms like Lovable, Bolt.new, and Base44, they identified more than 2,000 high-impact vulnerabilities, over 400 exposed secrets — API keys, database credentials, authentication tokens — and 175 instances where personal data including medical records and financial details was publicly accessible.
The Lovable platform exemplifies the pattern. When researchers scanned 1,645 applications built with Lovable, 170 of them — 10.3% — had completely exposed databases with no Row-Level Security enabled, earning CVE-2025-48757. By February 2026, a separate researcher found 16 vulnerabilities in a single Lovable showcase app that exposed the personal data of over 18,000 users.
Why AI Models Produce Insecure Code
Understanding the root cause requires examining how large language models approach code generation. These models train on massive corpora drawn from public repositories, tutorials, and Stack Overflow answers — code that prioritizes clarity and demonstration over defensive security.
A Stack Overflow answer demonstrating database queries typically uses string concatenation rather than parameterized queries because it is easier to understand. The model, trained on thousands of such examples, internalizes this as the default pattern. Security configurations are context-dependent — proper access controls and encryption depend on specific deployment environments and threat models that a generic prompt cannot capture.
Most fundamentally, AI models lack adversarial thinking. They generate code that handles expected inputs and produces expected outputs. They do not anticipate what happens when an attacker sends malformed data, exploits race conditions, or chains minor vulnerabilities into privilege escalation. This adversarial mindset — thinking like an attacker — is precisely what human security engineers bring to code review, and precisely what the vibe coding workflow bypasses.
Advertisement
The Moltbook Wake-Up Call
The theoretical risks became viscerally real in February 2026 when Wiz security researchers examined Moltbook, a social networking platform for AI agents that was entirely vibe-coded. A Supabase API key exposed in client-side JavaScript, combined with completely absent Row-Level Security, gave unauthenticated users full read-and-write access to the entire production database.
The exposed data included 1.5 million API authentication tokens, 35,000 email addresses, private messages between agents, and plaintext OpenAI API keys shared in conversations. Any account on the platform could be hijacked with a single API call. The incident demonstrated how vibe coding’s core vulnerability — shipping functional code without security review — can turn a standard public API key into an admin-level backdoor.
The Trust Paradox
The Stack Overflow developer survey documented a striking shift: positive favorability toward AI coding tools dropped from 72% to 60% in a single year. Sonar’s data is even more stark — 61% of developers agree that “AI often produces code that looks correct but is not reliable,” and 38% say reviewing AI-generated code takes more effort than reviewing code written by colleagues.
Yet behavior has not caught up with awareness. Developers report lower trust but continue shipping AI-generated code at the same or increasing rates. The productivity incentives — faster delivery, more features per sprint, competitive pressure from AI-native startups — override security concerns. Organizations know the risks exist but have not restructured their development workflows or security review processes to match the fundamentally different risk profile of AI-generated code.
What Mature Teams Do Differently
Organizations navigating this crisis effectively treat AI coding assistants as force multipliers for competent developers, not replacements for competent development practices. Several patterns emerge.
Layered review processes. AI-generated code goes through automated security scanning, automated test generation, peer review with specific attention to security patterns, and security team review for sensitive components. This is slower than raw vibe coding but dramatically faster than writing everything from scratch.
Security-aware prompting. Instead of accepting default AI output, developers include security requirements explicitly. “Build a login system” becomes “build a login system with parameterized queries, bcrypt password hashing, rate limiting, CSRF protection, and secure session management.” The results are measurably better, though still imperfect.
Architecture-level controls. Rather than relying entirely on application code for security, organizations implement API gateways with built-in rate limiting, zero-trust networking, database-level access controls independent of application code, and infrastructure-as-code templates that enforce security baselines regardless of code quality.
AI-specific security metrics. Beyond velocity, mature teams track vulnerability density per AI-generated module, time-to-detection for AI-introduced flaws, and the percentage of AI-generated code that passes security review without modification.
The Liability Question
As AI-generated code proliferates in production systems, the legal landscape is shifting. The EU AI Act, with high-risk system obligations taking effect August 2, 2026, classifies general-purpose AI models under transparency and documentation requirements. Non-compliance attracts fines up to EUR 35 million or 7% of global turnover, with directors facing potential personal liability.
Current legal frameworks were not designed for code written by neither a human developer nor a traditional software product. Product liability assumes a human manufacturer. Professional negligence assumes human judgment. AI-generated code falls into a gap between these frameworks — a gap that regulators, insurers, and courts are only beginning to address.
The practical implication is clear: the assumption that AI-generated code can be deployed with the same governance as human-written code is becoming legally untenable. Organizations need documentation, review trails, and security validation that demonstrate due diligence.
Frequently Asked Questions
What is vibe coding and why has it become a security concern?
Vibe coding is the practice of using AI coding assistants to generate substantial portions of application code from natural language prompts, often without thorough line-by-line review. Coined by Andrej Karpathy in February 2025, the term describes developers who “give in to the vibes” and ship AI output with minimal scrutiny. It has become a security concern because CodeRabbit’s analysis of 470 pull requests found AI-generated code produces 1.7x more issues than human-written code, with specific vulnerability types like cross-site scripting appearing at 2.74x the rate. Escape.tech’s scan of 5,600 vibe-coded apps found over 2,000 vulnerabilities and 400+ exposed secrets in production systems.
Can organizations use AI coding tools safely, or should they avoid them entirely?
AI coding tools can be used safely, but they require different governance than traditional development. The key is treating AI output as a first draft that needs security review, not production-ready code. Organizations that implement layered processes — automated security scanning in CI/CD, AI-aware peer review, and mandatory human oversight for security-critical components like authentication and data access — can capture the productivity benefits while managing vulnerability risk. Sonar’s 2026 survey found that teams who always verify AI code before committing significantly reduce their exposure compared to the 52% who do not.
Who is legally liable when AI-generated code causes a data breach?
The organization deploying the code bears primary responsibility under data protection regulations like GDPR and sector-specific compliance frameworks. The EU AI Act, with high-risk system obligations taking effect August 2, 2026, adds new layers: non-compliance fines reach up to EUR 35 million or 7% of global turnover, and directors face potential personal liability. AI tool vendors currently have limited liability under license agreements, though this is evolving. The practical takeaway is that organizations must document their AI code review processes to demonstrate due diligence — the assumption that AI-generated code can be governed like human-written code is becoming legally untenable.
—
Sources & Further Reading
- Escape.tech — Methodology: 2K+ Vulnerabilities in Vibe-Coded Apps
- CodeRabbit — State of AI vs Human Code Generation Report
- Sonar — State of Code Developer Survey Report 2026
- Wiz — Exposed Moltbook Database Reveals Millions of API Keys
- Stack Overflow — Closing the Developer AI Trust Gap
- Superblocks — Lovable Vulnerability Explained: How 170+ Apps Were Exposed
- DX — Measuring AI Code Assistants and Agents
- The Register — AI-Authored Code Needs More Attention, Contains Worse Bugs















