Key takeaways
- AI-generated code passes security tests only 56% of the time, and the figure has barely moved in a year (Veracode 2026 GenAI Code Security Report).
- In a scan of 1,645 apps built with Lovable, 170 exposed data through missing database access rules (CVE-2025-48757, as cited by the Cloud Security Alliance).
- New confirmed vulnerabilities linked to AI-written code rose from 6 a month in January to 35 a month in March 2026 (Georgia Tech Vibe Security Radar).
- The holes repeat: database access rules, authorisation, secrets, dependencies and untested payment paths. An audit of these takes 5–10 working days.
An app built with Lovable, Bolt, Cursor or a similar AI tool can be working in days. Whether it is safe to put real customers and real payments on it is a separate question, and the tool does not answer it. A security audit of such an app checks a short, predictable list: who can read the database, what any logged-in user can do, which keys sit in the code, which packages were pulled in, and whether the paths that take money are tested.
This article sets out what recent research found in AI-built apps, the checklist an audit follows, what a founder can check alone in an hour, and when an outside review is worth paying for.
What the research says about AI-built apps
Four findings describe the problem.
- Nearly half of generated code fails security tests. Veracode's 2026 GenAI Code Security Report puts the average security pass rate of AI-generated code at 56%. Given no security-specific guidance, models produce insecure code nearly 44% of the time, and Veracode calls the result virtually unchanged since its previous report. Bigger models do no better.
- One app builder, 170 open databases. A scan of 1,645 apps built with Lovable found 303 vulnerable endpoints across 170 of them, about one app in ten. The cause, recorded as CVE-2025-48757, was missing row-level security: the database rule that decides which user may read which row. The Cloud Security Alliance, which reviewed the case, notes that the tool did not set these rules unless explicitly instructed.
- Five coding agents, the same flaw. In a test reported by CSO Online and cited by the Cloud Security Alliance, five agentic tools — Claude Code, OpenAI Codex, Cursor, Replit and Devin — each built the same test applications. The 15 resulting apps contained 69 vulnerabilities, and failures in API authorisation logic were the most common critical class.
- The count is rising. Georgia Tech's Vibe Security Radar confirmed 74 vulnerabilities linked to AI-written code by March 2026. New cases rose from 6 a month in January to 35 a month in March.
The Cloud Security Alliance's own conclusion, in its research note of April 2026, is short: organisations should treat AI-generated code as unverified input, not trusted output.
Why the same holes appear in every tool
A model writes the code that most plausibly continues the prompt. A prompt that says "build a booking app" describes what the app should do, not who must be kept out. So the generated app works in a demo, and the defensive parts nobody asked for are missing: access rules on tables, checks that a record belongs to the user requesting it, limits on what an API key may do.
App builders add a second problem. They wire up a database, authentication and hosting in one step, which is their appeal, and the person building often never sees those settings. Nothing looks wrong until someone tries a request the interface does not offer.
The audit checklist: eight things to check before real users arrive
This is the scope of Bonsay's AI-generated code audit. It applies to any app built with an assistant or an app builder.
- Secrets, keys and tokens in the code, in the browser bundle and in the repository history.
- Authentication, authorisation and row-level security. Every table and every endpoint: who can read, who can write.
- Payment, sign-up and data-export paths. The places where money or personal data moves.
- Dependencies, licences and known vulnerabilities. Including packages an assistant added that nobody chose.
- Test coverage on the paths that make money.
- Architecture, error handling, logging and cost. Whether the next developer can change it safely.
- Cloud, CI/CD and environment configuration.
- Prompt injection and data leaks in any feature that passes user input to a model.
Automated scans run first. Then a senior engineer reads the critical paths by hand, because scanners find known patterns and miss logic: an endpoint that returns the right data to the wrong person looks correct to a tool.
Five checks you can do yourself in an hour
These do not replace an audit, but each one catches a common, serious problem.
- Open the database settings. In Supabase or Firebase, confirm that access rules are switched on for every table that holds customer data, and read what each rule allows.
- Search for keys. Look through the repository, its history and the JavaScript the browser downloads for API keys, database URLs and tokens. Anything in the browser bundle is public.
- Change the ID in the address bar. Log in as one test user and try to open another user's order, profile or file by editing the number or ID in the URL or the request.
- List what was installed. Run the dependency audit of your package manager and look at every package you do not recognise.
- Test the money path twice. Pay, cancel, refund and export once by hand, and check whether any automated test covers those steps.
If any of the five turns something up, assume there is more.
When to bring in an auditor
An outside review pays for itself at four moments: before the first paying customers, before the app holds personal or payment data, before an investor's technical due diligence, and before a larger customer sends a security questionnaire.
Bonsay's audit takes 5–10 working days and costs from €3k for a single application of up to about 30,000 lines of code, or €5–8k for larger or multi-service systems, fixed before the work starts. Access is read-only and under NDA. The result is a written report: findings by severity with evidence, a fix plan in order of risk, and a view on which parts to fix and which to rebuild. Details are on the AI-generated code audit page; the wider research is in AI-Generated Code Security: What the 2026 Data Shows.
Frequently asked questions
Is an app built with Lovable or Bolt safe to launch?
It depends on how it was configured, not on the tool's name. The research shows the typical gaps: database access rules that were never set, authorisation checks missing on some endpoints, and keys in the code. An app with those closed and tested can be launched; an app nobody has checked should not hold customer data.
How much does a security audit of an AI-built app cost?
Bonsay's AI-generated code audit costs from €3k for a single application of up to about 30,000 lines of code and €5–8k for larger or multi-service systems. The price is fixed before the work starts.
How long does the audit take?
Five to ten working days from access to a written report, followed by a one-hour readout with your team.
Sources
- Veracode, 2026 GenAI Code Security Report, July 2026.
- Cloud Security Alliance, AI Safety Initiative, Vibe Coding Security Debt: AI-Generated Vulnerabilities at Scale, research note, April 2026 — source for the Lovable scan (CVE-2025-48757), the CSO Online test of five coding agents and the Georgia Tech Vibe Security Radar figures.