In the United States, code that an AI produced on its own is not protected by copyright, so nobody owns it in the copyright sense. Code that people write, rewrite, or creatively select and arrange is protected, even when an AI assistant helped, and whether a given file crosses that line is decided case by case. Your AI vendor's terms usually give you whatever rights the vendor has in the output, but a contract cannot create copyright the law does not grant. The UK is different for now: it protects "computer-generated works", although the government proposed removing that protection in March 2026. None of this is legal advice; for a real dispute or a large deal, ask an IP lawyer in your jurisdiction.

Short version
Prompting is not authorship. Reviewing, restructuring and rewriting AI output, and designing how the pieces fit together, is. If ownership of a codebase matters to you or your client, make sure people are doing real authorship work, keep the history that shows it, and put ownership and AI-use terms in the contract.

Why this is in the news

On November 15, 2026 an essay titled "All AI-generated code should be Open Source" reached the top of Hacker News, with 1,118 points and 602 comments when we checked. Its author argues that models trained on openly licensed code should not be used to produce closed code, and that purely AI-generated code should not be copyrightable. That second point is close to what US law already says. Google autocomplete shows people asking the same question: it suggests "who owns ai generated code", "can ai generated code be copyrighted", "ai generated code is not copyrightable" and "can ai generated code be licensed". Autocomplete shows that a phrase is searched, not how often.

What US law says

The Copyright Office's 2025 conclusions

Part 2 of the US Copyright Office's report on Copyright and Artificial Intelligence, published January 29, 2025, deals with exactly this question. Its main conclusions:

The report does not set a special rule for software. It does mention that programmers have long used automated tools to refactor code and translate it between languages, as an example of assistive use.

The courts: Thaler v. Perlmutter

On March 18, 2025 the US Court of Appeals for the D.C. Circuit upheld the refusal to register a work that Stephen Thaler listed as created by his AI system, holding that the machine cannot be the author. The court also said the human authorship requirement "does not prohibit copyrighting work that was made by or with the assistance of artificial intelligence"; it requires that the author be a human being, such as the person who used the AI. Thaler asked the Supreme Court to hear the case, and the Supreme Court's docket (No. 25-449) shows the petition was denied on March 2, 2026. The appeals court decision stands.

Registering code that contains AI output

If you register software with the Copyright Office, its March 2023 registration guidance says applicants "have a duty to disclose the inclusion of AI-generated content" and to briefly explain the human author's contribution. AI-generated content that is more than de minimis "should be explicitly excluded from the application", and an AI tool or the company behind it should not be listed as an author. A registration that hides substantial AI content risks being challenged later.

What this means for a real codebase

The law looks at expression, so the useful question is not "did we use Copilot or Claude?" but "which parts reflect human creative choices?". Applying the Copyright Office's principles to software is our reading, not an official test:

How the code came aboutLikely position in the US
A developer writes the code, with AI autocomplete for small fragmentsProtected; the AI is assisting, not standing in for the author
An agent generates a module from a prompt and it is merged unchangedProbably not protected; prompts alone are not enough control
AI output that a developer substantially rewrites, restructures or combines with their own codeThe human modifications and arrangement are protected; untouched AI passages may not be
A codebase whose architecture, module boundaries and integration are designed by people, with AI filling in partsThe human selection and arrangement is protected as a whole; individual purely AI-generated pieces may not be

Two practical consequences follow. First, purely AI-generated parts of your code may not be something you can stop others copying with copyright alone, so confidentiality and contracts matter more. Second, if ownership might ever be argued over (an acquisition, a dispute with a contractor, a registration), the record of who designed, reviewed and rewrote what is your evidence. Commit history, pull request reviews and design documents are that record.

What UK law and the EU say

The UK has protected computer-generated works since 1988. Section 9(3) of the Copyright, Designs and Patents Act says that for a computer-generated work "the author shall be taken to be the person by whom the arrangements necessary for the creation of the work are undertaken", and the protection lasts 50 years from creation. The UK government's report on copyright and AI, published March 18, 2026 after its 2024 to 2025 consultation, says most respondents wanted works created solely by AI to lose that protection. The government proposed that "this specific type of protection should be removed", while copyright continues to protect works created with AI assistance. As of that report this is a proposal; check whether legislation has followed before relying on either position.

The same UK report notes that the EU has no specific protection for computer-generated works without a human author, and that wholly AI-generated outputs are unlikely to be protected there, because the EU originality standard is tied to human creativity. Our guide to AI regulations and laws worldwide covers the wider rules.

What AI vendors' terms say about your outputs

Vendor termsOwnership of outputIP protection offered
Anthropic Commercial Terms (effective June 17, 2025)Customer "owns its Outputs"; Anthropic assigns its rights in Outputs "(if any)"Defends paid use against third-party claims that Outputs infringe IP, with exclusions such as Customer modifications, combination with other technology or content, and use the customer knows or should know infringes
Anthropic Consumer Terms (effective October 8, 2025)Anthropic assigns its rights in Outputs, "if any", subject to compliance with the termsNone found for users
Google Gemini API Additional Terms (effective March 23, 2026)"Google won't claim ownership over that content"; Google may generate the same or similar content for othersNone in these additional terms; you are responsible for your use of generated content
GitHub Copilot product terms (October 2024 version, deprecated March 5, 2026)"GitHub does not own Suggestions"Defence applies if your main agreement provides it; new subscriptions now fall under GitHub's Generative AI Services Terms, which we have not reviewed

Notice the words "if any". A vendor can only pass on rights it has, and for purely AI-generated output there may be none to pass on. The ownership clause settles that the vendor will not claim your code; it does not settle whether anyone can. We could not read OpenAI's terms for this post, so they are not in the table.

The open-source licence question

The Hacker News essay's other argument is about licences: models are trained on open-source code under licences that require attribution, so generated code may carry that code with it. That risk is real when output closely matches existing code. GitHub's own Copilot documentation says that "while the probability is low", Copilot may produce suggestions that match training code, and that "users assume all risks associated with generated code including security vulnerabilities, bugs, and IP infringement". Copilot has a duplication detection filter that organizations and individuals can set to block suggestions matching public code, or to show references to the matching code. Whether training itself infringes is a separate, unsettled question that we cover for images in how AI image generators use copyrighted art.

A checklist for teams and clients

  1. Put it in the contract. If you commission software, the agreement should assign to you whatever rights the developer has in the deliverables, say whether and how AI coding tools may be used, and say who carries the risk if code turns out to match someone else's. Our guide on how to evaluate an AI agency lists other questions to ask.
  2. Keep humans doing the authorship. People should design the architecture, review every change and rewrite what does not fit. That is good engineering anyway, and it is what the law protects.
  3. Keep the record. Commits, reviews and design notes show human contribution if ownership is ever questioned.
  4. Turn on public-code filters and scan licences. Block or flag suggestions that match public code, and run your usual open-source licence scan on the whole repository.
  5. Use business terms, not consumer plans, for company code. Commercial terms are where output ownership and IP defence commitments are clearest, and they matter for data handling too (see zero data retention for AI APIs).
  6. Disclose AI content if you register. Follow the Copyright Office guidance and exclude substantial AI-generated parts.
  7. Set company policy centrally. Which tools, which plans and which settings, enforced rather than suggested; for Claude Code see managed settings for company policy.

How we approach this

We use AI coding tools in our own engineering, with engineers responsible for design, review and the final shape of the code. When clients ask who owns what we build, our advice is to settle it in the contract, keep the commit and review history, and have their own lawyer check the IP clauses against the law where they operate. If you are planning an AI build and want to talk through how it will be delivered, get in touch.

Sources (read November 16, 2026): US Copyright Office, Copyright and Artificial Intelligence, Part 2: Copyrightability (January 2025), US Copyright Office, registration guidance for works containing AI-generated material (88 Fed. Reg. 16190, March 2023), Thaler v. Perlmutter, D.C. Circuit, March 18, 2025, Supreme Court docket 25-449, UK government, Report on Copyright and Artificial Intelligence (March 2026), Anthropic Commercial Terms, Anthropic Consumer Terms, Gemini API Additional Terms, GitHub Copilot product specific terms (archived), GitHub, responsible use of Copilot code completion, "All AI-generated code should be Open Source". Hacker News figures from the Hacker News search API on November 16, 2026. This post is general information, not legal advice.