← Back to database

AI code audit: how to check AI-generated code before launch, and who does it for you

An AI code audit is a review of code written mostly by AI tools (Cursor, Claude Code, Codex, Lovable, Bolt) before it handles real users and money. Automated scanners catch leaked keys, vulnerable packages and common injection bugs. The most common serious problem in vibe-coded apps is broken access control, often missing or wrong database rules, and finding it takes a person who knows who should see which data. A good audit uses both and ends with fixes, not only a report.

Bogumił Łuć · updated

This idea is in my database because of a video titled "I made $250M in one year. Here's what it actually cost me", where the speaker talks about making sure what people create "is not slop; it is secure". I write most of my own code with AI coding agents (Codex and Claude Code) on Next.js, Expo and Supabase, which is also the stack many vibe-coded apps end up on. Below is what an audit of AI-generated code should check, what you can run yourself for free, and what the services on the market offer. The original idea card with scores stays under the guide.

What is an AI code audit?

It is a security and quality review of a codebase that was written mostly by AI, done before launch, before a big customer signs, or after the first strange support ticket. Most audits cover:

  • access control: can one user read or change another user's data,
  • secrets: API keys in the code, in the frontend bundle or in git history,
  • dependencies: packages with known vulnerabilities, or packages that should not be there at all,
  • injection and input handling: SQL, cross-site scripting, unvalidated API input,
  • AI features: prompt injection, data leaking through the model, runaway token costs,
  • maintainability: duplicated logic, dead code, missing tests, which decides how expensive every next change will be.

Why does AI-generated code need an audit?

Because code that runs and passes a quick click-through can still leak data. Three studies with numbers:

StudyWhat it testedFinding
Veracode, 2025 GenAI Code Security Report (July 2025)80 coding tasks given to 100+ models in Java, JavaScript, Python and C#In 45% of cases the model picked the insecure option and introduced an OWASP Top 10 flaw. Cross-site scripting was not prevented in 86% of relevant samples. The October 2025 update: even the best model still introduced a vulnerability in 28% of cases
Escape, State of Security of Vibe Coded Apps (2025)Passive scan of 5,600+ public apps built on vibe coding platforms2,000+ high-impact vulnerabilities, 400+ exposed secrets (including OpenAI keys and GitHub tokens), 175 cases of exposed personal data. Main cause: misconfigured permissions, especially Supabase Row Level Security
UpGuard, Systemic Data Exposure in Supabase Apps (September 2026)~300,000 domains with signs of Supabase, checked for readable tables16,326 databases exposing readable tables; over half had indicators of personal data

There is also a supply chain risk. A USENIX Security 2025 paper ("We Have a Package for You!") found that 19.7% of 2.23 million packages recommended by code-generating models did not exist, with 205,474 unique made-up names. An attacker can register such a name and wait for someone to install it.

What is the most common problem in vibe-coded apps?

Broken access control, and in Supabase apps that usually means Row Level Security. Many AI-built frontends talk to the database directly from the browser with a public key. Supabase's documentation is clear about the model: the publishable key (the older "anon" key) is meant to be public and only reaches what Row Level Security allows, and the secret key (the older "service_role" key) bypasses Row Level Security and must never leave the server.

If a table has RLS turned off, or a policy that allows more than intended, anyone who opens the browser's network tab can query it. That is CVE-2025-48757 in Lovable-generated projects: in March 2025 a scan of 1,645 Lovable projects found 303 endpoints in 170 projects with inadequate RLS. Lovable disputes the CVE, saying each customer is responsible for protecting their app's data. Either way, on these platforms the database rules are yours to check.

A scanner can tell you that a policy exists. Only someone who knows the business rules can tell you whether a policy is right, for example whether a team member should see invoices of another team. Matt Palmer, who reported the CVE, wrote that the security scanner Lovable added afterwards only checked that some policy exists, not that it matches the app's logic.

How to audit AI-generated code yourself: a free first pass

This takes an afternoon on a typical Next.js or Expo + Supabase project. All tools below are free and open source.

  1. Secrets in code and history. Run gitleaks git . in the repository. It scans every commit, so a key removed last month still shows up. Rotate anything it finds, deleting the line is not enough. Then open your deployed site, search the JavaScript bundle for "sk-", "service_role" and "secret", and make sure only public keys are there.
  2. Vulnerable and unknown dependencies. Run osv-scanner scan source -r . (or npm audit). Then read the dependency list yourself and look up any package you do not recognise. A package with a near-zero download count and a name close to a popular one is a red flag.
  3. Static analysis. Run semgrep scan --config auto for common injection, XSS and unsafe API patterns. Expect noise; fix the high-severity findings first.
  4. Database rules. In Supabase, open the Security Advisor in Studio (or run supabase db advisors). It flags, among others, tables in the public schema with RLS disabled, RLS enabled with no policy, overly permissive policies, sensitive columns exposed and public buckets that allow listing. Then do the manual test: log in as user A, copy a request from the network tab, change the id to user B's record and see what comes back.
  5. Authorization on the server. Check that every API route and server action checks who the user is and what they may do, inside the route. Do not rely on middleware alone. In March 2025 Next.js patched CVE-2025-29927, where a crafted header let requests skip middleware entirely, and apps that only checked auth there were exposed.
  6. AI features. If the app calls an LLM, check the OWASP Top 10 for LLM Applications: prompt injection (can user text override your instructions or reach tools it should not), sensitive information disclosure (what goes into the prompt), and unbounded consumption (is there a rate limit and a spending cap on your model API key).
  7. Payments and limits. Make sure prices, plan limits and "is paid" flags are decided on the server or by the payment provider's webhook, never by a value the client sends.

If steps 4, 5 or 7 turn up problems, that is the point where a second pair of eyes pays off, because these are logic bugs, not pattern matches.

What do AI code audit services offer?

The search results for this topic are mostly vendor pages. Here is what five of them state on their own sites on 25 October 2026. I have not used any of them.

ServiceWhat they say they doPrice and timing on the site
GitTruthAutomated scan of a repo and live endpoint testing, report with fix prompts for Claude or CursorFree score for public repos; full audit $49 one-time
Triple MindsAutomated SAST, secret and dependency scans plus manual review by a senior engineer, OWASP-basedSecurity scan $299 (3 days); full report in 5 days; fixing criticals and highs $3K-$10K over 2-4 weeks
resQodeAudit and fixes for apps built with Lovable, Bolt, Replit and Cursor, PRs pushed to your repo, re-test48-hour turnaround, fixed price quoted after the audit, 3-month guarantee
VibeAuditsSenior engineers on call, or a partner engagement covering audit, penetration testing and launchMentor plan $29/month; partner from $1,000
VibecopAutomated analysis plus senior engineer verification, prioritised risk roadmap, optional ongoing supportNot checked

Two things to compare: whether a human verifies the findings (automated-only tools are cheap but cannot judge business logic), and whether the price includes fixing, because a list of 40 issues is not a secure app.

Should you hire an auditor or a developer who fixes it?

It depends on what happens after the report.

  • Pure audit makes sense when you have a developer or a team who will do the fixes, or when a customer or investor asks for an independent report.
  • Audit plus remediation makes sense for a solo founder with a vibe-coded MVP. The person who finds the RLS hole should also write the policy, add a test that proves user A cannot read user B's rows, and put the scanners from the checklist into CI so the next AI-written feature gets checked too.
  • Rebuild is sometimes cheaper than repair, when the app has no clear data model, auth is spread across the client, and every fix breaks something else. A good auditor will tell you this early instead of billing for patches.

Is a code audit service a good business idea?

The demand signals are real: the studies above, the number of new vendors with "vibe" in their name, and Google suggesting searches like "vibe code cleanup specialist". The original card scores it 8/10 for a solo founder and 9/10 for AI leverage. The hard parts are trust (clients hand you their whole codebase, so an NDA and a clear access policy come first), liability for what you miss, and the fact that automated scanning alone is becoming a cheap commodity. The margin is in the human review and in fixing.

Where I can help

I am Bogumił Łuć, a solo AI product builder from Kraków. I build web and mobile apps, MVPs and AI integrations for clients, with Next.js, React Native/Expo, TypeScript, Supabase and the OpenAI and Claude APIs, and I use AI coding agents in my own daily work. If you have an AI-built app that has to be made production-ready, or you want to build a code audit product like the one in this card, the process is: a workshop to define scope, a quote, UX that I design myself, then two-week sprints. Billing is hourly on a B2B invoice.

See my services, MVP development, or AI integration.

FAQ

What is an AI code audit?

A security and quality review of code written mostly by AI tools such as Cursor, Claude Code, Codex, Lovable or Bolt. It checks access control, leaked secrets, dependencies, injection bugs, AI features like prompt injection, and how maintainable the code is, and it should end with concrete fixes.

Is AI-generated code secure?

Often not by default. In Veracode's 2025 tests of 100+ models, the generated code introduced an OWASP Top 10 flaw in 45% of tasks, and even the best model in the October 2025 update did so in 28% of cases. Escape found 2,000+ high-impact vulnerabilities across 5,600+ public vibe-coded apps.

How do I audit a vibe-coded app myself?

Start with free tools: gitleaks for secrets in git history, OSV-Scanner or npm audit for vulnerable packages, Semgrep for common code flaws, and the Supabase Security Advisor for database rules. Then test access by hand: log in as one user and try to read another user's records through the API.

How much does a vibe code security audit cost?

On vendor sites checked on 25 October 2026, prices ranged from $49 for an automated audit (GitTruth) and $299 for a scan (Triple Minds) to $3K-$10K for fixing critical and high findings over 2-4 weeks (Triple Minds). Others quote a fixed price after the audit.

Can automated tools replace a manual code review?

No. Scanners find leaked keys, known vulnerable packages and common injection patterns well. They cannot tell whether a database policy matches your business rules, which is the most common serious flaw in vibe-coded apps, so a person still has to check who can see which data.

Sources

Idea card from the database

Summary

A product that analyzes AI-produced code for vulnerabilities, style issues, and potential bugs, then suggests or applies remediations to ensure production readiness.

Problem

AI-generated code can be 'slop'—buggy, insecure, or noncompliant—so teams need verification before deployment.

Target customer

Engineering teams, DevOps, security teams, and platforms that produce or consume AI-generated code.

Solution

Automated static analysis, security scanning, and suggested fixes tailored to AI-output patterns, integrated into CI/CD or the coding platform.

Business model

saas per-repo or per-scan pricingenterprise licensing with integration servicespay-as-you-go scanning credits

Distribution

local SEOcold outreachreferrals

Required skills

LLM workflowscustomer discoverydistributionproduct validation

Source evidence