Who owns AI-generated code depends on which of four questions you are asking, because the answers do not line up. The tool’s terms of service usually say you own the output. US copyright law says a machine’s output may have no owner at all unless a person added enough creative work. Your employer’s contract may claim it anyway. And if the output copies someone else’s code, you may owe that person something.

This post takes each layer in turn, for text as well as code, under US law. It also covers what changed in September 2026, when the Ninth Circuit ruled in the GitHub Copilot case.

Four layers, four different owners

Layer Question it answers Typical answer
Contract with the AI company Does the vendor claim your output? No. Major vendors say you own it or assign their rights to you
Copyright law Does anyone hold a copyright in it? Only for human-authored parts
Employment or client agreement Does your boss or customer own what you make? Often yes, if made within your job or by contract
Third-party rights Is it copying somebody else’s work or licence? Possible, and not ruled out by the first three layers

Layer one: what the AI company’s terms say

The vendors have converged on a similar position. OpenAI’s terms of use, effective January 1, 2026, say that you keep rights in what you put in and own what the service generates for you, and that OpenAI transfers to you any rights it might have in the output, subject to applicable law. The terms add that outputs may not be unique, so another user can receive something similar, and that the transfer does not reach other users’ outputs.

Anthropic’s commercial terms, effective June 17, 2025, are close to that: the customer owns the outputs, and Anthropic assigns whatever rights it has in them, provided the customer follows the terms. They also say Anthropic may not train models on customer content from those services. Those terms, which govern business customers, also contain an intellectual-property indemnity. Microsoft has made a comparable promise for its paid Copilot products, discussed below.

Read the qualifier “whatever rights it has.” A company cannot hand over a copyright that does not exist. If the law gives no one a copyright in the raw output, the contract gives you the practical position of being the only party with a claim, but it does not stop a stranger from copying that raw output. Terms also differ between consumer and business plans and change over time, so check the version that governs your account.

Layer two: what copyright law says

US copyright protects human authorship. The Copyright Office’s January 2025 report concluded that prompts alone do not give users enough control over the expression to count as authors of what a current tool produces. That analysis is not limited to pictures. It applies to text and code on the same reasoning. The D.C. Circuit’s 2025 decision in Thaler v. Perlmutter, which the Supreme Court declined to review in March 2026, held that a work needs a human author in the first instance. The long version of that story is in a companion post on whether you can copyright AI-generated art.

For code, the practical consequences look like this.

  • Generated boilerplate, left untouched. Probably not protected. Anyone could copy it without breaching copyright, although a contract or a confidentiality duty might still restrict them.
  • Code you wrote with AI suggestions that you chose, rewrote and structured. Your human contributions can be protected, including your selection, arrangement and modifications. The O’Reilly Radar article on this topic stresses that choosing an architecture, rejecting alternatives and reshaping output to fit a design is what counts, not handing a model a broad goal.
  • Design documents, specifications and test plans you wrote. These are ordinary human authorship, even if the code beneath them is not.
  • Prose. The same split: a report you drafted and heavily rewrote carries more protection than a chatbot answer pasted in unchanged.

No court has yet ruled specifically on AI-generated source code and copyright authorship. What exists is the Office’s general framework, and it leaves the amount of human input as a judgment call.

Layer three: your employer or client

Copyright’s work-made-for-hire rules operate regardless of who or what drafted a first pass. The Copyright Office’s circular on the subject explains that when an employee creates a work within the scope of the job, the employer is treated as the author and initial owner. Courts look at things like who controlled the work and where and with which tools it was made.

For freelancers the rule is stricter. A commissioned work counts as made for hire only if it falls into one of nine statutory categories and the parties have signed a written agreement saying so. Software does not obviously fit those categories, which is why client contracts normally contain an assignment clause instead. If yours does, the AI tool does not change it: you assign whatever rights you hold.

Two practical traps follow. First, employment agreements often claim inventions and works that relate to the company’s business or that use company resources, and some mention company-licensed software. Using a company-paid AI account for a weekend project can give an employer a better argument than it otherwise would have, even if a court might not accept it. Second, if your contract requires you to disclose or keep confidential what you build, pasting company code into a consumer chatbot may breach it regardless of ownership.

Layer four: other people’s rights inside the output

A model trained on public code can sometimes produce text close to something it saw. If that text is under an open-source licence with conditions, such as attribution or a requirement to publish your own source under the same terms, the conditions may follow the snippet into your product, whatever your vendor’s terms say.

This is where the most recent ruling lands. On September 16, 2026, the Ninth Circuit decided Doe v. GitHub, No. 24-7700. Programmers had argued that Copilot and OpenAI’s Codex reproduced their code without author names or licence terms, in violation of the DMCA’s section on copyright management information. The court affirmed dismissal of those claims. In its reasoning, as law firm summaries describe it, the tools generated new code that never contained that information, so leaving it out was not removing or altering it from existing copies.

Two cautions keep that from being a clean win for users. The court limited its holding to that DMCA provision and did not decide whether output that reproduces copyrighted code infringes copyright. And the plaintiffs’ breach-of-contract claims over the open-source licences were reported by Ropes & Gray as still pending. Licence conditions can be enforced as contract terms even where the DMCA theory fails.

What the vendors will and will not stand behind

Microsoft’s Copilot Copyright Commitment, announced in 2023, promises to defend paying commercial customers sued over their use of its Copilot services or their output, and to cover adverse judgments or settlements. It is conditioned on using the built-in content filters and guardrails, not trying to generate infringing material, and not submitting input you have no right to use. Anthropic’s commercial indemnity covers third-party infringement claims about paid use or outputs, but excludes claims arising from your modifications, your combining outputs with other technology, your own inputs, knowing infringement, patented inventions in an output, and trademark claims from trade use. Neither is a promise that your codebase will be free of licence obligations.

A practical checklist

  1. Read the right terms. Find the contract that governs your actual account, personal or business, and note the effective date.
  2. Read your employment or client agreement. Look for assignment, resources and confidentiality language before using an AI tool on anything valuable.
  3. Keep human work visible. Save design notes, commit messages and prompt logs that show your decisions. They help prove authorship if protection ever matters.
  4. Scan before you ship. Run a licence scanner over code that goes into a product or an acquisition data room.
  5. Use the safety settings. Where a tool offers filters that block suggestions matching public code, turn them on, since indemnities may depend on them.
  6. Do not rely on exclusivity. Assume an unmodified output could also be produced for someone else.

Related questions

Can I sell something an AI wrote for me? Generally you can sell or license a copy, and the vendor terms above do not stop you. What you cannot count on is stopping others from copying the unmodified portions.

Does using AI change who owns my code at work? Not by itself. Ownership between you and your employer turns on your contract and the scope of your job. AI use does not move the line, though company tools or accounts can strengthen the employer’s argument.

Do I have to tell anyone I used AI? There is no general US rule requiring it. Registering with the Copyright Office does require disclosing more than minimal AI-generated content, and contracts or school and employer policies may impose their own duties.

This is general information for the United States, not legal advice. For anything that affects a company or a product launch, ask a lawyer who handles software licensing.

Sources