You shipped a working app in a weekend using AI. The demo looks great, users are signing up, and then someone dumps your entire database because the AI left an unprotected API endpoint wide open. This is not a hypothetical scenario. It happens every week to vibe-coded apps that skipped security basics. This checklist gives you a concrete, step-by-step way to lock down your production app before that happens to you.

Photo by Pixabay from Pexels

TL;DR:
  • AI-generated code ships fast but frequently contains exploitable vulnerabilities like SQL injection, broken auth, and exposed secrets.
  • A structured security checklist catches the most common flaws before they reach production.
  • You do not need a security degree to apply these steps. You need a repeatable process and the right tools.

The security gap in AI-generated code

Speed is the whole point of vibe coding. You describe what you want, the AI writes it, and you ship. But that speed creates a blind spot. AI models optimize for "code that works," not "code that is secure." They pull patterns from training data that includes millions of insecure examples right alongside the good ones.

0%
AI-Generated Programs With Exploitable Vulnerabilities

That number is not a guess. Researchers tested thousands of AI-generated programs and found a consistent pattern: the code compiles, it runs, it passes basic tests, and it contains security holes that an attacker can find in minutes.

"Academic researchers who tested 1,689 AI-generated programs found that roughly 40% contained exploitable vulnerabilities, many mapping to the CWE Top 25."
>, Vibe Coding Security: Risks and Tools

If you are building something that handles user data, processes payments, or stores anything sensitive, ignoring this reality is not an option.

Common mistakes that get apps hacked

person learning to code
Photo by Jakub Zerdzicki from Pexels

Most security failures in vibe-coded apps fall into a handful of categories. Knowing them saves you from learning the hard way.

Hardcoded secrets

AI assistants love to put API keys, database passwords, and JWT secrets directly into source files. They do this because it makes the code "work" immediately. The moment you push that to a public GitHub repo, bots scrape it within seconds. AWS keys exposed this way have led to five-figure cloud bills overnight.

Missing input validation

SQL injection and cross-site scripting (XSS) remain the top two web vulnerabilities for a reason. AI-generated code often trusts user input completely. A form field that accepts a name also accepts '; DROP TABLE users;-- if nobody validates it.

Broken authentication

The AI might scaffold a login system that stores passwords in plain text, skips rate limiting, or uses predictable session tokens. Each of these is a direct path to account takeover.

Overly permissive CORS and API access

AI-generated backends frequently set Access-Control-Allow-Origin: and expose every route without authentication checks. This turns your API into a public buffet for anyone with curl.

Vibe-Coded Apps Missing Basic Auth Checks on API Routes
0%

No dependency auditing

Your AI assistant picks npm packages, pip libraries, or Go modules based on popularity in its training data. Some of those packages have known CVEs. Without running npm audit or pip-audit, you inherit every vulnerability in your dependency tree.

Warning: If your AI tool added a dependency you have never heard of, check it before deploying. Typosquatting attacks target exactly this pattern.

Step-by-step security process

developers collaborating
Photo by Christina Morillo from Pexels

Here is the process that catches the majority of security issues before they reach production. Each step is something you can do today, without hiring a penetration tester.

Vibe Coding Security: Checklist for Production Apps process
Figure 1: Vibe Coding Security: Checklist for Production Apps at a glance.

The diagram breaks the process into five stages: Scan Secrets, Validate Inputs, Lock Auth, Audit Deps, and Test Routes. Work through them in order.

1. Scan for secrets

Run a secret scanner across your entire codebase before every deploy. Tools like gitleaks, truffleHog, or GitHub's built-in secret scanning catch API keys, tokens, and passwords that slipped into your source.

Move every secret to environment variables or a secrets manager like AWS Secrets Manager, Doppler, or even a .env file that is properly .gitignored.

2. Validate every input

Add server-side validation to every endpoint that accepts user data. Libraries like Zod (TypeScript), Pydantic (Python), or joi (Node.js) make this straightforward. Define the shape of expected input, reject everything else.

Never rely on client-side validation alone. An attacker bypasses your frontend in one line of JavaScript.

3. Lock down authentication

  • Hash passwords with bcrypt or argon2. Never MD5, never SHA-256 without salt.
  • Add rate limiting to login endpoints. Five failed attempts, then a cooldown.
  • Use HTTP-only, secure cookies for session tokens. Not localStorage.
  • Implement CSRF protection on every state-changing request.

4. Audit dependencies

Run npm audit, pip-audit, or cargo audit as part of your CI pipeline. Tools like Snyk and Dependabot automate this and open PRs when fixes are available.

Remove unused dependencies. Every package you do not need is attack surface you do not need.

5. Test your routes

Use a tool like OWASP ZAP or Burp Suite Community Edition to crawl your app and flag common vulnerabilities. Even a basic scan catches open redirects, missing security headers, and exposed debug endpoints.

Manually test your API with unauthenticated requests. If you can access /admin, /api/users, or /debug without a valid token, fix it immediately.

Key takeaway: AI writes code that works. Your job is to make sure it works safely. A 30-minute security pass using this checklist catches the vulnerabilities that lead to real breaches.

Tools and workflows that help

startup team programming
Photo by Mikhail Nilov from Pexels

You do not need to memorize every vulnerability class. The right tools automate the boring parts so you can focus on building.

The following dashboard shows a realistic snapshot of what a security scan looks like for a typical vibe-coded app before and after applying this checklist.

Security Scan: Before vs. After Checklist

Before After
Exposed Secrets
7 0
SQL Injection Points
4 0
Missing Auth on Routes
12 1
Vulnerable Dependencies
9 0
Missing Security Headers
5 0
Manual Security ReviewAutomated + Checklist Approach
Hours per deployMinutes per deploy
Relies on memoryRepeatable every time
Misses dependency CVEsCatches them automatically
Skips secret scanningRuns on every commit
No baseline metricsTracks improvement over time

Here is a quick stack that covers the essentials:

  • Secret scanning: gitleaks (free, runs in CI)
  • Dependency auditing: Snyk or Dependabot (free tier available)
  • Input validation: Zod, Pydantic, or joi (language-specific)
  • Vulnerability scanning: OWASP ZAP (free, open source)
  • Security headers: helmet.js (Express), django-security-middleware, or Cloudflare settings
  • Auth framework: NextAuth.js, Supabase Auth, or Auth0 (avoid rolling your own)
Pro tip: Add npm audit --audit-level=high or equivalent to your CI pipeline as a blocking step. If it fails, the deploy stops. This single change prevents most dependency-related vulnerabilities from reaching production.
Issues Caught by Automated Scanning Before Deploy
0%
|

The production security checklist

This is the checklist you print, pin to your monitor, and run through before every deploy. Each item takes minutes, not hours.

Vibe Coding Security Checklist for Production Apps

)

Your progress is saved automatically in your browser.

The Vibe Coding Bible at vibecodingbible.org covers each of these items in depth, with code examples for multiple frameworks and languages. If you want the full playbook for shipping AI-built apps that hold up under real traffic and real attackers, it is worth the read.

FAQ

Frequently Asked Questions

Anyone shipping an app built with AI assistance. Whether you used Cursor, Claude, Copilot, Lovable, or v0 to generate your code, the same vulnerability patterns show up. You do not need a security background to follow this checklist. Each item is a concrete action, not a theoretical concept.
For a typical small-to-medium app, expect 30 to 90 minutes on your first pass. Most of that time goes to moving hardcoded secrets and adding input validation. After the first pass, subsequent runs take 10 to 15 minutes because the tooling is already configured and you are just verifying nothing new slipped in.
Run a secret scanner. Exposed API keys and database credentials are the single fastest path to a breach, and they are the easiest to fix. Install gitleaks, run it once, and move every secret it finds to environment variables. That one action eliminates the most common and most damaging vulnerability class in vibe-coded apps.
Asking the AI to "make it secure" helps, but it is not reliable. The AI might add some validation or use parameterized queries in one place and miss it in another. Treat AI-generated security code the same way you treat AI-generated business logic: verify it with automated tools and manual review. Trust but verify is the only approach that works.
A full professional pentest is overkill for most early-stage apps. Running OWASP ZAP against your staging environment gives you 80% of the value at zero cost. Save the professional pentest for when you are handling significant user data or processing payments at scale.

What is the first security issue you found in your own AI-generated code? Share it below so others can learn from the same mistake.

Additional Resources