A prompt in a chat box, a model crunching tokens, and 45 seconds later there’s a running dashboard: auth routes, a database connection, a slick frontend. No boilerplate. No syntax debugging. Just velocity.
That’s vibe coding, and vibe coding security is now a blue team problem whether anyone signed up for it or not. If you work in IT, there’s a decent chance one of these apps is already running somewhere you’re responsible for, built by someone who has never heard the phrase “row-level security.”
The good news: securing it doesn’t mean killing the vibe. It means doing what IT people already do with any new system. Find it, understand how it breaks, put controls around it, and make the process repeatable.
What vibe coding actually is
The term came from Andrej Karpathy, an OpenAI co-founder and former head of AI at Tesla, in a post on X on February 2, 2025. He described a style of building where you hand the work to the AI, stop reading the code, and judge the result by whether it runs. By the end of 2025, Collins Dictionary had named “vibe coding” its Word of the Year.
In practice the workflow is simple: describe the outcome you want, let an agent or large language model (LLM) write and patch the code, and evaluate success by whether the app behaves as expected. Historically, when a new paradigm sprints forward, security is tempted to slam the brakes. That instinct is wrong here. The gap between “idea” and “shipped software” is shrinking toward zero, and the defenders who understand how to work inside that gap will be worth a lot more than the ones who just say no.
Two kinds of vibe coders, two different risks
Not all vibe coding is created equal. From a risk perspective, what matters is who directs the prompt.
1. The citizen developer: building on pure vibe
Founders, product managers, designers, ops specialists, and the finance analyst who got curious on a Friday can now ship working internal tools and SaaS prototypes with no engineering background.
- The reality: the AI owns both the architecture and the implementation. The builder tests like a user: does the login button log me in, does the chart show the numbers?
- The blind spot: functional is not the same as secure. When an app “works,” people assume security came bundled with it. It usually didn’t. Models optimize for completing the task in front of them, not for defensive engineering they weren’t asked for.
2. The experienced engineer: AI as a force multiplier
Professional developers use tools like Cursor, Replit Agent, Lovable, Claude Code, or Copilot not because they can’t code, but to skip scaffolding and boilerplate.
- The reality: they keep the mental model. They know what a connection pool is, where race conditions hide, and where state should live.
- The blind spot: review fatigue and over-trust. When an AI produces hundreds of clean, plausible lines across a dozen files, reviewers skim instead of inspecting input handling, authorization checks, and edge cases.
How the blue team treats the difference
- With citizen builders, the work is structural: guardrails, approved platforms, and sandboxes so a weekend project can’t expose customer data or cloud credentials.
- With experienced engineers, the work is verification: CI/CD gates, automated scanning, and refusing to rubber-stamp AI-assisted pull requests.
Either way, the code ends up in the real world, facing real adversaries.
What the data says about AI-generated code
The most-cited measurement so far is Veracode’s 2025 GenAI Code Security Report (July 2025). Researchers gave more than 100 LLMs 80 coding tasks that each offered a secure and an insecure way to solve the problem. In 45% of cases, the generated code contained a vulnerability from the OWASP Top 10. The more uncomfortable finding: models got steadily better at writing code that compiles and runs, while their security results stayed flat over time.
Read that carefully. It doesn’t mean AI code is worse than human code. It means “it runs” tells you nothing about whether it’s safe, and the models aren’t closing that gap on their own.
The four holes vibe-coded apps keep shipping with
1. “It works, so ship it”: missing authorization and RLS
AI tools are great at wiring a frontend to a hosted database like Supabase or Firebase. They’re much less reliable about locking that database down. In platforms that expose tables directly to the browser, a missing Row-Level Security (RLS) policy turns a table into a public endpoint.
This isn’t hypothetical. In 2025, a researcher scanned 1,645 apps built with Lovable and found 170 of them with database tables readable, and in some cases writable, by anyone on the internet. It was assigned CVE-2025-48757. Every one of those apps worked perfectly in the demo.
2. Hardcoded secrets and API sprawl
Ask a model to “connect to Stripe,” “send a text with Twilio,” or “call the OpenAI API,” and the fastest path is pasting the key straight into a source file or, worse, the client-side bundle where anyone can read it with browser dev tools. If you’ve ever found a service account password in a login script, you already know this movie.
3. Package hallucinations and “slopsquatting”
LLMs sometimes recommend dependencies that don’t exist. A peer-reviewed study presented at USENIX Security 2025 analyzed 576,000 code samples from 16 models and found that 19.7% of recommended packages were fabricated. Worse, the hallucinations repeat: 43% of the fake names showed up again in every one of ten re-runs of the same prompt.
Predictable fake names are a gift to attackers. Register the name on npm or PyPI, put malware in it, and wait for the next agent to run npm install. Seth Larson of the Python Software Foundation coined the name for this in April 2025: slopsquatting. It’s typosquatting, except the typo comes from the AI.
4. Direct and indirect prompt injection
If the vibe-coded app itself uses an LLM and feeds untrusted user input (or untrusted documents, emails, or web pages) into the model’s context without boundaries, an attacker can hijack the instructions to leak data or trigger actions the app never meant to allow. We broke this class of risk down in our guide to the OWASP Top 10 for LLM applications.
Why IT pros already have the advantage here
Strip away the AI branding and look at what’s happening: someone outside the normal process stands up a system, connects it to real data, stores credentials carelessly, and pulls in third-party software nobody vetted. That’s shadow IT with a nicer UI. You’ve been cleaning it up for years.
Run it through the Threat & Control Method and the job gets concrete:
- Inventory: Which AI-built apps exist? Who built them, where are they hosted, what data do they touch, and which API keys do they hold? You can’t protect an app you don’t know about.
- Threats: For each one, walk the four holes above. Open tables, exposed secrets, unvetted dependencies, injectable prompts. If you’ve never done this formally, our post on threat modeling for IT professionals shows you already do half of it.
- Controls: Pick the controls that close the gaps you found (next section).
- Scale: Turn those controls into defaults: a rule file in every new repo, a scanning gate in every pipeline, an approved-platform list for citizen builders. Then the next fifty apps inherit the fix instead of the hole.
Hardening the vibe coding workflow
Securing AI-assisted development doesn’t require abandoning it. It requires treating the AI as an eager, lightning-fast junior who needs explicit operating boundaries.
1. Give the AI a security context file
Most AI coding tools read project-level instruction files before they generate anything: AGENTS.md, CLAUDE.md, Cursor’s project rules, or a SECURITY.md they’re told to follow. Put your non-negotiables there so every session starts with them:
# Project Security Mandates
When generating code, you MUST follow these requirements:
1. Input handling
- Validate and sanitize all user input on the server side using strict schemas (e.g., Zod, Pydantic).
- Never rely on client-side validation alone.
2. Authentication & authorization
- Enforce server-side role and session checks on every API route.
- Enable Row-Level Security (RLS) and write explicit policies for every database table.
3. Database access
- Never build queries with string interpolation. Use parameterized queries or an established ORM.
4. Secrets
- Never hardcode secrets, API keys, or tokens in code or frontend bundles.
- Load them from environment variables and document required keys in .env.example.
5. Logging
- Log security-relevant events (failed logins, permission denials, rate-limit hits).
- Never log passwords, session tokens, or personal data.
6. Dependencies
- Only suggest widely adopted, actively maintained packages.
- Never add a package without confirming it exists on the official registry.
Be honest about what this does. A rule file shifts the model’s defaults in the right direction. It does not guarantee compliance, and it is not a substitute for verification. Think of it as the policy; the next section is the enforcement.
2. Treat AI output as untrusted input
Defenders treat inbound web traffic as hostile until proven otherwise. Machine-generated code deserves the same posture.
- Secret scanning with push protection: block commits that contain keys before they ever reach the repository (GitHub’s push protection is one example).
- SAST and dependency scanning in the pipeline: if a change introduces SQL injection, unsafe deserialization, or a known-vulnerable package, the build fails automatically. No human willpower required.
- A dependency gate: route installs through an internal registry proxy or an allowlist, and flag brand-new or low-download packages for review. That’s the practical defense against slopsquatting.
- Sandboxed agents: if an agent can run shell commands, run it in an isolated container with no production credentials and no access to sensitive environment variables. Least privilege applies to AI accounts too.
- A database check before launch: for any app on a hosted backend, confirm RLS is enabled and has real policies on every exposed table. It takes minutes and would have prevented CVE-2025-48757.
None of these are exotic. They’re the same kind of controls you already run, pointed at a new source of change.
Frameworks to anchor the work
You don’t have to invent secure vibe-coding standards from scratch.
- OWASP Top 10 and OWASP Top 10 for LLM Applications: the first covers the classic web flaws AI keeps reintroducing (injection, broken access control, misconfiguration). The second covers apps that embed AI features: prompt injection, sensitive information disclosure, and excessive agency.
- OWASP ASVS (Application Security Verification Standard): a detailed checklist of application-level controls. Paste specific ASVS requirements into your prompts and you’re building against tested criteria instead of the model’s guesses.
- NIST SP 800-218, the Secure Software Development Framework (SSDF): its practices are outcome-based. They ask whether code was reviewed, tested, tracked, and traceable, not who or what typed it. Our reading: AI-generated code gets no exemption and no special lane. NIST’s companion profile, SP 800-218A (July 2024), is aimed at organizations building or fine-tuning AI models themselves, so it’s worth knowing if your company does that.
Security isn’t anti-vibe. It’s quality control.
In cybersecurity, the mission is rarely to tell the business “no.” It’s to say: here’s how we do this fast without leaving the back door unlocked.
Vibe coding is here to stay. It lets domain experts build their own tools and lets engineers spend time on architecture instead of boilerplate. But when an organization starts vibe coding, security can’t be the thing someone remembers after launch. Cybersecurity is not rocket science, and neither is this: a rule file, a few automated gates, and someone with an adversarial mindset asking “what happens if this table is public?” before it is.
That someone can be you. The instinct that makes a good sysadmin check permissions before handing over access is exactly the instinct AppSec needs right now. If you want a structured way to turn that instinct into a defensive security career, that’s what our IT-to-cybersecurity program is built around.
Try this: audit something you vibe coded
Pick a project you built with an AI assistant, even a small script, and spend 30 minutes on it:
- Run a free static analysis tool like Semgrep across the repository.
- Search the code and git history for anything that looks like a key or token.
- Look up every dependency on its official registry. Does it exist, who maintains it, and how old is it?
- If there’s a hosted database, check whether every table has RLS enabled with a real policy.
Write down what you find and what you fixed. That’s a real AppSec artifact for your portfolio, and it says a lot more in an interview than “I’m interested in security.”
Want one practical defensive security breakdown like this in your inbox each week? Subscribe to Keep IT Safe, the Blue Team Academy newsletter for IT pros moving into cybersecurity.
Sources
- Veracode, 2025 GenAI Code Security Report (July 2025)
- Spracklen et al., “We Have a Package for You!” A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs, USENIX Security 2025
- NIST National Vulnerability Database, CVE-2025-48757 (May 2025)
- NIST, Secure Software Development Framework (SP 800-218 and SP 800-218A)
- OWASP, Top 10 for LLM Applications and ASVS
Last updated: November 2026. We review the statistics in this post quarterly.

