Vibe coding security: how to ship fast with AI without shipping holes
Vibe coding gets a product live in days. Here is what usually breaks on the security side, and the minimum guardrails that keep the speed without the risk.
Vibe coding is safe enough for prototypes and risky for anything holding real user data or money, because the assistant optimises for a working demo. The usual gaps are exposed keys, missing authorisation, databases without row-level security, placeholder permission checks and unverified webhooks. Keep the speed, but add five guardrails: secret scanning, server-side authorisation, RLS on every table, webhook verification and a review pass before each release.
- A demo and a product differ mainly in who else can reach the data.
- Most vibe coding incidents come from five predictable gaps, not sophisticated attacks.
- Guardrails can be added in an afternoon and run automatically from then on.
Vibe coding works. Founders describe a feature, the assistant writes it, the app runs, and a product that would have taken a quarter ships in a fortnight. The trouble starts when the prototype quietly becomes the product, with real users, real data and a payment form.
The security gaps in vibe coded apps are remarkably consistent. They are not clever exploits. They are the parts of a feature that a demo does not need.
Why vibe coded apps leak
A demo has one user: the person building it. Every security control exists to handle a second person, someone who should not see or change what the first person can. When the assistant is asked to make the feature work, it makes it work for the person asking. Nothing in the prompt mentions the second person.
That is why the same five gaps appear again and again.
The five gaps
1. Keys in the wrong place (SEC-01, NX-01)
The assistant hits an error, the error says a key is missing, and the fastest fix is to paste the key or expose it to the browser. Look for secrets in committed files and for private keys behind public environment variable prefixes. Our guide to hard-coded secrets in AI code covers detection and rotation.
2. Authenticated but not authorised (SEC-02)
The app checks that a user is logged in. It does not check that this user owns the record they are asking for. Change an ID in a request and you see someone else's invoice. This is the most common serious finding in early-stage codebases.
3. Databases without row-level security (SEC-03)
Backend-as-a-service platforms are a gift to vibe coding, and a trap. If tables are reachable from the browser and row-level security is off, or the service role key is in client code, every user can read every row. See the Supabase security checklist.
4. Placeholders that shipped (AID-06)
isAdmin = () => true was there to unblock a screen. Nobody went back. Search for permission helpers that return constants, fake data behind flags and TODO comments near auth code.
5. Webhooks anyone can call (SEC-12)
Payment and subscription webhooks that skip signature verification let anyone mark an order as paid. The fix is a few lines from the provider's documentation, and assistants often leave them out.
Minimum guardrails that keep the speed
You do not need to slow down. You need checks that run without you.
- Secret scanning on every push, plus a one-time scan of history. Rotate anything it finds.
- One authorisation helper, used by every server entry point, that takes the user and the record and decides. Add a rule to your AI tool instructions that every handler must call it.
- RLS on by default for every table, with a test that an anonymous client cannot read anything.
- Webhook verification in a shared handler wrapper.
- A review pass before each release, against a short checklist such as the AI code review checklist.
When to bring in help
Bring in a second pair of eyes before any of these moments: the first paying customer, the first enterprise security questionnaire, the first fundraising data room. Each one is a point where a basic finding becomes expensive.
A nightly audit is one way to do it without hiring. Every new commit is checked against the patterns above, verified, and filed as an issue your assistant can fix the next morning.
Frequently asked questions
What is vibe coding?
Building software mainly by describing what you want to an AI assistant and accepting the generated code, with little line-by-line reading. It is fast and increasingly common in early-stage startups.
Is it safe to launch a vibe coded app?
It can be, once someone has checked the handful of places where generated code is usually unsafe: keys, authorisation, database policies, webhooks and dependencies.
Do I need a security engineer?
Not at the start. You need automated scanning and a regular review against a short checklist, plus someone accountable for acting on findings.
Want to know what your repo would show?
Send one public repo. We reply with three verified findings and the prompts to fix them. No call needed.