1. Home
  2. Secure code review
  3. Vibe coding security checklist

Vibe coding security checklist: what to check before you launch

You built an app with an AI tool and it works. Before real users sign up, check these seven things: secrets, access rules, server-side permissions, input handling, dependencies, security headers and rate limits.

This checklist is for founders who built an app with an AI tool and want to know what to check before real users arrive. Each item takes minutes to verify. If you would rather hand it to a person, ask about a code review.

Why bother? One study from Carnegie Mellon found that roughly 10.5% of AI-generated code passes a security review. AI code also carries roughly 2.74 times more vulnerabilities than human-written code. The list below follows the OWASP Top 10, the standard list of web application risks, in plain steps.

1. Secrets: hardcoded keys and exposed API keys

The most common finding in AI-built apps is a key pasted straight into the code. If the repository is public, or the key ships to the browser, anyone can use it and bill you for it.

  • Search your code for strings that start with sk_, pk_live, AKIA, eyJ or the word secret.
  • Move every secret into environment variables. Add .env to .gitignore.
  • Check your git history too. Deleting a key from the latest commit does not remove it from older ones.
  • Rotate any key that was ever committed. Assume it leaked.
git log -p --all -S "sk_live" | head -50
echo ".env" >> .gitignore

2. Authentication and missing authorization

Authentication asks "who are you?". Authorization asks "are you allowed to do this?". AI code often does the first and forgets the second, which security people call broken authentication and missing authorization.

  • Every API route that returns or changes data must check the session on the server. A hidden button in the interface is not a check.
  • Check ownership, not just login. Changing an ID in the URL must not show another customer's order.
  • Admin endpoints need their own role check.
// every handler, before it touches data
const user = await requireUser(req)
if (!user) return deny(401)
if (order.ownerId !== user.id) return deny(403)

3. Database access: row-level security

If you use Supabase or a similar backend, the database is often reachable straight from the browser. Row-level security (RLS) is the rule set that decides who can read and write each row. With RLS off, anyone with your public key can read the whole table. We cover this in detail in Supabase RLS and common AI-code mistakes.

  • Enable RLS on every table that holds user data.
  • Write a policy for each action you allow, such as "users read only their own rows".
  • Keep the service-role key on the server only. It bypasses RLS, so it must never appear in client code.

4. Input validation and SQL injection

Never trust anything that comes from a form, a URL or an API call. SQL injection happens when user input is glued into a database query as text.

  • Use parameterised queries or your ORM's query builder. Never build SQL with string concatenation.
  • Validate type, length and format on the server, even if the form already checks it.

5. Dependencies and hallucinated packages

AI tools sometimes recommend packages that do not exist. Attackers register those names and fill them with malware, a trick called slopsquatting.

  • For each package in your manifest, confirm it exists, has real downloads and a known maintainer.
  • Watch for names that are one letter off a popular library.
  • Commit your lockfile and run npm audit or the equivalent for your language.

6. Security headers and HTTPS

Security headers tell the browser how to protect your visitors. They cost nothing and block whole classes of attack.

Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
X-Frame-Options: DENY

Serve everything over HTTPS. Set CORS to your own domain, not a wildcard, on any endpoint that uses cookies or tokens.

7. Rate limiting, errors and abuse

Without limits, a script can try thousands of passwords or run up your bills. Rate-limit login, signup, password reset and any endpoint that calls a paid service. If your app passes user text to a language model, treat that text as untrusted. Prompt injection can make the model ignore your instructions or leak data it can reach, so give the model only the access it needs. Turn off debug mode in production and never log passwords or tokens.

Got through the list and still unsure? A paid code review checks the secrets, dependency and configuration items for you and tells you in plain language what to fix first. Reviews start from 500 euro (indicative).

Ask about a code review

What a checklist cannot do

A checklist finds common mistakes. It misses the ones specific to your app, such as a discount code that works twice or an endpoint that trusts the price sent by the browser. Those need a senior engineer reading your code. That is the gap our code review service fills. For anything that handles money or personal data, consider a pre-launch security audit.

Common questions

How do I secure a vibe-coded app before launch?

Remove secrets from your code, turn on access rules in your database, check permissions on the server for every request, validate input, verify your dependencies, add security headers and rate limits, and have a person review the result. The checklist on this page walks through each step.

Is AI-generated code safe to put in production?

Not without review. AI tools write code that works, but they often skip security details such as authorization checks and input validation. One widely cited study from Carnegie Mellon found roughly 10.5% of AI-generated code passes a security review.

What are the most common security mistakes in AI-built apps?

Hardcoded secrets and exposed API keys, database tables with no row-level security, pages that check permissions only in the browser, unvalidated input that allows SQL injection, and dependencies the AI invented or never checked.

Can a scanner replace a manual security review?

A scanner catches known patterns such as leaked keys and outdated packages. It cannot judge your business rules, such as who is allowed to see which order. That needs a person who reads the code.