Who owns AI-generated code?
The short answer
The law on who owns AI-generated code is unsettled and differs by country. The US Copyright Office says output is protected only where a human author determined enough of its expressive elements, and that prompts alone are not enough. Your tool's terms, your contracts and your own contribution all matter. This is general information, not legal advice.
Who owns AI-generated code?
Nobody can give you one answer, because the question of who owns AI-generated code is really three questions, and each has a different source.
- Can anyone hold copyright in code a machine produced? That is a matter of national law.
- What did the company behind your coding tool agree to give you? That is in its terms.
- Does someone else have a claim? That depends on your contracts, your employer and what the output contains.
This page is general information to help you ask better questions. It is not legal advice, the law is still moving, and the answer differs from one country to the next. For a decision that matters, ask a lawyer who works in intellectual property where you live.
What has the US Copyright Office said?
The US Copyright Office published Part 2 of its report on copyright and artificial intelligence, covering copyrightability, on 29 January 2025. In its own announcement, the Office said:
- Outputs of generative AI "can be protected by copyright only where a human author has determined sufficient expressive elements".
- Using AI "to assist in the process of creation", or including AI-generated material in a larger human-made work, does not bar copyright.
- Protection can exist where a human's own work is perceptible in the output, or where a human "makes creative arrangements or modifications of the output", but not from "the mere provision of prompts".
- It found that the case had not been made for changing existing law to give AI-generated outputs extra protection.
The report is about creative works in general, not code in particular, and it is the view of the Office, not a court ruling on your project. Read plainly, though, it points one way: in the United States, the parts of a codebase that a person designed, wrote, rearranged or reworked stand on firmer ground than parts accepted untouched from a prompt.
Is it the same in other countries?
No. The United Kingdom is a useful contrast, because its statute speaks to the point directly. Section 9(3) of the Copyright, Designs and Patents Act 1988 says that for a literary, dramatic, musical or artistic work "which is computer-generated, the author shall be taken to be the person by whom the arrangements necessary for the creation of the work are undertaken".
That wording was written long before today's coding tools. How it applies to code produced with them is a question for a UK lawyer, not something to assume from the text.
Other countries take their own positions, and several are still reviewing them. If you, your customers or your buyer are in different countries, more than one set of rules may be in play.
What do your AI tool's terms decide?
Copyright law decides whether rights can exist. The tool's terms decide what the provider claims, grants or restricts. Read the current terms for the exact plan you are on, and look for four things.
- Ownership of output. Does the provider assign its rights in the output to you, or only license it?
- Commercial use. Are you allowed to sell what you make? Free and paid plans sometimes differ.
- Indemnity. Does the provider offer any protection if someone claims the output infringes their work, and on which plans?
- Your inputs. What can the provider do with the code and prompts you send?
We are not quoting any provider's terms here because they change and differ by plan. Save a dated copy of the terms you built under. A buyer may ask for it.
Can someone else have a claim on the code?
Yes, and these claims have nothing to do with whether a machine was involved.
Your employer or client. If you built the project in a job, or on paid time for a client, your contract may give them the rights regardless of which tool did the typing.
Contractors and co-founders. Anyone else who contributed owns their part unless they signed it over. That is what an IP assignment is for.
Open-source licences. Your project almost certainly depends on open-source packages, each with licence terms. Some licences place conditions on distributing code built with them. A tool can also produce output that closely resembles existing code. Check your dependencies, and scan the codebase if the stakes justify it.
A product you copied. Prompting up a close copy of someone else's product can expose you to intellectual-property claims, whoever or whatever wrote the code.
What does this mean if you want to sell the project?
A buyer is paying for the right to own and run the business. In the sale agreement you will be asked to confirm, in the section on representations and warranties, that you own what you are selling and are free to transfer it. With AI-built code, "own" may be a less tidy word than either side would like. So do the honest thing, which is also the practical one.
- Say plainly in the listing how the project was built and with which tools.
- Keep a record: the tools, the plans, the dates, and saved copies of the terms.
- Keep your repository history. It shows what you designed, changed and reworked.
- Get written assignments from anyone else who contributed.
- Ask a lawyer how to word what you promise about ownership, so you do not promise more than you can know.
It also helps to remember what a buyer of a small business is really paying for. The code is one asset among several: the domain, the customers, the brand, the data, the store listings and the income. Those are yours in ways that do not depend on a copyright question about generated code. More on selling this kind of project is in can you sell vibe-coded apps.
What should a buyer ask?
If you are on the other side of the deal, ask five things during due diligence.
- Which tools produced the code, under which plan and terms?
- Who else worked on it, and where are their assignments?
- Which open-source licences are in the dependency tree?
- Is the product a copy of something that already exists?
- What exactly does the seller promise about ownership in the agreement?
Then take the answers to your own lawyer before you sign.
Sources
- Copyright Office Releases Part 2 of Artificial Intelligence Report, US Copyright Office - checked 17 November 2026
- Copyright and Artificial Intelligence, US Copyright Office - checked 17 November 2026
- Copyright, Designs and Patents Act 1988, section 9, legislation.gov.uk - checked 17 November 2026
Related: can-you-sell-vibe-coded-apps, ip-assignment, representations-and-warranties, sell/vibe-coded-app
See what a business at this level is listed at.
Everything on sale between $50,000 and $150,000, on the same fields.