---
title: "How Do Teams Verify AI-Written Code at Speed? Sonar Survey"
url: "https://goremy.ai/blog/articles/sonar-ai-code-verification-gap-survey"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-17T21:40:10.339Z"
updated: "2026-11-17T21:40:10.339Z"
topic: AI Coding Tools
description: "Sonar's survey of 1,000+ developers found 76% generate AI code faster than they can verify it. Here is the confidence formula and how to check agent output."
---

# How Do Teams Verify AI-Written Code at Speed? Sonar Survey

> Sonar's survey of 1,000+ developers found 76% generate AI code faster than they can verify it. Here is the confidence formula and how to check agent output.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-17

## How do teams verify AI-written code when it's generated faster than humans can review it?

They stop relying on human reading alone. Teams that cope well put automated checks between the AI agent and the main codebase, and those checks run independently of the agent. Nothing merges until a test suite, a code scanner, or another check the agent cannot edit says the change passes. Humans then spend their time on intent and risk, not on reading every line. Sonar's survey of more than a thousand developers and engineering managers shows why this matters: 76% say they generate AI code faster than they can verify it.

## TL;DR

- **76% of respondents** said they generate AI code faster than they can verify it, according to Sonar's survey of over a thousand developers and engineering managers.
- Fewer developers say they **always check AI code before committing** than a year ago, even though the code is getting better.
- Concern that AI code is so well written that **bugs are hard to spot** rose from 31% to 42%, because the bugs that slip through look reasonable.
- About **5% of teams run AI software factories** (agents that pick up tasks and open pull requests on their own), and 34% expect to within a year.
- Sonar frames confidence as a formula: **intent × guardrails × verification × evidence**. If any one is zero, confidence is zero.
- The practical rule: **the agent can write anything, but a check it doesn't control decides what ships.**

## What did the Sonar survey actually find?

Sonar, the company behind code quality tools, surveyed over a thousand developers and engineering managers for its State of Code report. A few findings stand out.

**Generation has outrun checking.** 76% said they produce AI code faster than they can verify it. That is a bottleneck, and it sits in the review step, not the writing step.

**Checking is slipping as quality rises.** Fewer developers say they always check AI code before committing compared with a year ago. The likely reason is simple: the code reads as correct far more often now, so people trust it more.

**The bugs that remain are harder to see.** The share of respondents worried that AI code is so well written that bugs are hard to spot went from 31% to 42%. Early AI code was often visibly wrong. Today's tends to look reasonable and fail in edge cases, in security details, or in how it fits with the rest of the system.

**Autonomy is increasing.** 5% of teams run AI software factories now, and 34% expect to within a year.

One caveat worth stating: Sonar sells code verification tools, so it has an interest in this problem being taken seriously. That doesn't make the numbers wrong, but read them as one vendor's survey, not a neutral census.

## What is an AI software factory?

An AI software factory is a setup where AI agents handle the loop a developer normally runs by hand. An agent picks up an issue from a tracker, writes the code, and opens a pull request (a proposed change that humans or other systems review before it joins the main codebase). Then it moves to the next issue, around the clock.

The creator who covered the Sonar report describes running factories like this and says most of his time now goes into deciding whether he can trust what the agents ship. That is the shift to expect. When agents do the writing, a person's job moves from author to reviewer, and reviewing at the speed of a machine does not scale by reading harder.

## Why are subtle bugs the bigger risk now?

Obvious errors get caught. A function that doesn't run fails a test, and a reviewer spots a missing import. What survives is plausible code that does the wrong thing in a narrow case.

Some examples of the kind of problem this describes:

- A discount calculation that rounds correctly for most prices but is off by a cent on certain totals.
- A permission check that covers the main path but not an alternate route to the same data.
- An error handler that quietly swallows a failure instead of reporting it.

None of these look wrong on a quick read. They pass a skim, which is exactly the review mode people fall into when the surrounding code is consistently good. Rising trust and falling scrutiny together create the risk.

## What is the code confidence formula?

Sonar puts it as a formula: **code confidence = intent × guardrails × verification × evidence.** Because it's multiplication, a zero anywhere makes the whole thing zero. Here is a plain reading of each part.

| Factor | The question it answers | What it looks like in practice |
|---|---|---|
| Intent | Does the agent know what "correct" means? | A clear issue with acceptance criteria, relevant context, and constraints |
| Guardrails | What is the agent prevented from doing? | Coding standards, scope limits, restricted permissions, rules applied before and during writing |
| Verification | Did something independent check the result? | Tests, static analysis, security scans, and human review that the agent can't bypass |
| Evidence | Can you show the checks happened? | Test results, scan reports, and approvals attached to the change |

The key point is that the factors don't substitute for each other. A team can write excellent instructions and still ship unchecked code if nothing independent verifies the output. A team can run heavy scanning on vague tasks and still build the wrong thing correctly. Sonar's data, as the creator relays it, suggests that getting to autonomous setups depends less on which model you use and more on two things you control: how you guide agents before they write, and how you verify every change before it ships.

## How do you verify AI code without reading every line?

Here is a workable sequence, based on the formula. It uses standard practices and doesn't depend on any one product.

1. **Write the task as a spec, not a wish.** Include what the change should do, what it must not touch, and how you'll know it worked. (A template follows below.)
2. **Set guardrails before the agent starts.** Agree on style rules, protected files, and which actions need a human. Keep secrets and production access out of the agent's reach.
3. **Require tests with every change.** Ask the agent to write them, but don't let passing its own tests be the only gate. Tests it wrote can encode its own misunderstanding.
4. **Run automated analysis on every pull request.** Static analysis and security scanning catch classes of bugs that look fine to a human reader, such as unhandled errors, injection risks, and duplicated logic.
5. **Block merges on failure.** Use branch protection so the agent can't merge its own work. The check that decides must be one the agent doesn't control.
6. **Keep the evidence.** Leave the test run, scan result, and approver on the pull request so anyone can see why a change was trusted.
7. **Aim human review at risk.** Spend people's time on changes that touch payments, permissions, data deletion, or customer data, and sample the rest.

A copyable task template:

```
Task: [one-sentence outcome]
Why: [the problem this solves]
Done when:
- [observable behavior 1]
- [observable behavior 2]
Do not change: [files, systems, or behaviors off limits]
Edge cases to handle: [list]
Required before opening a pull request:
- New or updated tests covering the above
- All existing checks passing
```

## What does this mean for you?

**If you're a developer or engineering manager:** Audit your own habits. If you used to read every AI-generated change and now skim, you match the survey trend. Move your trust from your eyes to your pipeline. Set merge rules that don't depend on how confident the code looks.

**If you manage a team that's starting with AI coding tools:** You don't need a software factory to have this problem. Anyone pasting AI output into a project has the same gap. Decide now what must pass before AI-written code is accepted, and apply it to everyone.

**If you're not a developer but depend on software:** Ask the people building your tools one question: what checks stand between AI-written code and our customers? A good answer names specific gates and not just "we review it."

**If you build small internal tools yourself with AI:** The same formula applies at small scale. Write down what the tool must do, test the real flows, and keep a record of what you checked.

## Can a tracker help you keep verification evidence?

Yes, and it's a small tool you can build instead of stretching a spreadsheet. A team handling AI-generated changes could use an internal approval tracker: a request form that captures the intent and acceptance criteria, a status page showing which checks passed, and a sign-off log. With [Remy](https://goremy.ai), you describe that app in plain English and it builds and deploys it with sign-in, a database, and roles, so reviewers and requesters see different things. Remy's QA agent also clicks through the app's flows in a real browser, so the tracker itself gets checked. It isn't a code review tool, but it can hold the evidence trail that review produces.

## Frequently Asked Questions

### What does it mean that 76% generate AI code faster than they can verify it?

In Sonar's survey of over a thousand developers and engineering managers, 76% said the pace of AI code generation exceeds their capacity to verify it. Code is being produced faster than teams can confirm it works and is safe. The bottleneck has moved from writing to reviewing.

### Why did concern about hard-to-spot bugs rise from 31% to 42%?

As AI code gets better, its mistakes get subtler. The bugs that remain look reasonable on a read-through, so they are harder to catch by eye. Respondents appear to be noticing that polished code can still be wrong.

### Do I need an AI software factory to worry about this?

No. Any workflow where AI writes code that a person accepts has the verification gap. Software factories make it sharper because agents work continuously and open many pull requests, but a single developer pasting in AI output faces the same question.

### Can't I just ask the AI to review its own code?

A second AI pass can catch some issues, but the principle from Sonar's framing is independence: the check that gates a merge should be one the writing agent doesn't control. Deterministic checks such as tests and static analysis, combined with human review of high-risk changes, give you stronger assurance than self-review.

### What is the quickest improvement a team can make this week?

Turn on required checks before merging and stop letting any author, human or AI, merge without them. Then add a short task template so agents get clear intent. Those two steps cover the guardrail and verification parts of the formula.
