guide · quality

Code written with AI tools: what to check before you ship

AI coding tools can produce a working app remarkably fast, but working is not the same as safe. This guide sets out what the evidence says, a checklist to run before real users, payments or personal data arrive, who should do the review, and where ownership of AI-written code stands.

code-written-with-ai-tools.md
reading
About 6 minutes
updated
25 November 2026
sources
7 published sources, linked where cited

The short version

What the evidence says

Developers themselves are cautious. In Stack Overflow’s 2025 survey, 45.7% said they distrust the accuracy of AI tools and 32.7% said they trust it. The top frustration, named by 66%, was “AI solutions that are almost right, but not quite”, and 45.2% said debugging AI-generated code is more time-consuming (Stack Overflow (opens in a new tab)).

Security research points the same way. Veracode, a security vendor, tested more than 100 large language models on 80 coding tasks and found vulnerabilities in 45% of test cases (Veracode (opens in a new tab)). That is a share of test tasks, not of all AI code in use, but it shows how easily plausible code can hide a hole.

None of this means you should avoid AI tools. It means their code needs the same review as code from a developer you have never worked with, and more if the person who prompted it cannot read it. Building this way by describing what you want and accepting what comes back is often called vibe coding.

When a review stops being optional

A prototype you show to friends is one thing. Have it reviewed before any of these happen:

  • real users sign up with their own email addresses and passwords;
  • you take payments;
  • you store personal data, especially health, financial or children’s data;
  • a larger customer asks about your security;
  • you hire developers to build on top of it.

The pre-launch checklist

These are common problems in code written in a hurry, by people or by tools. The list is practical guidance, not the result of a survey.

What to check before launch
CheckWhat to look for
SecretsNo API keys, database passwords or tokens in the code, in the repository history or in anything sent to the browser
Access controlOne user cannot see or change another user’s data by editing an ID in the address bar or in an API call
Sign-inPassword reset, session expiry and sign-out work, and admin screens cannot be reached by ordinary users
InputForms and APIs reject bad input, and nothing a user types can rewrite a database query
PaymentsPrices and totals are worked out on the server, and payment notifications are checked as genuine
DependenciesEvery library is real, maintained, up to date and under a licence that allows your use
Personal dataYou know where it is stored, who can see it, how it is backed up and how to delete it
Logs and errorsErrors reach you, and logs hold no passwords or unnecessary personal data
TestsThe paths users depend on, such as sign-up and payment, have automated tests
AccountsThe repository, hosting, domain and every outside service are in your name

For a wider frame, use the voluntary Software Security Code of Practice from the Department for Science, Innovation and Technology and the National Cyber Security Centre. Its 14 principles sit under four themes: secure design and development, build environment security, secure deployment and maintenance, and communication with customers (DSIT and NCSC (opens in a new tab)). All 14 apply to organisations that develop and sell software, so if you sell your app, it is written for you.

If developers paste customer data into an AI tool run by another company, the processor and transfer questions in UK GDPR when developers touch data apply to that company too.

Who should do the review

Not the person, or the tool, that wrote it: everyone has blind spots about their own work. There are three sensible options, and the right one depends on how much is at stake.

  • A developer you trust, for a few hours. Often enough for a small app with no payments and little personal data. A freelancer through a marketplace can do this; see the marketplace route.
  • A contractor for a few days. Good when you also want the fixes made and can direct the work. The advertised median for a full-stack contractor is £500 a day (ITJobsWatch (opens in a new tab)).
  • A fixed-price review. A written review ranked by risk, with a keep, fix or rebuild view and a price for the fixes. Our code review and rescue service works this way, and a security review goes deeper on security.

Whoever does it, ask for written findings ranked by risk, not a verbal “looks fine”. The Vetting Kit has a code review checklist mapped to the code of practice themes.

Keep, fix or rebuild?

  • Keep when the structure is sound and the problems are specific: a leaked key, a missing check, a few untested paths.
  • Fix when the problems are known and contained, even if there are quite a few.
  • Rebuild when the data model is wrong, security problems are everywhere, or nobody can explain how it works. In our view, rebuilding with the prototype as a working specification is often quicker than it sounds.

A good reviewer gives you the cost of each option, not just a verdict.

Who owns AI-written code

UK law has a rule for computer-generated works, meaning works with no human author: the author is the person who made “the arrangements necessary for the creation of the work” (CDPA s9(3) (opens in a new tab)). The government’s Report on Copyright and AI of 18 March 2026 proposes removing protection for wholly computer-generated works, while saying copyright should continue to protect works created with AI assistance (government report (opens in a new tab)). That is a proposal, not law.

So we cannot promise you a copyright position for code an AI tool wrote by itself, and nobody else can either. What you can control is a written, signed assignment from every developer for their work (CDPA s90(3) (opens in a new tab)), a clause asking them to disclose where AI tools were used, and the code sitting in your own repository. Who owns the code covers the rest, and the Ownership Check shows what you hold today.

General information, not legal or security advice. The copyright position of AI-generated code is under review; for your own position, speak to a solicitor, and have code that handles payments or personal data reviewed by someone qualified.

Questions people ask

Is code written by AI tools safe to launch?

It can be, once it has been reviewed. Vendor research found security flaws in 45% of AI coding test cases (Veracode (opens in a new tab)), so check it before real users, payments or personal data arrive.

What is vibe coding?

Building software by describing what you want to an AI tool and accepting the code it writes, often without reading it. It is a fast way to test an idea, and a risky way to run a business.

Can my AI-built prototype be reviewed without rebuilding it?

Yes. A review should tell you whether to keep, fix or rebuild, with the cost of each. Often the right answer is to keep most of it and fix the risky parts.

Do I own code that an AI tool wrote?

Nobody can promise a position. UK law has a specific rule for computer-generated works (CDPA s9(3) (opens in a new tab)), and the government proposes changing it (government report (opens in a new tab)).

Should I stop my developer using AI tools?

Not necessarily. Ask them to say where they use AI tools and how they check the output, and never to paste customer data or secrets into them.

Not sure which way to hire?

The free Hire Route Finder asks ten questions about your project, budget and team, then shows the route that fits, what it really costs and what to watch for. No sign-up, nothing leaves your browser.