Who Owns Generated Code
"Who owns it" hides three separate questions. Can anyone hold copyright in code an agent generated? Does that code carry somebody else's licence? And can you show which parts were generated, if someone asks? As of 2026 the first is settled in some places and open in others, the second has a plain answer, and the third is the one you control.
This page states the position plainly, as of October 2026. It is not legal advice. A question about a real contract, a real acquisition or a real dispute goes to a lawyer, and the purpose of this page is to let you ask that lawyer a precise question.
Copyright Needs a Human Author
In the United States the position is clear at the level of principle. In January 2025 the Copyright Office published its report on copyrightability and concluded that generated output is protected only where a human author has determined sufficient expressive elements. Creative arrangement or modification of the output by a person can be protected; the mere provision of prompts is not enough.
The courts agree on the underlying rule. In March 2025 the federal appeals court in Washington held, in a case about an image a machine had generated on its own, that the Copyright Act requires all work to be authored in the first instance by a human being. In March 2026 the Supreme Court declined to hear the appeal, which leaves that ruling in place.
Applied to code, this sorts a repository into parts. The functions an engineer wrote, restructured or substantially edited are protected as usual. A file the agent generated whole and nobody shaped may not be protected at all. And where code is protectable, the ordinary employment rules apply: the employer owns what its employees produce at work. The working loop of this book, where you specify, read, reject, narrow and rewrite, produces a great deal of human shaping, and that is not an accident.
Elsewhere, Unsettled
The United Kingdom is the outlier. Since 1988 its copyright law has protected "computer-generated works" with no human author, giving authorship to whoever made the arrangements for the work to be created. In a report published on 18 March 2026, the government proposed removing that specific protection, on the ground that there was no evidence of its ongoing value, while keeping protection for works made with AI assistance. A proposal in a report is not a change to the statute; that needs legislation.
In the European Union protection follows the author's own intellectual creation, a standard built on human choices, so a work with no human choices in it has nothing to protect. On 10 March 2026 the European Parliament adopted a resolution on copyright and generative AI, which is not binding and calls mainly for clearer rules on licensing material for training. The honest summary across jurisdictions: they agree a human must contribute, and they do not agree how much.
Licences Travel With Copies
The second question has the oldest answer. If generated code reproduces a recognisable block of licensed code, the licence's obligations attach to that block in your repository, however it got there. A function under a copyleft licence inside a proprietary service is the same problem whether a person pasted it from a website or an agent produced it from training. "A model wrote it" is not a licence.
Some assistants offer a filter that blocks suggestions matching public code, or shows a reference to the matched source so you can check its licence. Chapter 15 says which tools have one, as of the month it was checked.
The lawsuits have not changed this. A class action filed in the United States in 2022 against the makers of a code assistant has so far gone against the plaintiffs on their main copyright-management claim: in September 2026 the appeals court affirmed the dismissal of that claim, and the contract claims are still pending. That case concerns what the provider did. Your exposure is narrower and more concrete: the copy sitting in your repository, under your name.
Provider Terms
The tools' terms generally assign to the user whatever rights exist in the output. Some business plans add an indemnity, a promise to defend the customer against infringement claims, usually on conditions. One provider's indemnity, for example, depends on its filter for suggestions matching public code being switched on. Chapter 15 records the one it could confirm; read your own plan's terms before relying on any.
Read those terms for what they can do. A contract can transfer rights that the law grants. It cannot create a copyright the law does not grant. "The terms say the output is ours" means that whatever is protectable belongs to you rather than to the provider, not that everything generated is protectable.
Provenance You Can Show
Sooner or later someone asks which parts were generated: a client whose contract mentions it, an acquirer's lawyer during due diligence, an open-source project you want to contribute to. The answer comes from records made at the time. AI-assisted commits marked with a trailer, as Chapter 9 described. The disclosure line in each pull request, from the team policy in the previous topic. A human review on record for every merge. Reconstructing any of this a year later is guesswork.
Open-source projects have taken positions in both directions. One long-running open-source operating system presumes code generated by a language model to be tainted and does not accept it without prior written approval from its core team. One of the largest open-source projects accepts AI-assisted contributions and forbids the agent from adding the sign-off line, because only a human can certify where the code came from. It asked for an "Assisted-by" tag until October 2026, when its maintainers agreed to drop it and to read how the tools were used in the patch's cover letter instead. Read a project's contribution guide before you open the pull request, not after it is closed.
Cragmoor's Position
The booking service is protected where the team authored and shaped it, which, with the loop of this book, is most of it. The filter for suggestions matching public code is on, in the settings of the team's business plan. And a long, idiomatic block that arrives with a licence-style header, an unfamiliar author's comments or a style unlike anything else in the module is treated as a copy and traced before it is kept.
That last rule has fired once. The agent produced a date-parsing helper for schedule with a comment block crediting a stranger. Kai searched for the comment, found the original under a copyleft licence, and replaced the helper with the standard library's own parser, which was also two lines shorter.
- "The terms say we own the output, so we own it." Terms assign whatever rights exist. They cannot create a copyright the law does not grant to a file nobody shaped.
- "Generated code is public domain, so anyone may copy our repository." The repository is mostly human-authored and shaped work, and it is also protected by contract and confidentiality. Unprotectable fragments are a small subset, not the whole.
- "Licences don't apply because a model wrote it." A reproduced block is a copy, with its licence, whoever or whatever typed it.
- "The lawsuits settled the question." They resolved particular claims against particular providers in particular courts. The rule for the copies in your repository is the old one.
- "Recording AI assistance creates legal exposure." Records are what let you answer the provenance question at all. Without them the answer is a guess, and a guess is worse in due diligence than a record.
- Record AI assistance at commit and pull-request level as you go. Provenance is cheap to record now and impossible to reconstruct later.
- Turn on the tool's filter for suggestions matching public code where it has one. It closes the commonest route to an unlicensed copy, and some indemnities depend on it.
- Trace any long block that looks lifted before keeping it. A licence header or a stranger's comment is a copy's fingerprint.
- Read an open-source project's contribution guide before submitting AI-assisted code to it. Policies range from a description of the tool use to outright refusal, and they change.
Knowledge Check
Under the US position as of 2026, which part of Cragmoor's repository is least likely to be protected by copyright?
- The payment signature check, which the team writes entirely by hand
- A fixture file the agent generated whole and nobody edited afterwards
- The offer logic the agent drafted and Ines restructured substantially
- A module Kai assembled by choosing and arranging several generated parts
A provider's terms say the user owns all output. What do those terms actually do?
- Make every generated file protected by copyright and owned by the user
- Remove any licence obligations attached to code the model reproduced
- Give the user whatever rights exist, without creating new ones
- Guarantee the provider will defend any infringement claim about it
An agent produces a 40-line function that matches a copyleft-licensed project almost exactly. Kai argues that the licence cannot apply because no person copied it. Why is he wrong?
- The block is a copy in the repository, and its licence travels with it
- A 2026 court ruling made agents liable for licences they reproduce
- The provider's terms assign the copyleft obligations to the user directly
- Any code longer than 30 lines is automatically protected by its author
During an acquisition, a lawyer asks which parts of the booking service were AI-generated. What lets Cragmoor answer reliably?
- Asking the agent today to identify which files it originally wrote
- Interviewing the engineers about which files they remember generating
- Running a detector that estimates from style which code looks generated
- Commit trailers and disclosure lines recorded when each change merged
As of 2026, how do the US, the UK and the EU compare on generated works?
- All three have abolished protection for any work an AI system generated
- They agree a human must contribute; the UK statute is the outlier, under review
- The EU and US protect AI output fully, while only the UK requires a human
- They agree exactly on how much human contribution is needed for protection
You got correct