Technical due diligence on an AI-built codebase
What an acquirer's engineers look for in a codebase AI built, the five things that stall a deal, and how to prepare with four weeks' notice or one.
If you are reading this in a hurry, skip to the section that matches your timeline. Four weeks out, one week out, or the questionnaire is already in your inbox.
Who ends up reading this
Three kinds of people search for this, and they want different things:
- A founder or CTO in a funding round or an acquisition, who has been asked for a technical review and is not sure what the reviewer will find.
- An engineer who has just been handed the repo by an acquirer, and has to write an opinion about it.
- Someone who inherited an AI-built product and wants to know what a proper review would say before anyone else says it.
The review is usually not adversarial. Most technical due diligence is a couple of engineers with a checklist and a week. They are trying to answer one question: can someone else take this over, and what will it cost to keep running.
What a technical review actually checks
Not whether the code is elegant. These are the things that produce findings:
- Can it be built and run from the repository alone? Without the founder on a call, without undocumented environment variables, without a service nobody knows about.
- Is there a test suite, and does it test behaviour? A reviewer will read the assertions, not the coverage number.
- Where are the boundaries? Which module owns auth, data access and money. How many implementations of each exist.
- What touches the outside world, and how is input validated? Payment providers, webhooks, uploads, any endpoint that accepts a payload.
- What is exposed? Secrets in the repository or in its history, dependency freshness, known vulnerabilities, who has production access.
- Can a new engineer change something safely? Usually tested by picking one small change and watching how far it ripples.
- Is there any record of why decisions were made? Any architecture notes, ADRs, or a README that is not from the first week.
- What is the ongoing cost? Hosting, third-party services, and the maintenance load on the team that stays.
An AI-built codebase does not fail this review because it is AI-built. It fails on items 2, 3 and 6, and those three failures have the same cause.
Why AI-built codebases fail the same three checks
AI writes code without making decisions. When you prompt for a feature, you get the feature and no decision about where it belongs, how it interacts with what exists, or what should be deleted to make room. Across a year of prompts you get a codebase that works and cannot be explained.
The three failures:
- Tests that run but do not verify. The suite is green. Break a business rule and it stays green.
- Boundaries that do not exist. Three auth paths, four places that write to the same table, a
utilsfolder holding business logic. - No explanation of anything. The reasoning lived in prompt windows that closed months ago.
None of that is dishonest, and none of it is unusual. It is the predictable result of building fast with a tool that optimises for output.
The five findings that stall deals
From an engineer’s seat in the room, these are the ones that turn into a price reduction, a holdback, or a dead deal:
- A green test suite that does not fail when the code is broken. This one does the most damage, because it removes the reviewer’s ability to trust anything else they are told.
- Multiple authentication or authorisation implementations. Always a finding, sometimes a security incident, and always an unknown cost to consolidate.
- Live credentials in the repository or its history. Forces disclosure to the acquirer’s security side and a rotation project with a date attached.
- A single engineer, or a founder, as the only person who can deploy. This is a bus factor problem, and diligence teams price it.
- No documentation of the data model. Where money, personal data or entitlements are stored, and what the invariants are. Reviewers tolerate bad code. They do not tolerate not knowing where the money is.
How to prepare: four weeks out
This is the comfortable timeline. Use it to fix evidence, not architecture.
Week 1. Find out what you actually have. Run the AI codebase health checklist. Do the test check first: break a business rule deliberately and see whether the suite notices. Write down what you find, including the uncomfortable items. You are going to be asked about them anyway, and a founder who knows their own weaknesses looks competent rather than evasive.
Week 2. Write the document. One page, plain language, covering: what the system does, how it is deployed, where the data lives, who has access, what the third-party dependencies are, and what the known weaknesses are. This document is the single highest-return artifact in this whole process. Most teams do not have one, and reviewers read it before they read the code.
Week 3. Fix the cheap, high-signal items. Get the repository building from a clean checkout with a documented environment file. Turn on branch protection and CI so the reviewer can see that nothing merges unchecked. Rotate anything that is in the history. None of these take three weeks and all of them change the tone of the review.
Week 4. Do a dry run. Have someone who has never touched the repo make one small change and deploy it, and write down how long it took and what they got stuck on. That is the experience the reviewer will have.
How to prepare: one week out
You cannot fix the codebase in a week. You can remove the things that look like concealment.
- Write the one-page document now. A hurried honest document is better than a polished one that omits the auth situation.
- Tell them the weaknesses before they find them, with a scope and a cost for each. Disclosed debt is a line item. Discovered debt is a credibility problem, and the two are priced differently.
- Do not refactor in a week. Refactoring under time pressure close to a review produces a codebase that is half migrated, which is worse to explain than the original.
- Fix the test suite’s worst offender if you can: delete or repair the tests that assert nothing, so the reviewer is not the first person to notice.
How to prepare: the questionnaire is already here
Give them access to the repo and the one-page document, name the weaknesses yourself in the cover note, and get an engineer on the call, so the technical questions get technical answers. The worst outcome is a reviewer forming their own view of the risks unaided, because their version will be more expensive than yours.
What a cleanup before a review is worth
A codebase that fails the test and boundary checks reduces the price, or attaches a remediation budget and a holdback to the deal, or kills it. The work to fix the worst of it is bounded: triage the whole repo, consolidate the duplicated boundaries, replace the worthless tests, and write down the decisions. That is a scoped project measured in weeks, not a rebuild.
We do that work, in four steps. If the review is close, we will tell you what is worth fixing in the time you have and what to disclose instead. AI code cleanup explains how we work, and the framework has the detail.
The honest version
If a reviewer tells you the codebase must be rewritten, get a second opinion before you agree. Almost every AI-built codebase we have seen needs triage and targeted restructuring, not replacement. Working behaviour and the product decisions baked into it are the valuable part, and a rewrite discards both.
If a review is coming and you want to know where you stand before someone else tells you, get in touch.