Insights

Who checks the code AI writes?

Image of governance for AI coding
Tell the AI what you want and working code comes back quickly. The question is who reads that code, and who takes responsibility for merging it.

With coding agents now widespread, people without specialist training can produce working programs just by giving instructions in natural language. Prototyping is far faster. Over the past year or so, several studies have also shown the other side.

What the studies show ​

GitClear, a code analysis service, analyzed more than 200 million lines of change history in its 2025 report. It reported that blocks of five or more duplicated lines grew eightfold in 2024 compared with the year before. The share of changes that reorganize and reuse existing code fell from about 25% in 2021 to under 10% in 2024.

In Veracode's 2025 report, which tested more than 100 LLMs on 80 tasks, about 45% of the generated code contained a security flaw. The rate is said to have improved little with newer or larger models.

According to GitGuardian's 2025 report, about 23.8 million new secrets, such as API keys and passwords, were found on public GitHub in 2024. In repositories using GitHub Copilot, the share with leaked secrets was reported to be about 40% higher than the overall average.

What is happening on the ground ​

Behind the numbers is the following situation.

The volume of generated code has grown, and human review cannot keep up. If duplication and ad hoc fixes pile up unnoticed, in six months you have a codebase nobody wants to touch.

Sometimes no one is in a position to check the code AI wrote for vulnerabilities. Whoever generated it, once it is merged it is the company's responsibility.

"Shadow AI", where people use AI tools the company has not approved, is also spreading. If source code or customer information is pasted into an external AI service, that is a data leak. In IPA's "10 Major Security Threats 2026", risks around the use of AI entered the organization ranking for the first time, at third place.

Check with mechanisms ​

Relying on human attention alone cannot beat the speed of generation. We move the checking into mechanisms.

  • Build static analysis, tests and dependency checks into CI, and block merges of code that fails
  • Run secret scanning at commit time to stop API keys and credentials from getting in
  • Measure duplication and short-lived rewrites regularly, and set aside time for cleanup when they rise
  • Set a policy on which AI tools may be used and what data may be given to them. Providing tools that are safe to use gets followed more than banning does
  • For highly confidential code, consider a local LLM that does not send anything outside

If machines handle the formal findings, human review can spend its time on design and logic.

Where to start ​

The first step is to learn the current usage. Who uses which AI tool for which work. Which repositories have CI and which do not. Once you know that, the order of work follows.

Keep the speed, and build ways to check.

Talk to us about everything from taking stock of AI usage to setting up CI and quality gates.