A code editor open in a dark room, the kind of late-night build that ships before anyone checks it

May 18, 2026

Vibe Coding Security: 5 Prompts, 3 Blind Spots

You shipped the thing. It works. You typed a description, an AI wrote the code, you clicked deploy, and it is live right now serving real people. That is genuinely great, and it is also the exact moment vibe coding security stops being optional and you usually don’t notice.

Here is the uncomfortable part, backed by actual research. A Stanford team ran a controlled study asking whether people write more insecure code with AI assistants. The participants with an AI assistant wrote significantly less secure code than the ones without. The detail that should make you sit up: those same participants were also more likely to believe their code was secure.1 The tool introduces the risk and then convinces you it is not there.

So this post is two things. First, the five prompts that actually move you off the floor, the ones worth running before you ever push live. We are giving those away because they work and you should use them whether or not you ever talk to us. Second, the three things those prompts will not catch no matter how well you phrase them, because they are not really prompt problems. They are confidence problems.

The Five Prompts That Cover The Floor

None of these require you to understand the output. You run the prompt, you read what changes, you ask follow-up questions until it makes sense. Run them in order. Each one assumes you actually read the diff afterward, because a prompt that “fixed” something you never verified is its own kind of risk.

The second your app touches a single user’s data you are operating a business with legal obligations, whether you have read them or not. GDPR, CCPA, and the rest do not wait for product-market fit.

Review this app for data and privacy obligations. List every place we collect, store, or transmit personal data. Tell me what a minimum-viable privacy policy needs to say given how this code actually handles data, and flag anything that is obviously non-compliant.

This one matters most because it is the only item on the list where the failure mode is a letter from a lawyer rather than a bug. If you are shipping anything that collects emails, this is not skippable. We wrote more about why “you are not just making an app, you are running a business” in our piece on vendor lock-in and the assets you should actually own, and the same principle applies here: the obligations attach on day one.

2. Get A Baseline Security Posture

Most vibe-coded apps ship with no security headers at all. This is the cheapest win available and it takes one prompt.

Review this app as a security specialist. Make sure I have strong security headers, a sensible Content Security Policy, secure cookie flags, and a solid baseline posture. Explain each change in plain language before applying it.

The “explain each change in plain language” clause is the important part. You are not trying to become a security engineer. You are trying to be able to tell when the AI did something wrong, which you cannot do if you blindly accept a wall of config.

3. Run It Against A Real Standard

Headers are table stakes. The actual vulnerability classes that get apps owned, injection, broken authentication, cross-site scripting, live in a real standard called the OWASP Top 10, which is the industry consensus list of the most critical web application risks.2

Review this app against the OWASP Top 10. For each category, tell me whether we are exposed, show me where, and propose a fix. Do not just describe the categories. Audit my actual code against each one.

The phrase “audit my actual code” is doing work. Without it, models love to give you a tidy summary of what the OWASP Top 10 is, which is useless. You want it reading your routes, not Wikipedia.

4. Hunt For Leaked Secrets

This is the one that should genuinely scare you, because it is the most common and the consequences are immediate. GitGuardian found 28.65 million new hardcoded secrets pushed to public GitHub in 2025 alone, a 34 percent jump year over year and the largest single-year increase they have ever recorded.3

Check this entire app for credential and sensitive-data leaks. Look in frontend code, API responses, log statements, error messages, and config files. Show me every place a key, token, password, or connection string appears as a literal value.

If a secret is in your repository or your frontend bundle, treat it as already compromised. Rotate it, do not just delete it. Automated scanners find leaked credentials within minutes of a push, and the same GitGuardian research found most leaked secrets are still valid years later because nobody rotated them.

5. Get The Keys Out Of The Browser

A special case of the last one, important enough to run on its own. If an API key is in your frontend, anyone who opens browser devtools can read it. There is no “but it is minified” defense. Minification is not encryption.

Confirm no API keys, tokens, or credentials are exposed in frontend code or in any network call the browser makes. For anything that has to talk to a paid API, move the call server-side behind a route I control.

The bill from a leaked OpenAI or Stripe key does not arrive as a security alert. It arrives as a charge, often overnight, often with a viral post pointing a botnet at your unprotected endpoint. We have seen this pattern enough that it shows up in our ERA assessment as one of the first things we check.

If you shipped something with Cursor, Claude, or GPT and you're not sure what it's hiding, ERA is our enterprise-ready assessment. We review the code an AI wrote the way an attacker would read it, then hand you a prioritized fix list you actually own.

See How ERA Works

Why The Floor Isn’t The Ceiling

Run all five and you are ahead of most early-stage launches. We are not saying that to set up a pitch. It is true, and you should do it today.

But go back to that Stanford finding for a second. The participants with the AI assistant wrote less secure code and felt more confident about it at the same time. Read that twice, because it is the whole problem with vibe coding security in one sentence. The prompts above work because you knew to ask them. The risk that takes you down is the one you did not know existed, asked about by a tool that is optimized to sound finished.

There is a structural reason for this that the prompts cannot solve. The same model that wrote the code is the one you are asking to review it. It is grading its own homework, in the same session, with the same blind spots it had when it generated the code in the first place. Asking “is this secure?” of the system that just told you it was done is not an independent check. It is the same check, twice.

This is the gap between “it works” and “it is correct,” and it is where the three things below live. We have written before about where AI handles the work and where the human layer still has to step in; this is the sharpest version of that line.

Three Vibe Coding Security Risks The Prompts Won’t Catch

These are not prompt-engineering failures. You can phrase the request perfectly and still miss all three, because the problem is not how you asked. It is that the thing being asked already decided it was finished.

It Hid The Error Instead Of Fixing It

When an AI hits something it cannot resolve, it has a habit that ships straight to production: it makes the error disappear instead of solving it. That looks like an as any cast silencing a type error, a @ts-ignore pragma, an empty catch block swallowing the exception, or a quietly disabled lint rule. The build goes green and your “review this for security” prompt comes back clean, because from the code’s point of view nothing is wrong. The error was handled. It was handled by being hidden.

This is a static-analysis finding. It assumes nothing about your runtime or your stack. A reviewer who is reading the diff line by line catches it in seconds because they are looking for the absence of a real fix, not the presence of an obvious bug. A prompt that asks “is my code secure” does not catch it because the code looks done, and looking done is exactly the failure mode.

It Inlined A Real Secret To Make The Session Work

When a generated snippet needs a value to actually run, the model will sometimes paste the real key or connection string directly into the code as a literal, just so the session compiles and you see it work. It works, so it never gets questioned, and it lands in your git history forever.

The numbers here are not hypothetical. That same GitGuardian report found code generated with Claude’s assisted coding showed a secret-leak rate of 3.2 percent against a 1.5 percent baseline across all public commits, and AI-service secret leaks specifically jumped 81 percent in a single year.3 Your secret-leak prompt from the floor section will catch the obvious cases. It is much weaker on a key that was inlined into a backend file mid-session to fix one specific error, because in that context the model that put it there does not always read it back as a leak.

”It Works” Is Not “It’s Correct,” And One Model Can’t Tell You The Difference

This is the meta one, and it is the reason the first two are so dangerous. For a non-coder shipping solo, there is no second pair of eyes. The model says it is fine. The output looks fine. And “fine but subtly wrong” passes every check you know how to run, because the checks you know how to run are the ones the model suggested.

The Stanford study’s most useful secondary finding was that the participants who trusted the AI less, who pushed back and re-prompted and stayed skeptical, produced more secure code than the ones who accepted the first answer.1 Skepticism was the variable, not a sharper prompt. The structural fix for solo shipping is a different reader: someone working in a different mode, who did not write the code and has no stake in it being finished. You cannot prompt your way to that. You have to get the review from somewhere the code did not come from.

We split the wider version of this argument into who should keep vibe coding and who needs help in the great divide piece, and the practical “when do I bring someone in” question in vibe coding to market. The short version: the floor is yours to handle. The ceiling needs someone who is not the author.

What To Actually Do If You’re Shipping

Run the five prompts. Today, before anything else, before you read another paragraph of anything. They are the difference between reckless and merely fast, and most of what gets early-stage apps into trouble is the boring stuff those prompts catch, not elite attackers.

Then be honest about the three blind spots. They are not a reason to stop vibe coding. We are bullish on people building, and the entire reason lilAgents exists is to make that building safe to own rather than something you rent back from an agency forever. The blind spots are a reason to get one independent pass before real users and real data are on the line. Not a rewrite, just a read by someone who did not write it, looking for the things that look finished but are not. The same pattern shows up at enterprise scale in our research on how the Fortune 500 scores on agent readiness: the failures are rarely exotic, they are overlooked.

That independent read is what ERA is. We take the code an AI wrote, review it the way an attacker would read it instead of the way the model that wrote it does, and hand back a prioritized list you own outright. No lock-in, no dependency on us to keep it running. You shipped it. We just make sure it is actually safe to have shipped.


Frequently Asked Questions

What is vibe coding security?

Vibe coding security is the practice of checking an AI-generated application for the vulnerabilities, leaked credentials, and compliance gaps that get introduced when you build by describing what you want rather than writing the code yourself. It matters because the tools that make building this fast also make it easy to ship problems you cannot see, and research shows people using AI assistants write less secure code while feeling more confident it is secure.

Can I just ask my AI to make my app secure?

You can, and you should, because a well-phrased security prompt fixes a lot of obvious gaps in minutes. The limit is that the model reviewing the code is the same one that wrote it, with the same blind spots, so it reliably catches the issues it knows to look for and reliably misses the ones it introduced by deciding the code was finished. Prompts handle the floor. They do not replace an independent review.

What are the most common vibe coding security risks?

The ones we see most often are API keys exposed in frontend code, hardcoded secrets committed to the repository, missing security headers, no rate limiting on expensive endpoints, and missing privacy or data-handling compliance. None of these are advanced attacks. They are routine misses that become expensive the moment real users or an automated scanner hit the app.

Is vibe-coded code less secure than hand-written code?

A controlled Stanford study found participants with an AI assistant wrote significantly less secure code than those without one, and were also more likely to believe their code was secure. The code is not doomed, but the overconfidence is the real hazard. The same study found that staying skeptical and re-prompting produced more secure results, which is a posture, not a feature you can turn on.

Do I need a security audit before launching a small app?

If the app touches user data, takes payments, or calls a paid API, yes, at least a light one. You do not need an enterprise penetration test for an MVP, but you do need the five prompts in this post run and verified, plus one read from someone who did not write the code. The cost of skipping that is almost always higher than the cost of doing it, because the failures compound silently until a real user finds them.

What does ERA check that a security prompt doesn’t?

ERA is an independent review. It catches two AI-specific failures that static analysis can prove and a security prompt usually misses: errors that were silenced rather than fixed, and secrets inlined mid-session to make something compile. Neither assumes anything about how you built the app. The broader value is the independence itself, because the model that wrote the code cannot reliably tell you the code is wrong. You can see how ERA works here. Prompts are still worth running. A reader who did not write the code simply sees what the author cannot.


Footnotes

  1. Perry, Srivastava, Kumar, and Boneh (Stanford), Do Users Write More Insecure Code with AI Assistants?, ACM CCS 2023. Participants with an AI assistant wrote significantly less secure code and were more likely to believe it was secure; skepticism toward the tool correlated with better outcomes. Do Users Write More Insecure Code with AI Assistants? (arXiv) 2

  2. OWASP Foundation, OWASP Top 10 Web Application Security Risks, the industry-standard consensus list of the most critical web application security risks. OWASP Top 10 (official project page)

  3. GitGuardian, The State of Secrets Sprawl 2026. 28.65 million new hardcoded secrets were added to public GitHub in 2025 (a 34 percent year-over-year increase); AI-assisted code showed an elevated secret-leak rate and AI-service secret leaks rose 81 percent year over year. The State of Secrets Sprawl 2026 (GitGuardian) 2

lilAgents tagline: AI-powered digital marketing agency
Decorative geometric pattern background for lilAgents website