# GenAI code provenance: how much of the codebase did AI write?

Source: https://techduediligence.co/insights/genai-code-provenance/

GenAI code provenance is an estimate of how much of a codebase was generated by AI tools and where that code sits. Acquirers and investors now ask for it by name. The figure is useful when it is read as what it is: an estimate with a margin of error, and a guide to where closer review is needed.

## Key points

- Ask for the estimated AI-generated share by module, not only for the codebase as a whole.
- Treat every provenance figure as a range, because no method can identify the origin of each line with certainty.
- Weigh the share against where it sits: generated test scaffolding and a generated payments module are different findings.
- Use the result to direct human review and to frame questions and warranties, not as a score of quality.

## Why acquirers ask by name

Until recently, the authors of a codebase were people, and technical due diligence asked whether each had assigned their work. Now a material part of new code in many companies is drafted by coding assistants, and investment committees want to know how much.

The reason is not suspicion of the tools. It is that three familiar questions have a new variable in them.

On ownership: whether the code is protected, and free of other people's licensed code. On security: whether generated code was reviewed with the same care as written code. On maintainability: whether anyone on the team understands what was generated. A provenance figure does not answer these, but it shows how much of the codebase they apply to.

## How the share is estimated

Generated code does not carry a watermark. Any figure is an inference from several kinds of signal, and a sound method uses more than one.

- **Explicit markers.** Some tools record their involvement in commit messages or metadata, and repositories often contain configuration files for an assistant, which date its adoption.
- **Patterns in the history.** The size and pace of changes, the ratio of code added to code later revised, and step changes in output per contributor after a tool was introduced.
- **Features of the text.** Regularities in structure, naming and commenting that are more typical of generated code than of a given team's earlier work.
- **The company's own records.** Tool subscriptions, usage dashboards and policy documents, which show who had access and from when.

Each signal is imperfect. Markers can be absent or stripped. A fast engineer can look like a tool, and a tool's output that was heavily edited by a person looks like a person. Code written before assistants were in common use can be treated as human, which makes the history of the repository an important anchor.

The honest output is therefore a range with a stated basis, not a single number to one decimal place. Be cautious of any figure presented without its method.

## Why concentration matters more than the total

A codebase-wide share says little on its own. What matters is which modules the generated code sits in, and how much those modules matter to the product.

| Where generated code is concentrated | What it usually means |
|---|---|
| Tests, scaffolding, configuration, internal tools | Routine use; low consequence if protection or quality is weak |
| User interface and standard integrations | Common; check review practice and duplication |
| Core algorithms and the logic that differentiates the product | Ownership questions carry the most weight here |
| Authentication, payments, data access | These modules warrant a security review by a person |

A company with a high overall share concentrated in tests is in a different position from one with a modest share concentrated in the module the valuation rests on. The breakdown is what lets a buyer scope further work sensibly.

## What it means for IP, security and maintainability

On intellectual property (IP), the questions are whether purely generated passages attract copyright protection and whether an assistant reproduced licensed code. The law is unsettled and differs by jurisdiction. The provenance estimate shows how much of the valuable code those questions touch. The detail is in [AI-generated code IP risk](/insights/ai-generated-code-ip-risk/). This is general information and not legal advice, and counsel should be consulted.

On security, assistants can produce code that looks correct and contains a flaw, or that relies on an outdated dependency. The difference from human error is volume: more code arrives per reviewer, and review is where flaws are caught. Modules with a high generated share and thin review deserve a closer security reading.

On maintainability, the concern is code that works and that nobody on the team can explain. That is a knowledge risk as much as a quality one. Our article on [AI code quality](/insights/ai-coding-assistants-code-quality/) sets out the signals of healthy and careless use.

## What the figure does not tell you

A provenance estimate is not a quality score. A team that uses assistants heavily, reviews carefully and tests well may have better code than a team that uses none. A high share is a fact to understand, not a defect.

Nor is a low estimate a clearance. It means the signals of generation were weak, which is evidence and not proof. And the estimate says nothing about title by itself: ownership still turns on the agreements with the people involved, which is the subject of [IP chain of title](/insights/ip-chain-of-title-software/).

## Using the result in a transaction

The practical uses are three. First, to direct review: analysts' time goes to the modules where a high generated share coincides with high importance. Second, to frame questions for the seller: which tools, on which terms, under what policy, from what date. Third, to shape the contract: a warranty about AI tool usage is easier to draft, and to disclose against, when both sides have the same figures in front of them.

Where the estimate and the seller's own account differ widely, that difference is the finding. It usually means that usage was not controlled, not that anyone was dishonest.

## How we approach it

GenAI code provenance is part of every report we issue, at every level of review. The report estimates the share of the codebase generated by AI, shows its concentration by module, and sets out the implications for IP and security. We present the figures as estimates, because that is what they are, and the section states what was examined and what was not.

The estimate sits beside the IP chain-of-title analysis, license compliance and security scanning in the same report, so a module with a high generated share can be read against its license findings and its vulnerabilities. In the Analyst-Verified Report, an in-house analyst verifies the findings, removes false positives and rates the risks in the context of the company's stage. Both the provenance estimate and the chain-of-title analysis are analysis, not legal advice.

The report is one document, read by both sides in the same words, and the seller responds beside each finding, on the record. How the analysis works is described on our [technology](/technology/) page, and the format can be seen in the [sample report](/sample-report/).

## Questions we are asked

### How accurate is a provenance estimate?

It is an estimate built from several signals, and its accuracy varies with the codebase. Explicit markers and a long history make it firmer; heavy human editing makes it softer. It should be read as a range that shows where to look, and it cannot establish the origin of an individual line with certainty.

### Is a high AI-generated share a red flag?

Not by itself. What matters is where the generated code sits, whether it was reviewed and tested, and whether the company controlled which tools were used and on what terms. A high share in a critical module with weak review is a finding. The same share in tests is usually not.

### Can the seller see and respond to the estimate?

Yes. The seller reads the same report as the buyer and responds beside each finding, on the record. A seller who holds usage records or a policy that bears on the estimate can add them to the data room, and the report can be regenerated until closing.
