Security Guide

5 Security Mistakes Every Vibe Coder Makes (And How to Fix Them)

You just vibe-coded an app in 4 hours. Congrats. Somewhere, a bot just found your API key. Took it 6 minutes. This isn't scare tactics — it's what's actually happening to builders right now.

45% of AI code has vulnerabilities — Veracode 2025
20% of vibe-coded apps have serious flaws — Wiz
1

Hardcoded API keys in your source code

When you prompt your AI to "connect to Stripe" or "add my Supabase database," it often drops your credentials directly into the code. Then you push to GitHub. Bots scan every public commit for those patterns. They've found keys and drained accounts overnight.

🔧 Quick Fix

Use environment variables. Always. Add .env to your .gitignore immediately. Tell your AI: "Use environment variables for all sensitive configuration. Never hardcode secrets."

How Erzo Helps

Erzo's Secret Detection module scans your entire codebase for leaked API keys, tokens, and credentials — catching what you missed before attackers find it.

2

Zero input validation

AI-generated forms and search features almost never validate what a user types in. That's an open door for SQL injection and cross-site scripting — two of the oldest attacks in the book. Veracode found AI models failed to protect against XSS 86% of the time.

🔧 Quick Fix

Add this to every prompt: "Validate and sanitize all user inputs. Use parameterized queries for all database operations." Add Zod (TypeScript) or Pydantic (Python) from the start.

How Erzo Helps

Erzo's Code Analysis detects XSS, SQL injection, SSRF, and 50+ vulnerability patterns in AI-generated code.

3

Authentication that looks right but isn't

The AI builds a login form. Sessions work. Passwords save. Looks good. But did it put the auth checks on the server — or just in the browser where anyone can bypass them? Missing row-level security in Supabase means any user can read any other user's data.

🔧 Quick Fix

Don't let the AI roll auth from scratch. Use Supabase Auth, Clerk, or Auth0. Explicitly prompt: "Set up row-level security so users can only access their own data."

How Erzo Helps

Erzo's RLS Policy Checker verifies your Supabase row-level security policies are correctly configured — ensuring users can only access their own data.

4

Open configuration in production

CORS set to wildcard. Debug mode on. No rate limiting. No HTTPS enforcement. The app works perfectly on localhost. In production, an open CORS policy lets any malicious site make requests to your API.

🔧 Quick Fix

Before you go live, check those four things every single time: CORS restricted, debug off, HTTPS enforced, rate limiting on.

How Erzo Helps

Erzo's Header & Configuration scanner flags open CORS policies, missing security headers, and insecure production settings automatically.

5

Trusting AI-chosen dependencies blindly

Your AI picks packages based on training data that could be years old. It sometimes references packages with known vulnerabilities. Occasionally, it invents packages that don't exist — and attackers have started registering those fake names to deliver malicious code. Researchers call it "slopsquatting."

🔧 Quick Fix

Enable Dependabot (free, built into GitHub). Spot-check unfamiliar packages in your package.json before deploying.

How Erzo Helps

Erzo's Dependency Scanner finds packages with known CVEs and recommends secure replacements — all automated.

The Meta-Fix

Build security into your prompting workflow before you write a single line of code — not after.

  • Add a .cursorrules or claude.md file with security requirements baked in.
  • Ask the AI to audit itself: "Review this code for OWASP Top 10 vulnerabilities."
  • Run Semgrep + Trivy in a GitHub Actions pipeline ($0, 15 minutes to set up).
  • Or just use Erzo — we do all of this automatically.
Free Security Prompts

6 Copy-Paste Security Audit Prompts

Use these prompts with any AI coding tool (Cursor, Bolt, Lovable, Claude) to audit your vibe-coded app. Run them sequentially — each prompt's output feeds the next.

Pro Tip: Prompts 1–5 can be run in parallel if you're pressed for time, but Prompt 6 requires all five to be complete first. The .cursorrules / claude.md file produced in Prompt 6 is the most important long-term deliverable — drop it into every new project before you write a single line of code.

Or Skip the Manual Work Entirely

Erzo automates all 6 audit steps. Scan your app in seconds, get AI-powered fix 362: suggestions, and ship with confidence. 363: