The engineering read

Diligence on an AI-written codebase: what to ask for and what a good answer looks like

Diligence on an AI-written codebase asks for six things: the specification the code was generated from, the eval suite and its last failing run, the provenance record of which tool wrote which files, a current security scan, the list of models and versions the product calls, and a walkthrough by the person who directs the agents. It asks for these because the signals a reviewer used to rely on, commit history, style, comment density and test count, are produced by the model at no cost and tell you nothing about who understands the code. This page lists what to ask for and what a good answer looks like for each.

Published September 17, 2026. Editorial.

Key takeaways

  • On a model-written codebase, commit volume, style consistency and test count are free to produce and carry no information; the specification, the eval suite, the scanner output and the provenance record carry all of it.
  • Stack Overflow's 2025 survey found 66 percent of developers name almost-right solutions as their main frustration with AI tools, which is the maintenance profile of the code you are buying.
  • METR's July 2025 randomised study found experienced developers took 19 percent longer with AI tools on their own repositories while believing they were 20 percent faster; the gap between felt and measured productivity is why you ask for evidence rather than opinion.
  • A good answer to every request arrives within a day, because a team that has the artefact does not need to make it.

Diligence on an AI-written codebase asks for six artefacts: the specification the code was generated from, the eval suite with its pass gate and last failing run, the provenance record of which tool produced which files, a security scan from the last quarter, the inventory of models and versions in production, and a live walkthrough by the person who directs the coding agents. Each has a good answer and a weak one, and this page sets out both.

It assumes the general questions in assessing code quality are still being asked. What changes is that several of the general signals stop working, and the artefacts above take their place.

Why do the usual signals stop working?

The usual signals stop working because a model produces them at no cost. A reviewer reading a human-written repository could infer things from the shape of the history: a single author meant a bus factor of one, inconsistent style meant a team without conventions, a high test count meant somebody cared. On a model-written codebase, one person driving an agent produces the commit volume of a team, the style is consistent by default, and the tests were written by the same model that wrote the code, against the code it had just written.

Reveneau asks for the specification before the repository on an AI-written codebase, because code generated from a written spec can be checked against it and code generated from a conversation cannot. That is the first thing a good answer contains: a document, older than the code, that says what the code should do.

Two studies explain why opinion is a poor substitute for evidence here. METR's randomised trial, published 10 July 2025, had 16 experienced open-source developers complete 246 real issues on repositories they knew well; with AI tools allowed they took 19 percent longer, while forecasting a 24 percent speedup beforehand and believing afterwards that they had been 20 percent faster [1]. METR's February 2026 update, with 57 developers and over 800 tasks, reported estimates whose confidence intervals cross zero and said selection effects limit what can be concluded [2]. The point for diligence is the gap between what developers felt and what was measured. A founder's account of how the code was built is a feeling. The eval suite is a measurement.

Stack Overflow's 2025 survey of 33,662 developers gives the shape of the risk: 84 percent use or plan to use AI tools, 46 percent distrust the accuracy of the output against 33 percent who trust it, and 66 percent name solutions that are "almost right" as their main frustration, with 45 percent saying that debugging AI-generated code takes more time [3]. "Almost right" is the state a generated codebase is in by default. The artefacts below are how you find out whether this one was moved past it.

What to ask for, and what a good answer looks like

Ask for the six artefacts in writing before the management meeting. The table gives the good and the weak answer for each.

Ask for Good answer Weak answer
The specification A written document, versioned, older than the code it describes, with acceptance criteria "It is in the prompts", or a deck
The eval suite Hundreds of cases graded by code, run on every change, with a pass gate and a history of failures A test folder the model wrote, all green, never failed
Provenance A record of which tool generated which files, with the tool's terms and the code-referencing setting "Mostly Copilot and Claude Code, we think"
Security scan A static and dependency scan from the last quarter, with the findings triaged and the fixes merged "We will run one"
Model inventory Every model and version in production, with the date each was pinned and the migration plan for its retirement The model name from the deck
The walkthrough The person who directs the agents explains one recent change end to end: spec, generation, eval run, review, merge A demo of the coding tool

A good answer to every one of these arrives within a day, because a team that has the artefact sends the artefact. A team that has to create it will take a week and the result will be new.

How do you read the repository in a day?

Read the repository in a day by starting from the evidence that cannot be generated and working towards the code, rather than opening the code first.

  1. Read the specification against the product. Does the spec describe the product you saw in the claim test? Where it does not, the code was generated to a conversation the spec never captured, and the eval suite cannot cover what the spec does not say.
  2. Run the eval suite yourself. On a clean checkout, on the current commit. Note the pass rate, the run time and whether the suite touches the model at all or only the code around it. The eval suite as a diligence artefact is the full method.
  3. Read the last five failing runs. What failed, who noticed, what changed, how long it took. A suite with no failures in its history has never been used as a gate.
  4. Run the scanners. A static analysis tool and a dependency checker for the language. Veracode's July 2025 test of over 100 models found 45 percent of generated samples failed security tests, so treat the scan as the floor of what you expect to find [4]. Security of AI-written code in diligence covers the rest.
  5. Check the provenance record against the tools' settings. GitHub's documentation describes Copilot's code-referencing feature, which compares a suggestion and its surrounding code against an index of public repositories and, when it accepts a match, logs the file URL and the licence it found or "NOASSERTION" [5]. Ask whether it was on. Code provenance and licence exposure covers the licence side.
  6. Pick three recent changes and trace them. From the issue or the spec change, through the generation, the eval run, the review, and the merge. Three is enough to see whether the process in the walkthrough is the process in the history.
  7. Open the code last. With the eval results, the scan and the traces in hand, read the modules that failed or were flagged. That is where a day of reading pays.

What about the people behind the agents?

The team question changes shape. On a human-written codebase the question was how many people could maintain this. On a model-written one it is how many people can direct the agents, judge their output and write the specs the evals are derived from.

The question matters more than it did, because the agent removes the friction that used to force knowledge to spread. When three engineers had to write the code, three engineers understood it. When one engineer and an agent write it, the understanding can sit with one person, and the repository will look as though a team built it.

Ask the person doing the walkthrough to explain a decision the agent got wrong and how it was caught. Ask who writes the specification and who writes the evals, and whether they are the same person; when they are, the evals test what one person imagined and nothing else. Ask what happens when that person is on holiday. Assessing the engineering team still applies, with the role titles changed.

Anthropic's guidance for developers building test cases says to prioritise volume of cases over hand-graded quality, to automate grading, and to design cases that mirror the real task distribution including edge cases [6]. A team that has read that advice has a suite with hundreds of machine-graded cases. A team that has not has a demo and a feeling.

What goes in the report?

The report on an AI-written codebase states, for each of the six artefacts, whether it existed before the request, what it showed, and what it would take to create or fix. The consequence for the deal is usually the third column: a company with a spec and a suite needs nothing; a company with neither has a quarter of work ahead before the codebase can be handed to anyone, and that quarter is a cost in the model.

If the target is preparing for this review rather than undergoing it, preparing an AI-written codebase for review is the founder's version of this list, and how to review AI-generated code is the engineer's. How many tests does AI-generated code need answers the question the founder will ask next. The rest of the method is in the AI startup due diligence guide.

Best for

  • Any target whose codebase was mostly generated by coding agents
  • A reviewer who has a day and needs to spend it where the information is
  • A deal team writing the post-close engineering plan

Avoid if

  • The codebase is human-written with AI assistance only at the editor level; use the general code quality page
  • You have no repository access; run the claim test and the eval review instead

Verify before you commit

  • Request the six artefacts in writing and record the date each arrives
  • Run the eval suite and the scanners yourself on a clean checkout
  • Trace three recent changes from spec to merge and compare with the walkthrough

Common questions

What should I ask for when the codebase was written by AI?

When the codebase was written by AI, ask for six artefacts: the specification the code was generated from, the eval suite with its pass gate and last failing run, the provenance record of which tool wrote which files, a security scan from the last quarter, the inventory of models and versions in production, and a walkthrough by the person who directs the agents. Veracode's July 2025 test found 45 percent of AI-generated samples failed security checks, so the scan is the floor.

Why can't I use commit history to assess an AI-written codebase?

You cannot use commit history to assess an AI-written codebase because one person driving a coding agent produces the commit volume of a team, so the history no longer tells you how many people understand the code. Style consistency and test count fail for the same reason: the model produces both at no cost. METR's July 2025 trial found experienced developers believed they were 20 percent faster with AI tools while measuring 19 percent slower, which is why felt accounts are replaced with artefacts.

What does a good specification look like in AI code diligence?

A good specification in AI code diligence is a written, versioned document that is older than the code it describes and contains acceptance criteria the eval suite can be derived from. The weak answer is that the specification lives in the prompts or in a deck. Anthropic's developer guidance says to design test cases that mirror the real task distribution, and a suite can only mirror what a spec has written down; code generated to a conversation has no spec for the evals to check.

How long does it take to review an AI-written codebase?

Reviewing an AI-written codebase takes a day if the artefacts arrive first, because the day is spent on evidence that cannot be generated: running the eval suite, reading the failing runs, running the scanners, checking provenance and tracing three changes from spec to merge, with the code itself read last. Stack Overflow's 2025 survey found 45 percent of developers say debugging AI-generated code takes more time, so budget the reading for the modules the evals and scanners flagged.

Are AI-written tests worth anything in diligence?

AI-written tests are worth little on their own in diligence, because the model wrote them against the code it had just produced, so they confirm the code does what it does. What carries information is an eval suite derived from the specification, with a pass gate and a history of failures. Anthropic's developer guidance recommends many machine-graded cases over few hand-graded ones; a suite built that way, with hundreds of cases and a record of catching regressions, is evidence. A green folder is not.

What is a provenance record for AI-generated code?

A provenance record for AI-generated code says which tool generated which files, under which terms, with which settings. GitHub's documentation describes Copilot's code-referencing feature, which checks a suggestion and its surrounding code against public repositories and logs the file URL and the licence it found, or NOASSERTION, when a match is accepted. Whether that setting was on, and what the logs show, is the record. A company that cannot answer cannot answer the licence question either.

Does AI-written code need more security review than human code?

AI-written code needs a security scan rather than a read, because the failure rate is measured and high. Veracode's July 2025 report tested over 100 models across Java, Python, C# and JavaScript and found 45 percent of samples introduced a vulnerability from the OWASP Top 10, with Java at 72 percent and cross-site scripting defences failing in 86 percent of relevant samples, and found no improvement with newer or larger models. Run a static and dependency scan on the current commit and read what it finds.

How do I assess the team when agents wrote the code?

Assess the team behind an AI-written codebase by asking who writes the specification, who writes the evals, who directs the agents and who judges their output, and what happens when that person is away. Ask for a walkthrough of one recent change from spec to merge and for an example of an agent mistake and how it was caught. METR's February 2026 update, with 57 developers and over 800 tasks, found effects whose intervals cross zero; the team's judgement, not the tool, is what you are buying.

What if the startup cannot produce a specification?

If the startup cannot produce a specification, the code was generated to conversations, the eval suite cannot cover what was never written down, and the post-close plan starts with writing the spec back out of the code. That is a quarter of senior work and belongs in the model as a cost. Stack Overflow's 2025 survey found 66 percent of developers name almost-right AI output as their main frustration; without a spec there is no definition of right for the evals to check.

Should I open the code at all if I have the eval results and the scan?

Yes, open the code, but open it last and open the parts the evidence points to: the modules where evals failed, the files the scanner flagged, and the three changes you traced from spec to merge. Reading a generated repository from the top wastes the day on code that is consistent by default. METR's July 2025 study found developers' sense of their own AI-assisted speed was wrong by 39 points; reading with the evidence in hand avoids the same mistake on the reviewer's side.

More in The engineering read

The eval suite as a diligence artefact: ask for the suite, the pass gate, and a failing run

The eval suite is the most useful diligence artefact an AI startup can hand over, because it is the only document that shows whether product quality is measured or asserted. Ask for three things: the suite itself, the pass gate that decides whether a change ships, and one run that failed together with what was done about it. A suite that exists, gates releases and has a history of catching problems tells you the company can say how good its product is. A suite that is all green and has never failed tells you it has never been used. This page is the method for reading one in a diligence session; what an eval suite is lives on the eval-driven development guide.

Code provenance and licence exposure in AI-generated code

Licence exposure in AI-generated code comes down to three questions: whether the generated code can be owned at all, whether the generator reproduced someone else's licensed code, and what the tool provider's terms say about who owns the output. The US Copyright Office concluded in January 2025 that copyright does not extend to purely AI-generated material and that prompts alone do not give a user authorship, which makes the first question real for a codebase that was mostly generated. The second is answered by the generator's own matching logs, and the third by reading the terms. This page gives the check an investor can run and what to record.

Security of AI-written code: what to check in diligence

Security of AI-written code in diligence comes down to two checks: scan the code rather than read it, because Veracode's July 2025 test of over 100 models found 45 percent of generated samples failed security tests, and check the risks that only exist because a model is in the product, which the OWASP Top 10 for LLM Applications lists, starting with prompt injection. The general security review still runs. This page covers what the AI adds: the scan to run on the current commit, the ten model-specific risks to ask about, and what a good answer looks like from a team that has done this work already.