Blog 6 min read

Vibe coding security checklist: 7 flaws to fix before production

Built your product with Cursor, Lovable, Bolt or Claude Code? The 7 security flaws to look for before production, and how to spot and fix each.

By Ayena TCHIKPE, founder and software engineer Published

In this article
  1. What the studies say about AI-generated code security
  2. The 7 vibe coding flaws to check before production
  3. A one-afternoon self-audit checklist
  4. How we work with AI agents at aycode
  5. What to do next

In short

  • An app that works in a demo is not an app that is ready for production. AI tools quickly write code that works, not code that holds up.
  • The worst flaws are often the simplest. A secret key in the browser, a database open to everyone, a payment confirmed by the client.
  • One afternoon is enough for a first audit. The checklist in this article tells you what to check and how.

You built your product with Cursor, Lovable, Bolt, Replit or Claude Code, and the app works. Once real customers trust it with data or money, the question is whether your vibe coding holds up against someone hunting for flaws. This vibe coding security checklist covers the 7 flaws we look for first before production, and how to spot and fix each.

As of 8 November 2026. This does not replace a penetration test for an app that handles sensitive data or money.

What the studies say about AI-generated code security

Veracode gave 80 security-sensitive tasks to more than 100 models. According to its press release of 30 July 2025, the code introduced a flaw in 45% of cases, and failed against cross-site scripting 86% of the time. These were targeted tasks, not all AI-written code.

CodeRabbit, which sells code review, compared 320 AI co-written and 150 human pull requests. According to its report of 17 December 2025, the AI ones had about 1.7 times more issues, and security issues up to 2.74 times more often.

Spracklen et al. (USENIX Security 2025) found that at least 5.2% of packages recommended by commercial models, and 21.7% by open source ones, do not exist.

Our reading: AI makes the classic mistakes from the OWASP Top 10 2025 (broken access control, misconfiguration, supply chain, injection), more often, with a confidence that hides them.

The 7 vibe coding flaws to check before production

1. Secrets in the browser or the repository

The agent's shortest path for a key: the frontend, or a committed .env file. Anything shipped to the browser is public.

Spot it. Search the built JavaScript and the whole git history (git log -p) for sk_, service_role, AIza, secret.

Fix it. Secret keys live on the server. A leaked key gets revoked and replaced; deleting it from the code is not enough. Supabase's documentation says only the publishable key goes in the browser, never the secret key, which bypasses every access rule.

2. An open database: missing RLS rules

With Supabase or Firebase, the browser talks to the database directly; access rules (Row Level Security in Supabase) are the only barrier. Supabase's documentation states that an exposed table without RLS can be read and changed by any role with access.

According to researcher Matt Palmer (statement of 29 May 2025), his team found 303 vulnerable endpoints in 170 of 1,645 Lovable showcase apps, exposing emails, phone numbers, payment details and API keys. On one they wrote "payment_status": "paid" to mark a subscription paid without paying. The flaw is CVE-2025-48757; Lovable disputes it, saying each customer is responsible for their app's data.

Spot it. In the Supabase SQL editor:

select tablename, rowsecurity from pg_tables where schemaname = 'public';

Any false row is an open table. Then call the API with only the public key, and as account A asking for account B's data. A rule existing is not enough: Palmer faults Lovable's scanner for checking only that.

Fix it. Enable RLS on every table and tie each row to its owner (auth.uid()). Payment status, role and balance are written by the server only, from the payment provider's confirmation.

3. No server-side validation

Form checks run in the browser; attackers call your API directly with negative quantities, edited prices or injected script.

Spot it. Look for concatenated SQL and raw HTML rendering (innerHTML, {@html}, dangerouslySetInnerHTML). Replay an API call with an edited price.

Fix it. Every server entry point revalidates with a schema (Zod, Valibot). Prices are recalculated on the server. Parameterised queries, always.

4. Dubious or invented dependencies

An invented package that fails to install is harmless; one that an attacker has already published is not.

Spot it. Check each unfamiliar dependency's npm or PyPI page (age, publisher, downloads) and run npm audit.

Fix it. Remove what is unused, commit the lockfile. Our advice: automate updates, but make each new version wait several days, long enough for a poisoned release to be reported.

5. No tests, no continuous integration

Nobody knows what a change breaks, and a stuck agent disables the failing test.

Spot it. Do tests run on every pull request and block the merge? Search for skip, xit, @ts-ignore and disabled lint rules.

Fix it. Test login, payment and cross-account access first. Then CI that blocks the merge until lint, types and tests pass.

6. No tested backup, one database for everything

In July 2025, according to Fortune, the Replit agent used by SaaStr founder Jason Lemkin deleted a production database during a code freeze. The agent claimed a restore was impossible; Lemkin recovered the data by hand. Replit then announced automatic separation of development and production databases.

Fix it. A separate development database without customer data. Automatic backups, restored at least once. Migrations applied by CI. No agent access to production credentials.

7. No rate limits, leaky errors, no logs

Without limits, a script can loop on your SMS or AI calls and you get the bill; OWASP calls this "Unbounded Consumption" (LLM10, 2025). Raw errors reveal your structure, and without logs a customer reports the incident.

Fix it. Limits per IP and account on login, SMS, AI calls and payments. A spending cap per API provider. Simple error messages, details in logs, alerts when errors rise, no secrets or phone numbers logged.

A one-afternoon self-audit checklist

Sit down with whoever knows the code best.

Check How Flaw
No secret in browser code or git history Search the build and git log -p; revoke leaks 1
RLS enabled on every table pg_tables query above 2
One account cannot see another's data Two accounts, then the public key alone 2
Payment status written on the server only Try changing it from the browser 2
Server revalidates input and recalculates prices Replay a call with an edited price 3
No unknown dependency without a reason npm/PyPI page, npm audit 4
Tests block the merge Push a deliberately failing test 5
A backup has been restored Restore to a test database 6
Development and production separated Check each environment's credentials 6
Rate limits on login, SMS, AI calls 50 calls in a row 7
Clean errors, details in logs Trigger an error 7

If more than two lines stay unchecked, we advise against opening the app to the public. The first four (exposed secret, open database, editable payment) are each a blocker on their own.

How we work with AI agents at aycode

We rely on checks agents cannot get past. Every change, human or agent, passes lint, types and tests before it merges.

We built aycod, an open source tool between the agent and the repository. It refuses shortcuts (direct pushes to main, bypassed git hooks, reading secrets, tests disabled without the owner's written justification) and blocks commits until checks are green. It works with Claude Code, Codex CLI, Copilot CLI and CI.

For the checks themselves, we set up CI/CD pipelines that scan secrets, code, dependencies and images on every change.

What to do next

AI coding saved you months. Do not lose them in one night to an open table or a forgotten key.

We audit and secure apps built with AI agents, then install the guardrails that frame those agents in your repository. Email us what your app does, which tool built it and what it handles (accounts, payments, personal data); we will reply with what to check first.


Sources (as of 8 November 2026): Veracode, press release on the 2025 GenAI Code Security Report (30 July 2025) · CodeRabbit, State of AI vs Human Code Generation Report (17 December 2025) · Spracklen et al., "We Have a Package for You!", USENIX Security 2025 · Matt Palmer, statement on CVE-2025-48757 (29 May 2025) · CVE-2025-48757 record (CVE.org) · Supabase, Row Level Security documentation · Fortune, "AI coding tool Replit wiped database" (23 July 2025) · OWASP Top 10:2025 · OWASP Top 10 for LLM Applications 2025.

Go from reading to building.

You now know what matters. Tell us what you want to build: the assessment is free, with no commitment.

Get my free assessment

What we have built

Read next

  1. 2 December 2026 · 6 min read LLM model deprecation migration: a one-week plan for your AI features
  2. 1 December 2026 · 6 min read MCP server security: how to vet the servers your AI agents install
  3. 8 November 2026 · 12 min read AI coding agents in production: a guardrails checklist for 2026
← All articles