What the research actually says about AI-written code — and what happened when real teams trusted it too far.
Research digest
The evidence behind our work
Independent studies, industry reports and developer surveys. Most are from 2025–2026 and show that AI makes code faster to write and easier to get subtly wrong. Two older benchmarks on maintenance and technical debt are included, labelled with their year.
~38%
of AI code-generation tasks still introduced a known OWASP Top 10 vulnerability in Veracode's Fall 2026 test of 18 models — the first real improvement after a year stuck near 44%.
of solutions from one leading AI-agent setup were secure on 186 real-world feature tasks — even though 57% of them worked. Adding security hints to the request didn't close the gap.
of 2.23 million package references in 576,000 AI-generated code samples pointed to packages that don't exist — names an attacker can register and fill with malware.
more duplicated code blocks since 2023 across 623 million code changes, while refactoring fell 70%. The code ships today; the cost of owning it arrives later.
of nearly 5,000 technology professionals now use AI at work. DORA found it speeds delivery up but still increases delivery instability — AI amplifies whatever engineering discipline is already there.
of developers actively distrust the accuracy of AI tools, versus 33% who trust it. Their top frustration (66%): answers that are almost right, but not quite.
lower comprehension scores (50% vs 67%) for developers who learned a new library with AI help than for those who coded by hand — with the biggest gap in debugging.
slower: experienced open-source developers in METR's early-2025 randomised trial took longer with AI tools while believing they'd been 20% faster. METR says newer tools likely help more — the perception gap is the lasting lesson.
a week: the average developer's own estimate of time spent on maintenance — debugging, refactoring and dealing with bad code — out of a 41.1-hour week, in a 2018 survey of 1,000+ developers and 1,000+ executives in five countries. It's a survey estimate, not a time-tracking study, and it predates AI coding tools.
is CISQ's 2022 estimate of accumulated technical debt in US software — tracked separately from its $2.41 trillion estimate of what poor software quality costs the US each year. Both are national, top-down estimates rather than per-company figures.
Public incidents from founder post-mortems, security disclosures, a tribunal ruling and news reporting. For each: what happened, why, and where we would have stepped in.
While fixing a credential mismatch in staging, a Cursor agent running Claude Opus 4.6 went looking for an API token, found one in an unrelated file and called the hosting provider's delete endpoint on a volume it assumed was staging. It was production, and the volume's backups were stored on it. The provider, Railway, later recovered the data from its own off-site disaster backups and changed its API so deletes can be undone for 48 hours.
Why it happened
A token created to manage domains had account-wide power and sat where the agent could read it. Staging and production weren't separated at the credential level, backups shared the blast radius, and nothing required a human to approve a destructive call.
Where we'd come in
A secrets and permissions audit: scoped, short-lived tokens kept out of the repo; production credentials an agent simply can't reach; backups outside the blast radius, restored on a schedule to prove they work; and agent rules enforced by tooling — allow-listed commands and human approval for anything destructive.
Security researchers at Wiz inspected Moltbook's front-end code and found its Supabase connection key, which is designed to be public. Row Level Security wasn't configured, so that key gave anyone full read and write access: about 1.5 million agent API tokens, 35,000 email addresses and private messages. Moltbook fixed it within hours of disclosure.
Why it happened
A public key is only safe when the database checks who is asking. Nobody verified those rules before launch — and Wiz notes that secrets in front-end code are a recurring pattern in vibe-coded apps.
Where we'd come in
A pre-launch security review that tests the app the way an anonymous attacker would: database access policies checked table by table, front-end bundles scanned for secrets, and authorisation tests added to CI so the hole can't quietly reopen.
SaaStr founder Jason Lemkin was building an app with Replit's AI agent. Despite repeated instructions to freeze changes, the agent ran commands that wiped a production database holding records for roughly 1,200 executives and 1,190 companies, then told him rollback couldn't restore it. He rolled back anyway, and it did. Replit responded with automatic separation of development and production databases and a planning-only mode.
Why it happened
Development and production shared one database, and the freeze existed only as words in a chat. Instructions to an AI are requests, not controls.
Where we'd come in
Separate environments by default, change freezes enforced by permissions rather than prompts, tested backups with a written rollback runbook, and a review gate so no agent-made change reaches production without a person signing off.
Researcher Matt Palmer found that apps generated on Lovable often shipped with missing or incorrect Row Level Security. Scanning 1,645 apps from the platform's showcase, he found 303 exposed endpoints across 170 projects — about 10% — including user tables, transactions and API keys. The issue was published as CVE-2025-48757.
Why it happened
Security lived in the app's front end while the database trusted everyone. A checkbox-style scan confirmed policies existed without testing whether they matched the app's logic.
Where we'd come in
We read the access rules rather than count them: each policy tested against who should see what, plus automated checks that try to read another user's data before every release.
A Big Four firm's report to a government department
Deloitte Australia
A government report citing sources that don't exist
A university researcher noticed that a report Deloitte produced for Australia's Department of Employment and Workplace Relations cited non-existent academic papers and misquoted a court judgment. A revised version disclosed that generative AI had been used, and Deloitte agreed to refund part of its A$440,000 fee.
Why it happened
AI output went out under a trusted name without anyone checking each claim against its source.
Where we'd come in
The same rule we apply to code: nothing AI-generated ships until a qualified person has verified it. In software, that means review, tests and evidence — not confidence.
Air Canada's support chatbot told a customer he could apply for a bereavement fare after travelling; the airline's own policy page said otherwise. When he claimed the difference, the airline argued it wasn't responsible for information from its chatbot. British Columbia's Civil Resolution Tribunal disagreed, found negligent misrepresentation and ordered the airline to pay.
Why it happened
The bot's answers weren't tied to the source-of-truth policy, and nothing checked its advice before it reached a customer. An AI on your site speaks for your company.
Where we'd come in
For AI features in your product: answers grounded in your actual policies and data, guardrails on what the model may promise, evaluation sets that catch wrong answers before release, and a clear hand-off to a person.
Summaries are written by Snehith Infrafrom the public sources linked, which remain the authoritative accounts. The companies named are not our clients; “Where we'd come in” describes the safeguards we would put in place, not work we performed.
Stay ahead of AI code risks
New research and incident breakdowns when they matter. No spam — unsubscribe anytime.
Worried one of these could be you?
Get a second pair of eyes on your code before an incident does.