Who Owns AI-Generated Code?

Who owns code written by AI tools like Copilot — copyright and human-authorship rules, license risk from training data, and how to reduce exposure.

A developer using an AI coding assistant that suggests code inline
AI assistants can draft code in seconds, but copyright still turns on human authorship. Shutterstock
Educational guide, not legal advice. This article explains general legal concepts and is not a substitute for advice from an attorney licensed in your jurisdiction. Reading it does not create an attorney–client relationship.

Quick answer: Nobody automatically "owns" AI-generated code the way they own code a person writes. Under U.S. law, copyright protects only works of human authorship, so code a tool produces with no meaningful human creativity may not be copyrightable at all — it sits in an unprotected zone anyone can copy. Code you meaningfully write, edit, and arrange with AI help can still be protected, and the leading tools (GitHub Copilot, ChatGPT, Cursor) assign their output rights to you in their terms of service. The bigger risks are that the output isn't protectable and that it may reproduce open-source code carrying license obligations, so review, scan, and document everything before you ship.

AI coding assistants now write a meaningful share of the code shipping in real products. That raises a question founders and engineering leads keep asking too late: if a tool wrote it, who owns AI-generated code — you, the vendor, everyone, or no one? The answer sits at the intersection of copyright’s human-authorship rule, your tool’s terms of service, and the open-source licenses buried in the training data. This guide is the software-and-ownership lens; for the general doctrine across all AI outputs — images, text, music — start with who owns AI output.

Can AI-generated code even be copyrighted?

Start with the threshold question, because it changes everything downstream: much AI-generated code may not be copyrightable in the first place.

U.S. copyright protects original works of authorship — and the courts and the Copyright Office read “authorship” to mean human authorship. Copyright is not free-floating protection for anything valuable; it protects the creative choices of a human being. When a machine produces the expressive content, there is no human author, and no copyright attaches to that portion.

For code, that means:

  • Purely prompt-generated code — you type a request, the model emits a function, you paste it in unchanged — has a weak claim to protection, because the expressive choices were the machine’s, not yours.
  • Human-authored and human-edited code is protectable in the normal way. If you write the architecture, select and arrange components, refactor, debug, and make the creative decisions, you are the author.
  • Selection and arrangement of even unprotectable elements can earn a thin compilation copyright when a human does the selecting and arranging.

The practical upshot: the more a human meaningfully shapes the code, the stronger the copyright. Fully autonomous output is where protection thins out — and where a competitor could, in theory, copy it freely. To see how courts treat authorship disputes generally, browse the copyright case archive.

Two authorities frame the human-authorship rule, and both are current as of 2026.

Thaler v. Perlmutter. Stephen Thaler tried to register a visual work he said was created autonomously by an AI system he called the “Creativity Machine,” listing the machine as author. The Copyright Office refused. The U.S. District Court for the District of Columbia upheld the refusal in 2023, and the U.S. Court of Appeals for the D.C. Circuit affirmed in March 2025, squarely holding that the Copyright Act requires a human author and a work generated entirely by a machine, with no human creative input, cannot be registered. It is the clearest appellate statement to date that autonomous AI output is not copyrightable.

Copyright Office guidance. The Office issued its AI registration guidance in March 2023 and, in January 2025, released Part 2 of its AI report, “Copyrightability,” reaffirming the same line: works are registrable to the extent a human contributes original expression, and applicants must disclaim material that was generated by AI. Prompts alone — even long, detailed ones — generally do not make the user the author of the output, because the user doesn’t control the expressive result the way an author does.

For code, that translates into a registration practice: if you register a program that includes AI-generated portions, you disclose and disclaim those portions and claim only the human-authored code. Overclaiming risks your registration being invalidated later — a real problem if you ever need to sue.

Who owns the code your AI assistant helps you write?

Most real-world coding isn’t “autonomous.” It’s a developer and an assistant going back and forth — the tool suggests, the human accepts, rejects, edits, and integrates. Who owns that?

Two questions have to be answered separately:

  1. Is it copyrightable at all? Governed by the human-authorship rule above. Genuine collaborative authorship — where the human makes meaningful creative choices — is protectable; rubber-stamped output is not.
  2. If it is copyrightable, who is the owner? Governed by ordinary copyright ownership rules, not anything special about AI. If an employee writes it within the scope of employment, it’s a work made for hire and the employer owns it. If a contractor writes it, the contractor owns it unless there’s a written assignment — the same trap that catches companies with logos and freelance work, covered in who owns work a freelancer creates and, for startups, who owns your startup’s IP.

So the AI in the loop doesn’t change your assignment hygiene — it raises the stakes. You still need employee invention-assignment agreements and contractor IP assignments. What AI adds is a second layer of doubt: even a perfect assignment only transfers whatever copyright exists, and if the code isn’t copyrightable because a human didn’t author it, there may be little to assign.

The hardest cases sit in the middle. Line-by-line autocomplete — the inline suggestion you glance at and accept — is a genuine gray area neither the courts nor the Copyright Office have fully mapped. A short, obvious completion (closing a loop, filling in a boilerplate getter) probably adds nothing a human “authored,” while a developer who prompts, evaluates, rejects several drafts, rewrites, and stitches the result into a larger design is exercising exactly the creative judgment copyright rewards. The safest posture is to assume that authorship scales with the human contribution: the more you shape, select, and revise, the more defensible your claim, and the more of the codebase you can honestly claim on a registration.

Does your AI tool’s terms of service give you ownership?

Yes — as far as the vendor is able to give it. The major coding and general-purpose tools address output ownership directly in their terms, and the pattern is consistent:

  • The provider assigns to you (the user) whatever rights it has in the output the tool generates for you.
  • The provider usually disclaims warranties about the output — including that it’s original, non-infringing, or protectable.
  • Some terms note that other users may receive similar or identical output, which itself undercuts any claim to exclusivity.

Read that carefully, because it’s a limited promise. A vendor can only transfer rights it actually holds. If the output isn’t copyrightable (no human author) or if it reproduces third-party licensed code, the vendor has no exclusive right to hand you — the assignment clause conveys an empty box for that snippet. The terms of service settle the vendor-vs-you question; they do not make the code protectable and they do not shield you from a third party whose licensed code the model reproduced.

Always check your specific tool’s current terms, and layer AI-specific terms into your own customer and contractor agreements. Our guide on AI clauses in contracts covers the representations, warranties, and indemnities worth adding.

What is the license risk from training data?

This is the risk most teams underestimate. AI coding assistants are trained on enormous corpora of public code — much of it under open-source licenses like the GPL, LGPL, MPL, Apache 2.0, and MIT, each with its own conditions (attribution, notice, or, for copyleft licenses, an obligation to release derivative source). Models can occasionally emit near-verbatim snippets of that training code. When they do, the license conditions attached to the original code arguably travel with it — even though no one clicked “accept.”

The flagship dispute is Doe v. GitHub, Inc. in the Northern District of California, the class action filed in November 2022 against GitHub, Microsoft, and OpenAI over GitHub Copilot. The plaintiffs alleged Copilot reproduced their open-source code without honoring license terms and stripped copyright-management information. Through 2024 rulings the court narrowed the case sharply — dismissing the DMCA Section 1202 copyright-management-information claims, among others — while breach-of-contract theories tied to the open-source license terms were the center of what remained. However the case ultimately resolves, its lesson is already actionable: AI-suggested code can carry someone else’s license obligations, and “the AI wrote it” is not a defense to a license violation.

The exposure is sharpest for copyleft (GPL-style) code. If a copyleft snippet lands in your proprietary product, the license’s terms can, in principle, reach your combined work — the classic open-source “contamination” fear. Understanding which licenses can coexist is essential; we break that down in open-source license compatibility and, at the program level, in the open-source and software IP guide.

You can’t eliminate the uncertainty, but you can manage it down to a routine. A workable AI-code risk program has four layers:

  • Treat AI output as untrusted input. Require a human to review, understand, and edit every suggestion before it merges. This both strengthens your authorship claim and catches copied snippets.
  • Scan the pipeline. Run code-similarity / provenance detection (many enterprise AI tools now offer a “block suggestions matching public code” setting) and software-composition analysis for license compliance as part of CI, not as an afterthought.
  • Keep provenance records. Track which components were AI-assisted, which tool and version produced them, and who reviewed them. You’ll need this both to register copyright accurately and to respond if a license claim arrives.
  • Write it into policy and contracts. Adopt a company AI-coding policy (approved tools, review requirements, prohibited uses) and add representations, warranties, and indemnities about AI-generated deliverables in your contractor and customer agreements — see AI clauses in contracts.

For anything you intend to register, license, or sell, go further: make sure a human meaningfully authored the code so you actually have an enforceable copyright to assert. The same principle applies beyond code — if you’re using AI-generated assets in a product, using AI images and music commercially walks through parallel diligence.

Which protection actually covers your software?

Copyright is only one lever for software, and AI muddies it, so it’s worth remembering what else is on the table. Functional aspects of software may be reachable through patents (if novel and non-obvious — see can you patent an app), and confidential logic can be held as a trade secret, which doesn’t depend on human-authorship rules at all. Copyright and patents also protect different things in the same program — the line between them is worth understanding, which is why we cover it in software patent vs. copyright. For a fast map of the options, see which IP protection do you need and trademark vs. copyright vs. patent.

For AI-heavy codebases where copyright is shaky, trade-secret protection of your proprietary pipeline and prompts is often the more durable play. Trade secrecy turns on reasonable secrecy measures — access controls, confidentiality agreements, and internal handling rules — rather than on who or what typed the code, so it neatly sidesteps the human-authorship problem for code you keep out of public view. The practical steps for locking that down are in how to protect source code.

The bottom line

Who owns AI-generated code comes down to three layers. First, copyright only protects human authorship — after Thaler and the Copyright Office’s 2023–2025 guidance, purely machine-generated code may not be protectable at all, so the more a human meaningfully shapes it, the stronger your rights. Second, your tool’s terms of service assign its output rights to you, but a vendor can’t transfer rights it doesn’t have. Third, the sleeper risk is training-data license exposure — as the GitHub Copilot litigation shows, AI output can carry open-source obligations you never agreed to. Manage it with human review, license and similarity scanning, provenance records, and contracts that put the risk where it belongs.

This guide is general education, not legal advice, and does not create an attorney-client relationship. AI, copyright, and open-source law are evolving quickly and outcomes depend on your specific tools, licenses, and jurisdiction — consult an attorney licensed in your jurisdiction before acting.

Frequently asked questions

Can you copyright code written by AI?

Only the parts a human authored. The U.S. Copyright Office requires human authorship, so purely machine-generated output — code produced by a prompt with no creative human contribution — is not copyrightable and falls into an unprotected zone. Code you meaningfully write, edit, arrange, and select can be protected, but you must disclaim the AI-generated portions when you register. Autocomplete-style suggestions you review and integrate are a gray area courts and the Office are still mapping.

Who owns code generated by GitHub Copilot or ChatGPT?

Under the major tools' terms of service, the provider assigns whatever rights it has in the output to you, the user. But a tool can only transfer rights it actually holds — and if the output isn't copyrightable (no human author) or reproduces someone else's licensed code, there may be no exclusive right to assign. So the terms give you ownership of your side of the bargain, not a guarantee the code is protectable or free of third-party claims.

Does AI-generated code infringe open-source licenses?

It can. AI coding tools are trained on public repositories, including GPL and other copyleft code, and can occasionally emit near-verbatim snippets that carry license obligations. The GitHub Copilot litigation (Doe v. GitHub) tested exactly this. The safest practice is to treat AI output as untrusted: scan for copied code, check license compatibility, and keep attribution records before shipping it in a product.

How do I protect my company from AI code license risk?

Adopt a written AI-coding policy, require human review of every suggestion, run license and code-similarity scanning in your build pipeline, and keep provenance records of what was AI-assisted. In contracts, add representations and indemnities addressing AI-generated deliverables. For anything you plan to register or license, ensure a human meaningfully authored it so you have an enforceable copyright to assert.

Lidiia Levitska
About the Author

Lidiia Levitska

International Intellectual Property Attorney

Lidiia Levitska focuses on intellectual property dispute resolution, policy, and advisory work across international institutions and government bodies. From 2021 to 2025 she served at the World Intellectual Property Organization (WIPO), managing arbitration cases and overseeing compliance with the Uniform Domain-Name Dispute-Resolution Policy (UDRP), and earlier led IP policy research as a Senior Policy Officer at the American Chamber of Commerce in Ukraine. She holds an LL.M. in International Intellectual Property Law from Chicago-Kent College of Law and an M.A. in Information Technology Law from the University of Tartu, and was admitted to the Ukrainian Bar in 2019.

More about Lidiia →