Your Contractor Wrote the Code With AI. How to Check What You Paid For
Almost every development team now writes code with AI, ours included. That is not the risk. The risk is code built from a brief that left out what mattered, which nobody checked, in a project only its author can run. Here is how to check a handover without being a developer, what to ask your contractor, what you can test for free and when an independent review pays for itself.
A founder pays for a product, the contractor delivers on time, the demo works. A month later a second developer opens the code and says: "this was written by AI, and nobody read it." The owner now has two questions and no way to answer either: is that true, and does it matter?
This article is for that owner, and for anyone about to accept a project from an outside team. We write a lot of code with AI ourselves, so this is not a warning against the tools. It is a way to find out whether what you bought is a product you own or a demo that only works while its author is around.
THE WRONG QUESTION
"Did you use AI?" is the wrong question
In the 2025 Stack Overflow Developer Survey, 84 percent of developers said they use or plan to use AI tools in their work. A contractor who writes everything by hand in 2026 is rare, and probably slower and more expensive for it. Asking "did you use AI" gets you a yes, or an answer you cannot check.
The same survey shows why the question still feels urgent. More developers actively distrust the accuracy of AI output (46 percent) than trust it (33 percent), and only about 3 percent trust it highly. The people who use these tools every day know the output has to be checked.
The question is who checked the code, and how.
So ask that instead, starting with the main point: who read each change before it was merged? What tests run before a release? Which parts did the team decide to write or rewrite by hand, and why? A good team answers these in a few minutes, because it does these things anyway.
THE REAL PROBLEM
The model built exactly what it was asked
Almost every project that reaches us from another team now is written mostly with AI. In those projects the trouble is rarely the model. The trouble is the brief: the human task the code was built from, which left out details nobody thought to mention. The model did what it was asked, quickly and neatly, and nothing more.
Our clearest example is a client account area that search engines could read. The person who ordered it asked for a personal cabinet with documents and order history, and got one. Nobody wrote down that the data inside was private, so nothing kept search crawlers away from pages that should only open after sign-in. The code had no vulnerability in the usual sense. It simply had no way of knowing that this mattered.
AI builds what you asked for, including what you forgot to ask.
In the projects we have taken over recently we have met the classic security holes from research reports less often than this: decisions nobody made, because nobody knew they had to be made. Who may see which data, what happens when two people pay at once, which pages must never appear in Google. An experienced developer asks these questions out loud. A model answers only the questions in the prompt. That is why the rest of this article spends more time on questions, handover and contracts than on code.
WHAT GOES WRONG
What unchecked AI code tends to get wrong
AI writes working code quickly. The problems sit in what a demo never touches.
Security. Veracode tested more than 100 language models on 80 coding tasks built around known weaknesses. In 45 percent of cases the generated code contained a vulnerability from the OWASP Top 10, the standard list of the most common web security risks. Newer models wrote more correct code, but not more secure code.
Packages that do not exist. A study presented at USENIX Security 2025 checked 576,000 code samples from 16 models. On average, at least 5.2 percent of the packages suggested by commercial models and 21.7 percent of those from open-source models did not exist. An attacker can register such a name in a public registry and wait for someone to install it.
A package the model made up is a name anyone can register.
Old versions. A model suggests what it saw most often while it was trained, and that can be a framework version already close to the end of its security support. The product works today and needs an urgent upgrade next year.
Duplicates and dead ends. When each fix is a new prompt, the code collects several versions of the same logic and functions nobody calls. Everything works until someone changes one copy and not the other.
No tests. The demo path is tested by eye. Payments, empty carts, wrong input and a second user doing the same thing at the same moment often are not.
OWNERSHIP FIRST
Check that you own it
Before anyone reads a line of code, check that the code and everything around it are yours. This step needs no technical skill, and in our takeovers it is where most surprises sit.
- The repository lives in an account your company controls, with the full history, not a zip file sent at the end.
- Hosting, domain, app store accounts, payment provider and email service are registered to your company, and you have the admin logins.
- Every paid service and license the product depends on is listed, with who pays for it.
- The contract says the code and the rights to it pass to you on payment.
A common picture when we take over a project from another team: access scattered across personal accounts, and no record of what changed, where and why. Recovering that costs more than the review itself. Our project takeover work starts exactly there.
THE HISTORY
Read the history without reading the code
A repository keeps a log of every change: who made it, when and with what description. You can read it in GitLab or GitHub without knowing the language the product is written in.
Look at the rhythm. Steady changes over the weeks you paid for, each with a short description, mean the work happened in the open. One huge upload at the end means nobody could see the work in progress, including the contractor's own reviewer.
Look at the descriptions. "Fix checkout tax for EU addresses" tells a future developer what happened. "Update", "fix" and "wip" repeated a hundred times tell nothing.
Compare with the invoices. The history should roughly match the months and stages you were billed for. It is the simplest way to see what your money bought.
THE HANDOVER TEST
Can someone else run it?
The strongest single check is also simple: give the repository and its instructions to a developer who has never seen the project and ask them to run it on their own computer.
A product you own comes with a short README that says how to install it, which settings it needs and how it is deployed. There is an example settings file without real passwords, the database can be built from scratch, and test data can be loaded. A competent developer gets it running in a few hours.
If only the author can run it, you have bought a dependency.
If the new developer gets stuck, write down where. Missing steps, settings that live only on the author's laptop and a server configured by hand are exactly what you will pay for later, at a worse moment.
QUESTIONS TO ASK
Seven questions for your contractor
Send these in writing and keep the answers. A team that works carefully answers them from memory; vague answers are an answer too.
- What brief was the code built from, and does it say which data is private and who may see it?
- Which parts were written mostly with AI, and who reviewed them before they were merged?
- What automated tests exist, and which parts of the product do they cover?
- Which third-party packages did you add, and why each one?
- Where are passwords and API keys stored, and is any of them in the repository?
- Did any of our code or data go into AI tools that may train on it?
- What is unfinished, fragile or known to be wrong?
The question about AI tools matters more than it looks. Pasting a client's code or customer data into a tool that keeps it for training can breach your own contracts and privacy duties. Ask which tools were used and on what terms.
FREE CHECKS
What you can check for free
A few checks cost nothing and take minutes.
Versions and support dates. Our sister company The Structure has a free stack check that reads composer.lock, package.json and other project files in your browser, uploads nothing and shows when each framework and language version stops getting security fixes. How it works is in our article on the free stack check.
Known vulnerabilities in packages. PHP projects have the built-in command composer audit, JavaScript projects have npm audit. Ask the contractor to run them and send you the output, or ask any developer you trust.
Alerts in the repository. GitLab and GitHub can warn about vulnerable dependencies and, on some plans, about passwords committed to the code. Switch on what your plan includes.
What Google can see. Search Google for site:yourdomain.com together with a word that appears only inside your account area, such as the name of a private section. If private pages show up, the fix is a sign-in check on those pages. A line in robots.txt is not protection: anyone can read that file, and it only asks crawlers to stay away.
The product itself. Try the paths your customers will take, with wrong input on purpose: a wrong card, an empty form, the back button in the middle of payment. Unchecked code shows itself fastest at the edges.
WHEN TO PAY
When an independent review pays for itself
Free checks find the obvious. An independent review is worth its price at four moments: before the last payment to a contractor, before a new team takes over, before you raise money and before you sell the company. In the last two cases the buyer or investor will review the code anyway; we explain what they look for in what a buyer's technical due diligence will find.
Our MVP review starts at $3,000, and most reviews cost $3,000 to $5,000, depending on the size of the code, the number of integrations and whether money or personal data moves through the product. The price is fixed before the work starts. Several specialists look at every product, and the result is a ranked list of risks with what to keep, what to fix and what to rebuild. Our article on vibe-coded MVPs shows how that decision is made.
For a US company working with an offshore or freelance team, the timing matters most. A review costs a fraction of the build, and it is worth doing while the contractor is still engaged and the last invoice is still unpaid.
NEXT CONTRACT
Put it in the next contract
Most of these problems are cheaper to prevent than to find. Six lines in the next contract do most of the work.
- A written brief that says which data is private, who may see what and which pages must never be public.
- Repository access in your company's account from the first day, not at the end.
- Acceptance criteria that include automated tests for payments, sign-in and other critical paths.
- A README and deployment notes as part of the deliverable, checked by the handover test.
- A clear rule on AI tools: which may be used, and that your code and data never go into tools that train on them.
- Your right to an independent review before the final payment.
A contractor who works well accepts these without argument, because they describe how good teams work already. One who argues has told you something useful before you paid.
FAQ
Frequently asked questions
Is it bad if my contractor used AI to write the code?
No, that alone is not a problem. Most developers use AI tools now, and a team that does not is often slower and more expensive. What matters is whether every change was reviewed by a person who understands it, whether tests exist and whether another team can run and change the product.
Can I tell which parts of the code were written by AI?
Usually not reliably, and it matters less than it seems. Ask the contractor directly and keep the answer in writing. Then judge the code by the same tests as any code: security, tests, documentation and whether someone else can maintain it.
Can I forbid my contractor to use AI?
You can, but you will pay for it in time and money, and it is hard to verify. A better clause sets which tools may be used, requires review of every change and forbids putting your code or customer data into tools that train on it.
How much does an independent code review cost?
Our MVP review starts at $3,000, and most reviews cost $3,000 to $5,000, depending on the size of the code, the integrations and whether money or personal data moves through the product. The price is fixed before the review starts.
What goes wrong most often in AI-written projects you take over?
The brief more often than the code. The model builds what it was asked for. In one project a client account area was open to search engines, because nobody had said the data inside was private. Ask your contractor what the brief said about data, roles and privacy.
What should I do if the review finds serious problems?
Start by ranking the findings by risk. Some can wait, some need fixing before launch, and sometimes part of the product is cheaper to rebuild. Share the findings with the contractor first: a good team fixes its own mistakes. Before holding back any payment, check your contract with a lawyer.
What is the simplest check I can do myself?
The simplest one is the handover test. Give the repository and its README to a developer who has never seen the project. If they get it running in a few hours, you own a product. If they cannot, you know what to ask your contractor to fix before the last payment.
Sources
- Stack Overflow Developer Survey 2025: AI
- Veracode: 2025 GenAI Code Security Report
- USENIX Security 2025: We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs
Not sure what your contractor delivered? Let's check the code before the last payment.
One notification a week with the new PERETZ articles. Nothing else.
Related Reading
-
22. 10. 2026
You Built an MVP With AI. Keep It, Fix It or Rebuild It?
-
20. 11. 2026
Free Stack Check: When Do Your PHP and Laravel Stop Getting Security Fixes?
-
03. 11. 2026
Selling Your Company? What a Buyer's Technical Due Diligence Will Find, and What to Fix First
-
12. 11. 2026
Technical Debt After an Audit: What We Fix First and What It Costs