AI Code Review for Vibe-Coded Apps: Who Reads the Code and Why
Founder & CTO, Buttercloud
You built the product by describing it. Cursor, Claude Code, Lovable or Bolt wrote the code, and most of that code works. Now there are customers in it, and the question that keeps coming up is a simple one: who actually reads this stuff?
Because somebody should. That is what AI code review means in practice: a human reading what the agent wrote before it reaches customers. Not because the model is bad at programming. Because nobody, human or machine, should push unreviewed changes to a system that holds other people’s data and money. Professional engineering teams landed on that rule decades ago, and it applies to vibe coding too: whoever writes the code does not get to be the only one who approves it.
This is the review loop that makes vibe coding safe rather than lucky. We cover the broader risks in our guide to vibe coding security and the pre-launch checks in the fourteen-point launch checklist. This article is about the ongoing part: every change, after launch, forever.
Agents generate, humans gate
The model fits on a sticky note. Agents generate. Humans gate.
The founder keeps building the way they build. What changes is that every set of changes becomes a pull request, and a pull request does not merge until a person who reads code for a living has read it and approved it. That person is not rewriting the code or second-guessing every line. They are checking a short list of things that AI tools get wrong in predictable ways and that a non-technical founder cannot be expected to spot.
Why bother? Because the data on AI-written code is clear and not improving on its own. Veracode’s 2025 GenAI Code Security Report gave more than 100 large language models a set of 80 code completion tasks where each task had a secure and an insecure way to finish the code. The models chose the insecure option 45 percent of the time. Java was the worst at over 70 percent; Python, C# and JavaScript ran between 38 and 45 percent. For cross-site scripting the models failed 86 percent of the time. And larger, newer models did not perform significantly better than smaller ones. Waiting for the next model release is not a security strategy.
This is not theoretical for vibe-coded apps. Escape.tech scanned more than 5,600 publicly deployed vibe-coded apps and found over 2,000 vulnerabilities and more than 400 exposed secrets. The Lovable row-level-security issue that became CVE-2025-48757 was the kind of thing a reviewer catches in thirty seconds and a scanner finds months later.
What a reviewer checks on an AI-written pull request
A good review of AI-written code is not a style review. Nobody cares what the variable is called. The reviewer is answering six questions, in roughly this order.
1. Who can reach this? Every new endpoint, query or page gets the same question: which user can call it, and what stops a different user from calling it with someone else’s ID? This is OWASP’s number one category for 2025, Broken Access Control, and it is where AI-built apps actually get breached. Models write the happy path. They rarely write the “and make sure it is your invoice” part unless told to, and founders rarely know to tell them.
2. What did it do to the database? Schema changes are the hardest thing to undo. A reviewer reads every migration: did it add a table without row-level security, did it make a column nullable that should not be, did it duplicate a concept that already exists under another name? Our row-level security guide covers the database side in detail; the review question is simply “did this change open a door?”
3. Is there a secret in here? Keys, tokens, webhook secrets, database URLs. AI tools will happily hard-code a key to make a demo work and never come back to move it. The reviewer searches the diff for anything that looks like a credential, including in test files and config, and anything found gets rotated, not just removed, because the history remembers.
4. What happens when the input is wrong? Every place user input reaches a query, a template, a shell command or a URL is checked. The model does not always get it wrong, but the 86 percent cross-site scripting failure rate above says checking is cheaper than being surprised.
5. If this touches money, is it verified? Any code near payments gets a slower read. The most common specific miss: a webhook handler that trusts the request body. Stripe’s own documentation is blunt about it: without verification an attacker can send fake events to trigger order fulfilment or grant account access. The handler must verify the Stripe-Signature header against the raw request body, reject stale timestamps, and ignore duplicate event IDs. Models frequently skip all three.
6. Can the next person change this? Does the change duplicate a function that already exists? Does it introduce a third way of handling errors? Did it add a dependency for something the standard library already does? None of these is a security bug today. All of them are technical debt that compounds, and the review is the only moment it is cheap to stop.
That is the whole review. On a typical vibe-coded pull request it takes a senior engineer ten to thirty minutes. The expensive version, where the engineer discovers that question two was never asked for the last four months, takes weeks.
The ten patterns we see most
These are the recurring shapes in AI-written code that come up in our review work. The same tool that produces them produces a lot of perfectly good code around them.
-
The missing ownership check. A query that fetches a record by ID and never checks whose record it is. The single most dangerous pattern on this list and the easiest to miss, because the feature works perfectly for the person testing it.
-
The service key in the client. The database’s admin credential, which bypasses every access rule, placed in frontend code because that is where the model was when it needed a connection to work.
-
The confident webhook. A payment or email webhook that parses the body and acts on it, with no signature verification, no replay protection and no idempotency.
-
Error handling that swallows the error.
try/catch/ do nothing, or return a 200 with an error message in the body. The app never crashes, which sounds good until you realise it also never tells you anything is wrong. -
Duplicated logic with small differences. The same calculation, validation or formatting written three times in three files, each slightly different, because each was generated in a separate conversation that could not see the others.
-
Configuration in code. Prices, feature flags, email addresses, rate limits and environment-specific URLs hard-coded where they were first needed, so that changing a price means a deploy.
-
Dependencies for one line. A package pulled in to pad a string or parse a date, each one a supply-chain surface the founder did not choose. Software Supply Chain Failures is new at number three on the 2025 OWASP list, and this is how small apps end up exposed to it.
-
Tests that test nothing. Test files that exist, pass, and assert that the function returns what the function returns. They satisfy a “write tests” instruction without protecting anything.
-
Migrations that cannot run backwards. Schema changes with no reverse step and no thought about existing rows, which is fine until the first bad deploy needs rolling back.
-
Permissions granted to make the error go away. A public bucket, a disabled security rule, an allow-all policy, added at some point to get past an access error in development and never revisited.
A reviewer who knows these ten by heart reads an AI-generated pull request the way a radiologist reads an X-ray: quickly, because they know where to look.
Setting up the gate on GitHub, as a solo founder
A review process only works if the system enforces it. “I’ll remember to get it looked at” is not a process. GitHub can enforce every part of this for you, most of it for free, in about an hour.
Protect the main branch with a ruleset. GitHub’s rulesets are the current way to do this; they sit alongside older branch protection rules and can be switched off without being deleted. Create one targeting your default branch and turn on, from the available rules:
- Require a pull request before merging. Nothing goes straight to main, including from you.
- Required approvals: 1. GitHub allows zero to ten; one is right for a solo founder with one reviewer. Turn on dismiss stale approvals so a new push after approval needs a fresh look.
- Require status checks to pass. Point it at your test workflow (below). The docs put it plainly: required status checks ensure that all required CI tests are passing before collaborators can make changes.
- Block force pushes and restrict deletions, both on by default. Leave them on.
One detail that matters more than it looks. By default, branch protection does not apply to repository admins, and as the founder you are the admin. Do not add yourself to the bypass list. The entire value of the gate is that it applies to the person most tempted to skip it at 11pm before a demo.
Turn on secret scanning and push protection. Secret scanning runs automatically and free on public repositories; on private repositories it needs GitHub Secret Protection on a Team or Enterprise plan, a small line item against the cost of a leaked key. Push protection is the part you want: it blocks a push that contains a recognised secret before it reaches the repository, instead of alerting you afterwards. This is the automated version of review question three.
Turn on Dependabot alerts and security updates. Dependabot alerts tell you when a dependency has a vulnerability in the GitHub Advisory Database. Security updates open a pull request that bumps it to the minimum patched version. Those pull requests go through the same gate as everything else: the reviewer glances at the changelog, the tests run, it merges.
Add one workflow that runs the tests. A GitHub Actions workflow that runs your test suite on every pull request, set as the required status check. Even if the suite is small today, the gate now has a place to grow. If your stack is the one we recommend for most founders, Ruby on Rails with Next.js, both have mature test tooling that a model can write for.
Give one person review rights. This is the human part. Add your reviewer as a collaborator with write access. They do not need to be in your company. They need to be senior, to know the ten patterns, and to be reachable within a working day. For most founders at this stage that is a fractional CTO rather than a hire; our guide to the startup CTO role walks through the options and what each costs.
From then on the loop runs itself. You build in your tool. You open a pull request. Secret scanning and tests run. Your reviewer reads it against the six questions. It merges or it comes back with a comment. If you want the deployment side set up too, from preview environments to rollback, our CI/CD guide covers it.
AI review tools: the first pass, not the gate
You will be offered AI code review tools, and some are good. Used properly they make the human reviewer faster. Used as a replacement they recreate the problem they claim to solve.
What they do well is the mechanical part of questions three, four and six: a hard-coded key, an unescaped string, a known-vulnerable package, a duplicated block. Run one on every pull request and let it leave comments.
What they do badly is questions one, two and five, which are the ones that end up in security disclosures. Whether this query should check that ownership column depends on what your product is. Whether this migration is safe depends on data the tool cannot see. Whether this webhook can be forged depends on reading the code the way an attacker would. Those need a person who understands the business.
So: AI reviewer comments first, human approval last, and the approval is the only thing the branch ruleset actually requires.
Cleanup: refactor or rewrite?
Sooner or later a reviewer will say “this part needs cleaning up,” and the founder will hear “rewrite.” Usually that is not what they mean.
Refactor when the foundation is sound and the problems are local. The data model makes sense, users and their data are clearly separated, the parts that touch money are identifiable. The problems are patterns four through nine: duplication, swallowed errors, config in code, thin tests. Each can be fixed one pull request at a time, through the same gate, without stopping feature work. Most vibe-coded apps are here, and the reviewer’s job is to keep a short, prioritised list and pick off one item a week.
Rewrite a component when the problem is structural. The signs: no boundary between the code that handles payments and the code that renders pages; user data spread across tables with no clear owner, so access rules cannot be written cleanly; business rules living in the browser where anyone can read and bypass them. Even then, “rewrite” almost always means one component, not the product. Keep the UI, rebuild the data layer. Keep the data, rebuild the payment flow.
The honest default is refactor. A reviewer who recommends a full rewrite should be able to point to a structural reason, not a long list of local ones.
What this costs
A fractional CTO who owns review and technical direction at this stage runs $5,000 to $12,000 a month depending on scope, and the review loop above is the core of that engagement: a senior engineer reading every change before customers see it, keeping the cleanup list, and answering when an investor asks “who reviews your code?”
The cheaper version is also real: set up the gate yourself in an hour and find one senior engineer willing to be the approver. The ruleset does not care whether the reviewer is on payroll.
What is not an option is no gate. The tools will keep getting better at writing code and, on the evidence so far, not much better at writing secure code. If you want a reviewer who has read a few hundred of these already, talk to us. Bring the repository link; the first thing we do is read it.
AI Code Review FAQs
Does AI-generated code need to be reviewed by a human? Yes, if the app handles money, personal data or anything you would be embarrassed to lose. Veracode tested more than 100 models on 80 coding tasks and found they introduced an OWASP Top 10 vulnerability in 45 percent of cases, and larger models did not do better. The model is a fast, tireless junior developer. Someone still has to read the pull request before it merges.
Can an AI code review tool replace a human reviewer? It can replace the first pass. AI reviewers are good at catching the obvious: a missing null check, an unescaped string, a dependency with a known vulnerability. They are weak at the things that matter most in a vibe-coded app: whether this change quietly lets one customer read another customer’s data, whether the webhook can be forged, whether the schema change will hurt in month three. Use the tool to triage. Keep a human as the gate.
What should a code review of a vibe-coded app focus on? Access control first, because that is where AI-built apps actually get breached. Then secrets in the code, input handling, anything that touches payments, error handling that hides failures, and whether the change duplicates logic that already exists elsewhere. The style of the code matters much less than whether it is safe and whether the next person can change it.
How does a solo founder set up code review on GitHub without a team? Turn on a ruleset for your main branch that requires a pull request and at least one approving review, require your test workflow to pass before merge, block force pushes, and do not exempt yourself as admin. Turn on secret scanning with push protection and Dependabot alerts with security updates. Then give one person you trust, a fractional CTO or a senior engineer, review rights. You keep building the way you build; nothing lands on main without their approval.
When should AI-generated code be refactored instead of rewritten? Refactor when the data model is right and the problems are local: duplicated functions, inconsistent error handling, missing tests. Rewrite when the problems are structural: no separation between the parts that touch money and the parts that render pages, user data spread across tables without a clear owner, or secrets and business rules living in the browser. Most vibe-coded apps need a refactor, not a rewrite, and a good reviewer can tell you which in an afternoon.
Have a product idea to talk through?
We'll show you how we'd approach it — no pressure, just a real conversation.
Book a Discovery Call