An AI code audit is an independent review of software that was written fully or partly by AI coding tools such as Cursor, Claude Code, GitHub Copilot, Lovable, Bolt or v0. It checks whether the code is secure, whether it will hold up as usage grows, and whether another team can safely maintain it. A typical audit takes 5–10 working days and ends with a prioritised fix plan and a fix-or-rebuild verdict for each part of the system.
This guide is written for founders, CTOs and engineering leads who built fast with AI and now need to know what they actually have. It covers when you need an audit and when you don't, a 40-point checklist with clear pass/fail criteria, the red flags we look for first in common stacks, what scanners catch and what they miss, what a good report looks like, how much an audit costs, and what European companies need to add for GDPR.
Short on time? Jump to the 40-point checklist, the 10-minute self-check or costs. If you want us to look at your code, see our AI code audit service.
Two meanings of "AI code audit"
The phrase is used for two different things, and it is worth separating them before you buy anything:
This guide is about the first: auditing code that AI wrote. Good audits use AI-powered tools as one input, but they do not stop there.
Why AI-generated code needs a different kind of review
AI coding tools changed which mistakes end up in code, not just how many.
AI fixes the mistakes humans used to make. Typos, syntax errors and small logic slips become rarer. Apiiro, a security vendor that analysed tens of thousands of repositories at Fortune 50 companies between December 2024 and June 2025, reported that syntax errors fell by 76% and logic bugs by 60% among AI-assisted developers, while those developers committed code three to four times faster.
AI adds mistakes that are harder to see. In the same data, privilege escalation paths rose by 322% and architectural design flaws by 153%, and monthly security findings grew from about 1,000 to more than 10,000. The code looks cleaner and is riskier underneath. (Apiiro data as summarised by the Cloud Security Alliance, April 2026; Apiiro sells security products.)
Models write code that runs, not code that is safe. Veracode's 2026 GenAI Code Security Report found that roughly 44% of AI code generation tasks introduced a risky security vulnerability, and the average security pass rate across models was 56%, barely changed from the previous report. Some categories were much worse than others: models passed SQL injection tests 83% of the time, but cross-site scripting only 15% and log injection only 12%.
Some AI-suggested packages don't exist. Research presented at USENIX Security 2025 found that roughly 20% of code samples referenced packages that do not exist. Attackers can register those names and wait ("slopsquatting").
AI-linked vulnerabilities are now being formally recorded. Georgia Tech's Vibe Security Radar counted 74 confirmed CVEs linked to AI-generated code by the end of March 2026, rising from 6 in January to 35 in March. (As reported by the Cloud Security Alliance.)
Teams understand less of their own code. In a study described in the State of AI Report 2026, developers who learned a new library with AI scored 50% on a comprehension quiz afterwards, compared with 67% for those who learned without AI.
Even AI fixing AI is not reliable yet. On the CyberGym-E2E benchmark (920 real vulnerabilities in 139 C/C++ projects), the best agent produced a functional patch from source code 65.9% of the time, but only 22.2% of patches fixed the intended historical bug. (State of AI Report 2026, slide 208.)
The pattern behind all of these numbers is simple: AI is fast and confident. It does not say "I'm not sure". The resulting mistakes look finished, which is exactly why they survive until a customer, an attacker or an investor finds them.
When you need an AI code audit, and when you don't
You need one if
- Your product handles payments, personal data or health, financial or legal information.
- You are about to raise money, sell the company or sign an enterprise customer who will run a security review on you.
- The person who built most of the product with AI has left or is leaving, and someone new is taking over.
- You are moving from prototype to real users (hundreds or thousands of accounts).
- Your cloud or AI API bills are growing faster than your usage.
- An enterprise client sent you a vendor security questionnaire you cannot answer with confidence.
You can probably wait if
- It is an internal tool with a handful of users and no customer or personal data.
- It is a throwaway prototype you will rebuild anyway.
- An experienced engineer already reviewed every change that touches authentication, payments and data, and you have tests on those paths.
If you are unsure, run the 10-minute self-check below first.
The AI code audit checklist: 40 checks with pass/fail criteria
Use this as a working checklist. "Fail" means the issue is present or you cannot show evidence that it isn't.
1. Secrets and configuration
2. Authentication and authorisation
3. Money and critical business paths
4. Dependencies and supply chain
5. Tests and change safety
6. Architecture, errors and cost
7. AI features inside the product
8. Data protection and maintainability
Red flags by stack: what we check first
AI app builders and coding assistants tend to repeat the same patterns. These are the first places we look.
Supabase
- Row-level security switched off on tables with customer data, or policies that allow every authenticated user to read every row.
- The service role key used in frontend code.
- Storage buckets set to public when they hold private files.
Firebase
- Security rules left open ("allow read, write") after development.
- Admin SDK credentials committed to the repository.
Next.js and other full-stack JavaScript frameworks
- API routes and server actions that perform changes without checking who the user is.
- Secrets placed in variables that are exposed to the browser (for example the NEXT_PUBLIC_ prefix in Next.js).
- Authorisation done in middleware or the UI only, not where the data is actually read or written.
Apps generated with Lovable, Bolt, v0 or similar builders
- Business logic and access checks living in the browser.
- Default database settings never reviewed.
- Several slightly different copies of the same feature after many prompt iterations.
Python (Flask, Django, FastAPI)
- Debug mode enabled in production.
- Requests to URLs supplied by users without restriction (server-side request forgery).
- File paths built from user input (path traversal).
Payments (Stripe and others)
- Webhooks processed without signature verification.
- Prices or plan IDs accepted from the client.
- No protection against the same event being processed twice.
LLM features
- System prompts treated as a security boundary.
- Retrieval over documents that users can upload, with no defence against hidden instructions.
- No per-user rate limits or spending caps.
Automated tools vs human audit
Automated tools are fast and cheap and should always be part of an audit. They are not enough on their own.
There is also a practical problem with relying on a single tool. In an independent study by AppSec Santa, AI-generated code was run through five security scanners and every finding was validated by hand. 59.5% of the confirmed vulnerabilities were found by only one of the five tools. Choosing one scanner means missing most issues; running five means sorting through many false positives (772 of 926 raw findings in that study were false).
The most expensive problems in AI-built products are usually authorisation and business-logic issues. Those are exactly the ones tools are worst at.
What a good AI code audit report looks like
A useful report is short at the top and specific underneath. It should have four parts:
- A one-page summary for founders, boards and investors: overall risk level, the top issues in plain language, and the estimated cost and time to fix.
- Findings with evidence: each one with severity, location, how to reproduce it and how to fix it.
- A fix plan in order of risk: what to fix this week, this month and before scaling.
- A verdict per module: fix, refactor or rebuild.
Here is what individual findings should look like. (Illustrative example, not a real client.)
If a provider cannot show you a sample like this before you buy, ask for one.
How an AI code audit works, step by step
This is how we run it at Bonsay. Most good audits follow a similar shape.
- Access and NDA (day 1). Read-only access to the repository, and to a staging environment if possible. Either side's NDA. Nothing is changed without written consent.
- Review (days 2–6). Automated scans for secrets, dependencies, code patterns and infrastructure, followed by a senior engineer reading the critical paths by hand: authentication, authorisation, payments, data flows, AI features and deployment.
- Report and readout (days 7–10). Findings by severity with evidence, a fix plan in order of risk, a fix-or-rebuild verdict for each module, and a one-hour session with your team.
- Fix (optional). We fix the issues at a fixed price, a senior engineer joins your team, or your developers fix them and we check again.
How to verify that a fix is real: for every serious finding, ask for a test that fails before the fix and passes after it. That turns "we fixed it" into evidence you can keep.
How much does an AI code audit cost?
Prices on the market vary widely because "audit" can mean anything from an automated scan to weeks of manual review. What drives the price:
- Size and number of services: lines of code, repositories, mobile and web clients.
- Risk level: payments, personal or regulated data, AI features with tool access.
- Depth: tool scan only, or manual review of critical paths.
- Deliverables: findings list only, or summary, fix plan, verdict and retest.
Our published prices (fixed before we start):
To compare providers fairly, ask every vendor the same five questions: what exactly is reviewed by a person, how many days of senior engineering time are included, what the report looks like, whether retesting is included, and what happens to your code and data during and after the audit.
See all prices on our pricing page.
AI code audits for European companies: GDPR and EU rules
If you build or sell software in the EU, an AI code audit should also cover:
- Personal data in logs, prompts and error messages. AI-generated code often logs whole requests by default.
- Data sent to AI providers. If your product or your developers send personal data to AI services, those services act as processors or sub-processors and need the right agreements and documentation.
- Data location. Know which providers and regions store and process your data.
- Deletion. You must be able to delete a person's data across databases, backups, logs and third-party tools within your policy.
- Incident reporting for software vendors. Since 11 September 2026, manufacturers of products with digital elements have to report actively exploited vulnerabilities under the EU Cyber Resilience Act, with an early warning within 24 hours. Knowing what is inside your code, including dependencies, is now a legal need, not just good practice.
- AI features and the EU AI Act. If your product uses AI to interact with people, transparency obligations apply, so users should know when they are dealing with AI.
This section is a practical summary, not legal advice.
After the audit: fix, refactor or rebuild?
An honest audit sometimes says "rebuild this part". That is not a failure; it saves money compared with patching a fragile module forever. A simple rule we use:
- Fix when the structure is sound and problems are local (keys, missing checks, missing tests).
- Refactor when the logic is right but tangled, duplicated or impossible to test.
- Rebuild when the module's design is the problem (for example, access control that lives in the browser), or when fixing costs more than rewriting.
If the people who built the product with AI are gone, the next step is often a structured takeover: documenting the system, adding tests around critical paths, and then modernising one module at a time. See our software takeover service.
How to keep AI-written code safe after the audit
An audit is a snapshot. If your team keeps shipping AI-generated code, add a few habits:
- Label AI-assisted changes. Use pull-request labels or commit trailers so reviewers know what to look at more carefully.
- Make critical paths "human-reviewed only". Authentication, payments and data deletion should always get a senior review.
- Run the same scanners on every pull request, not once a year.
- Keep secrets out of reach of AI tools and rotate any key that has been pasted into a prompt.
- Re-audit before big moments: fundraising, acquisition, a large enterprise customer or a major release.
A 10-minute self-check for founders
Answer these with your lead developer. Three or more "no" or "not sure" answers mean you should get a closer look.
- Are there no secrets in the repository or its history?
- Can a customer not access another customer's data by changing an ID?
- Are database access rules switched on for every table with customer data?
- Do sign-up, payment and data export have automated tests?
- Do you know every package in your dependency list and why it is there?
- Are admin pages and internal APIs protected by strong authentication?
- Are AI features protected against instructions hidden in user input?
- Is there a cap on daily cloud and AI spending?
- Is personal data kept out of logs and prompts?
- Could a new developer safely change the payment flow within a week?
Frequently asked questions
What is an AI code audit?
An independent review of software written fully or partly by AI coding tools. It checks security, reliability, maintainability and cost, and ends with a prioritised fix plan and a fix-or-rebuild verdict for each part of the system.
How long does an AI code audit take?
Usually 5–10 working days from access to a written report for a single application. Larger or multi-service systems can take longer.
How much does an AI code audit cost?
At Bonsay, from €3,000 for a single application of up to about 30,000 lines of code, and €5,000–8,000 for larger or multi-service systems. The price is fixed before the audit starts.
Are automated AI code review tools enough?
They are a necessary first step but not enough. Tools disagree with each other and are weak at authorisation and business-logic issues, which are often the most expensive problems in AI-built products.
What access do you need?
Read-only access to the repository, and ideally to a staging environment. No production access is required, and nothing is changed without written consent.
Is AI-generated code a red flag for investors or buyers?
Not by itself. What worries investors is code nobody has reviewed. An audit report with a fix plan turns an unknown risk into a known, costed one.
Can you fix the problems you find?
Yes, at a fixed price agreed from the report. Alternatively, a senior engineer can join your team, or your developers can fix the issues and we check the fixes.
Will our code be used to train AI models?
It should not be, and you should ask every provider this question. Agree in writing how your code is handled, where it is stored and when it is deleted.
Is an AI code audit the same as a penetration test?
No. A penetration test attacks a running system from the outside. A code audit reads the code and configuration from the inside. They complement each other.
Do you audit apps built with Lovable, Bolt, v0, Cursor or Claude Code?
Yes. The tool matters less than the patterns it produces, and we know where each type of tool tends to leave gaps.
Get your AI-built code reviewed
If your product was built fast with AI and is about to meet real customers, investors or auditors, find out what you have before someone else does.
Fixed price agreed before we start. A report you can read in ten minutes. And if your code is in good shape, we will tell you that too.
Sources
- Veracode, 2026 GenAI Code Security Report (blog post, 28 July 2026)
- Cloud Security Alliance AI Safety Initiative, Vibe Coding's Security Debt: The AI-Generated CVE Surge (April 2026), summarising Apiiro, Georgia Tech Vibe Security Radar and other research
- Cloud Security Alliance AI Safety Initiative, Vibe Coding Security Debt: AI-Generated Vulnerabilities at Scale (April 2026)
- AppSec Santa, AI-Generated Code Security Study 2026 (updated May 2026)
- State of AI Report 2026, Nathan Benaich and Air Street Capital (slides 104 and 208)
- EU Cyber Resilience Act reporting obligations (applicable from 11 September 2026)




