vibe coding security

Vibe coding security: the AI wrote your app, not its defenses

TL;DR: vibe coding security is the part the AI skips unless you tell it not to. When you describe an app in plain language and let AI write the code, it builds exactly what you asked for and nothing you didn’t. Ask for a login page, you get a login page. You do not get tenant separation, encrypted credentials, or locked-down access unless you say those words out loud. AI defaults to functionality over security, every time. So the safety of a vibe-coded app is a choice you make, not a thing that happens for you. Below is what that looks like in practice, including the three decisions we locked down before the first prompt of PayAudit, the affiliate tool I built this way.

Here’s the uncomfortable part nobody says out loud.

You can describe an app to an AI, watch it write working code in an afternoon, click around, and feel like you shipped something real. And you did. It works. It logs people in, it saves their data, it does the thing.

But “it works” and “it’s safe” are not the same sentence. A tool can do everything you asked and still be one bad afternoon away from leaking every customer it has.

That gap is where most vibe-coded apps live. Not because the people building them are careless. Because the AI is quietly optimizing for the wrong thing, and nobody told them.

What is vibe coding security, and why does it matter?

Quick definition first, because the term is new enough that it’s worth being precise.

Vibe coding is building software by describing what you want in plain language and letting an AI write the actual code. You talk, it types. Andrej Karpathy, an OpenAI co-founder, coined the phrase in early 2025, and by that November “vibe coding” was Collins Dictionary’s word of the year. It went from a niche habit to how a real chunk of new software gets made, fast.

Vibe coding security is the practice of making sure the app that AI builds for you is actually safe to put in front of real users. Safe means their data is walled off, their logins can’t be bypassed, and their sensitive information isn’t sitting somewhere anyone could reach it.

Here’s why it matters more than it sounds like it should. When a developer writes insecure code, at least a developer wrote it, someone who has seen a breach and flinches at the memory. When AI writes it, the code looks clean, reads confidently, and runs on the first try. The confidence is the trap. It feels finished when it’s only functional.

And the scale is real. Veracode tested more than 100 AI models writing code and found that 45% of the samples failed security tests, introducing the kind of common flaws that land on the OWASP Top 10. Not exotic bugs. The basics. Almost half the time.

If you’re building anything that touches customer data, that number should stop you for a second. It’s not a reason to avoid vibe coding. It’s a reason to do it with your eyes open.

Why doesn’t AI write secure code on its own?

Because you didn’t ask it to, and it takes your silence as a spec.

That’s the whole mechanism, and it’s worth sitting with. An AI model builds what you describe. If you say “let users log in and see their orders,” it will build exactly that. It will not add tenant separation, or encrypt the stored passwords properly, or check that user A can’t just change a number in the web address and read user B’s orders. Not because it can’t. Because you didn’t say so, and it has no instinct that says “wait, this touches real people’s data, better lock it down.”

A human developer who has lived through a breach carries that instinct in their gut. The AI carries none of it. It learned from mountains of code on the internet, including plenty of insecure code, and it never developed the flinch. It’s optimized for output that runs and looks right, not output that holds up when someone’s actively trying to break it.

The data backs this up in a way that should get your attention. When the Cloud Security Alliance and Georgia Tech looked at real-world damage, their Vibe Security Radar project traced 35 publicly filed security vulnerabilities in a single month, March 2026, directly back to AI coding tools. That was up from 6 in January. Nearly six times more in two months, and the researchers say that’s the floor, not the ceiling, because most AI-written flaws never get a public number at all.

Separately, security firm Apiiro found that developers using AI shipped code three to four times faster but introduced security problems at ten times the rate. Faster and leakier, at the same time. That’s the trade you’re quietly making if nobody’s watching the security side.

None of this means the tools are bad. It means the tools do what you tell them, and security only happens if you tell them. If any of this is making you eye your own app a little nervously, we’re happy to take a look and tell you straight where it stands.

What did we get right before the first PayAudit prompt?

Let me make this concrete with a real build, because I did this myself and the stakes were real money.

We took over the affiliate program for a soccer apparel brand, and once we got into the account we found a year of commissions paid out on orders that had been refunded or canceled. Real money, gone, every month, because nobody was checking. I went looking for a tool that would catch it automatically. Nothing existed that did the job. So I built one, by vibe coding, and it became PayAudit.

Here’s what mattered. PayAudit handles the touchy stuff: commission amounts, order values, and the login credentials that connect to a brand’s affiliate network and their Shopify store. If that leaks, it’s not an embarrassment, it’s a disaster. So before I wrote a single prompt, I made three decisions and refused to move until they were settled.

I didn’t write any code to make those decisions. I wrote sentences. That’s the part people miss about vibe coding security. The foundation isn’t technical skill. It’s deciding what you want and saying it clearly, before the AI fills the silence with its own defaults.

Those three decisions are the same three that determine whether any vibe-coded app grows up or gets replaced. So let’s name them.

What are the three decisions that determine vibe coding security?

If you build a real app this way, get these three right before the first prompt. They’re brutally hard to change later, and easy to set now.

  1. How you separate different customers (multi-tenant architecture). If more than one client or company will use your app, their data has to be walled off from each other from the very first line of code. In PayAudit, every brand or agency gets its own isolated database, tracked by a separate control database that keeps them straight. No client’s data ever shares a table with another’s. That’s stricter than most builds, and it means one customer’s records are never one typo away from showing up in someone else’s screen.
  2. How people prove who they are (authentication). This is the lock on the front door, and it cannot be an afterthought. We built authentication first, using OAuth, the same delegated sign-in standard the big platforms use, plus secure session handling. Each brand or agency logs into its own space and can reach only its own data. Bolting a lock on after the house is built is always messier than framing it in from the start.
  3. How your core data is structured (the data model). This is the shape of the information at the center of the app. For PayAudit, that’s the match between each affiliate transaction and the real outcome of its Shopify order: shipped, refunded, canceled. I decided that core structure deliberately before the first build session. The details around it grew with real use, but the spine was set on purpose. Reality is the best database architect you’ll ever have, but only after you give it a spine to correct.

Notice what all three have in common. Not one of them is about code. They’re about clarity. You decide, you describe, the AI builds, you verify. That loop is the actual skill.

If you’re weighing whether to build something like this instead of buying yet another subscription, that decision deserves its own honest look. Tell us what you’re trying to solve and we’ll tell you whether building it is smart or whether an off-the-shelf tool wins.

What are the most common vibe coding security mistakes?

Most of the trouble comes from a short list of the same misses, over and over. Watch for these:

  • Treating “it works” as “it’s done.” The demo runs, so it ships. But working is the floor. Safe is a separate job, and it doesn’t announce itself.
  • Adding authentication last. Building all the features first and stapling a login on at the end. That order bakes in weak spots that are painful to unwind.
  • Skipping tenant separation. Letting every customer’s data share one big table and hoping a filter keeps them apart. One missed filter and everyone can see everyone.
  • Storing secrets in plain sight. Saving passwords, API keys, or credentials without proper encryption. AI will happily do this if you don’t specify otherwise.
  • Trusting the AI’s confidence. Nearly 80% of developers believe AI writes more secure code than humans do, which the research flatly contradicts. The false confidence is its own vulnerability.
  • Never getting a second set of eyes. Shipping code that touches real customer data without anyone reviewing the security side.

None of these are exotic. They’re all predictable, and they’re all preventable if you know to look. That’s the good news buried in the scary stats: these aren’t clever attacks, they’re open doors nobody thought to close.

How do you specify security so the AI actually builds it?

You say it out loud, in the plainest language you’ve got, before and during the build. Here’s the working order.

Step 1: Decide what kind of data your app touches

Before anything else, answer one question: does this app hold anything sensitive? Names, emails, payments, credentials, anything private? The honest answer sets how much security the build needs. Skipping this question is how breaches start, because you can’t protect what you never admitted was valuable.

Step 2: Write the security requirements into your instructions

Give the AI a standing set of rules it follows in every session. State plainly that customers must be separated, that logins use a proven standard, that stored credentials get encrypted, that users can only reach their own data. You don’t need to know how any of it works under the hood. You need to name what you want. Describe the outcome, and let the AI handle the plumbing.

Step 3: Build authentication and separation first

Do the front door and the walls before the furniture. Get logins and customer separation working and verified before you build the fun features on top. This order is annoying because it delays the exciting part, but it’s the difference between a foundation and a guess.

Step 4: Verify what the AI built, don’t assume

After the AI writes it, check that it did what you asked. Try to reach data you shouldn’t be able to reach. Change a number in the web address and see if it coughs up someone else’s record. You’re not writing the security code. You’re confirming it exists and holds.

Step 5: Get a real security review before real users

For anything touching customer data, have someone who knows security actually look at it before you launch. A trained reviewer catches most of the common flaws in one pass. This step is not optional, and it’s a lot cheaper than the breach it prevents.

How do you know if your vibe-coded app is safe to ship?

Quick gut check. If you can’t confidently answer these, you’re not ready to put real users on it:

  • Can one customer, by fiddling with the web address, reach another customer’s data?
  • Are passwords and credentials encrypted, not stored in plain text?
  • Was authentication built early and tested, or bolted on at the end?
  • Did you actually write your software security requirements into the AI’s instructions, or just hope?
  • Has anyone who understands application security reviewed it?

If those questions make you wince, that’s useful information, not a verdict. It just means the security layer needs a real pass before launch, and that’s a fixable, scoped piece of work, not a rebuild.

What you should do now

You don’t have to be a security expert to build safely this way. You have to be specific.

This week, if you’ve got a vibe-coded app running or in progress, do one thing: try to break into your own data. Log in as yourself, then see if you can reach a record that isn’t yours by changing a number somewhere. If you can, so can anyone else, and now you know where to start.

Then go read your own build instructions. Is there a single line in there about security, separation, or encryption? If not, that’s the gap. Add it, and rebuild the parts that touch sensitive data with those rules in place.

And if the app handles real customer data or real money, get a security review before you let anyone in. That’s the one corner not worth cutting.

Vibe coding security isn’t a wall between you and building your own tools. I built PayAudit this way, on about $40 a month of infrastructure, with no developers, and it handles real financial data for real clients. It’s safe because I decided it would be and said so, not because the AI volunteered. That choice is available to anyone. You just have to make it out loud.

If you want a hand pressure-testing something you’ve built, get in touch and we’ll tell you where it actually stands.


FAQ

What is vibe coding security? Vibe coding security is the practice of making sure an app built by AI is safe for real users. When you describe software in plain language and let AI write the code, it builds the features you asked for but skips protections you didn’t name, like customer separation, encrypted credentials, and locked-down access. Vibe coding security means specifying and verifying those protections on purpose, because the AI won’t add them on its own.

Is code written by AI secure by default? No. AI writes code that runs and looks correct, but it prioritizes functionality over security unless you tell it otherwise. Veracode tested over 100 AI models and found 45% of the code samples failed security tests and introduced common OWASP Top 10 vulnerabilities. The AI isn’t malicious, it just builds what you describe, and security only appears when you describe it.

Why does AI-generated code have so many security flaws? AI models learn from huge amounts of public code, including insecure examples, and they never develop the caution a human developer builds after seeing real breaches. They optimize for code that works, not code that resists attack. So unless the security requirements are written into the instructions, the AI leaves out protections a security-minded person would add automatically.

What are the three decisions to make before building a vibe-coded app? First, how you separate different customers, so one client’s data can never reach another’s. Second, how authentication works, built first, not bolted on. Third, how your core data is structured, decided deliberately at the start. These three are hard to change later, so getting them right before the first prompt is what separates an app that grows from one that has to be rebuilt.

Can a non-developer build a secure app with AI? Yes, but security has to be a conscious choice, not an assumption. You don’t need to write the security code yourself. You need to name your requirements clearly (separate customers, encrypt credentials, use standard authentication), verify the AI actually built them, and get a security review before real users touch it. The skill is clarity and verification, not coding.

How do I tell the AI to make my app secure? Write your security requirements into the AI’s standing instructions in plain language: customers must be separated, logins use a proven standard, stored credentials are encrypted, and users can only reach their own data. Then check that it did what you asked by trying to reach data you shouldn’t be able to. Describe the outcome you want and confirm it exists. The AI handles the technical details.

Do I really need a security review for a small app? If the app touches real customer data, payments, or credentials, yes. A trained reviewer catches most common flaws in a single pass, and that pass costs far less than a breach. For a purely internal tool with no sensitive data, the bar is lower, but the moment real people’s information is involved, a review stops being optional.


Keep reading: Building your own tool is one side of PayAudit. The problem it solves is the other. Here’s the leak that started it: why your affiliate program is probably paying commission on refunded orders.

About the Author

Mike Hakopyan is the founder of 7 Rock Marketing, a Shopify growth agency in Glendale, California, and the author of CLEAR: The E-Commerce Leader’s Guide to AI-Powered Marketing You Actually Own. As a Klaviyo Certified Partner, Mike and his team run email, SEO and ads for Shopify brands doing roughly $1M to $12M a year, inside accounts the brand owns. Before 7 Rock, he spent nearly two decades leading technology and infrastructure teams. He also builds software with AI, including PayAudit, which stops brands from paying affiliate commission on refunded orders.

Leave a Comment