Is AI-Generated Code Copyright Infringement? (2026)

Using an AI coding assistant does not shield you from copyright law. If the tool reproduces protected code and you ship it, you can be liable under 17 U.S.C. § 501, even without knowing. And purely AI-written code may not be copyrightable at all, so you may have nothing to protect.
Information last verified on 2026-06-25. This article presents general legal information about United States federal law, not legal advice. The law on AI-generated works is evolving, and several cases cited below are still on appeal.
Jurisdiction scope: This article addresses United States federal copyright law (Title 17 of the U.S. Code), the human-authorship requirement, and open-source license compliance for software, including AI-assisted and AI-generated code. It does not cover patent or trade-secret law, and it does not address other countries. For the global picture, see how AI and copyright differ worldwide.
For the wider United States picture and how these rules fit together, see our AI, copyright, and code hub.
Is using AI to write code copyright infringement?
Using an AI assistant to write code is not, by itself, copyright infringement. The legal problem arises when the tool reproduces someone else's protected expression and you copy, distribute, or build on it. Under 17 U.S.C. § 106, only the copyright owner may reproduce a work, prepare derivative works, or distribute copies. Under 17 U.S.C. § 501, anyone who violates those rights is an infringer. The statute sets no knowledge requirement, so infringement does not turn on whether you realized the output came from protected code.
Two separate questions follow, and people routinely blur them. First, did the AI reproduce protected expression that you then shipped? If so, you may be liable regardless of intent. Second, can you own what the AI produced for you? Often you cannot, because United States law protects only human authorship. The sections below work through both questions, then turn to the open-source license rules that decide most real-world disputes.
Copyright is federal, not state: one national rule
There is no state copyright statute for software. Copyright is governed exclusively by federal law. Section 301 of Title 17 preempts any state-law right that is equivalent to copyright in a fixed work, so California, Texas, and New York all apply the same federal Copyright Act to code. This is why "copyright by state" guides do not exist: the rule does not vary from one state to the next.
"On and after January 1, 1978, all legal or equitable rights that are equivalent to any of the exclusive rights within the general scope of copyright as specified by section 106 ... are governed exclusively by this title." 17 U.S.C. § 301(a)
What can vary by state are the related claims a plaintiff adds alongside copyright. Trade-secret misappropriation runs under each state's version of the Uniform Trade Secrets Act, and breach of a license agreement runs under state contract law. Those are separate causes of action layered on top of the single federal copyright rule, not state copyright law.
"I did not know the AI copied it" is not a defense
Copyright infringement is a strict-liability wrong. Section 501 makes anyone who violates an exclusive right an infringer, with no element of intent or knowledge. The Supreme Court stated the principle as early as 1931 in Buck v. Jewell-LaSalle Realty Co., holding that "intention to infringe is not essential under the act." Innocence changes the price, not the verdict.
Statutory damages scale with fault, not with whether infringement occurred:
| Scenario | Statutory damages per work | Authority |
|---|---|---|
| Standard infringement | $750 to $30,000 | 17 U.S.C. § 504(c)(1) |
| Innocent infringer | as low as $200 | 17 U.S.C. § 504(c)(2) |
| Willful infringement | up to $150,000 | 17 U.S.C. § 504(c)(2) |
So a developer who unknowingly ships AI output that reproduced protected code can still be liable. The lack of knowledge may shrink the damages award, but it does not erase the claim. One procedural point matters before any suit: under 17 U.S.C. § 411(a), and the Supreme Court's decision in Fourth Estate Public Benefit Corp. v. Wall-Street.com, the owner of a United States work must obtain an actual copyright registration, not just file an application, before suing for infringement.
Open source is not free to take: comply with the license
"Open source" does not mean public domain. Open-source code is copyrighted, and it is released under a license that grants broad rights only if you meet its conditions. The Open Source Initiative's definition requires that these licenses allow redistribution and modification, but the grant is conditional, not a surrender of the author's copyright.

The conditions fall into two families. Permissive licenses mainly require attribution. Copyleft licenses also require that what you build and distribute stays open.
| License | Type | Core obligation |
|---|---|---|
| MIT, BSD | Permissive | Keep the copyright notice and license text in copies |
| Apache 2.0 | Permissive | Keep notices and the NOTICE file, state changes, includes a patent grant |
| GPL, LGPL | Copyleft | Distribute derivative works under the same license, with source |
| AGPL-3.0 | Network copyleft | Same as GPL, plus offer source to users who interact over a network (§ 13) |
The AGPL network clause catches many software-as-a-service builders by surprise. Under section 13 of the AGPL-3.0, if you modify the program and let users interact with it remotely over a network, you must offer those users the corresponding source, even though you never distributed the code as a download.
Courts enforce these terms with real teeth. In Jacobsen v. Katzer, the Federal Circuit held that open-source license conditions run with the copyright grant, so violating them is copyright infringement, not merely breach of contract, which opens the door to statutory damages and injunctions. In Artifex Software v. Hancom, a federal court also treated the GPL as an enforceable contract. More recently, in Software Freedom Conservancy v. Vizio, a California state court allowed the theory that even end users of a GPL product can sue as third-party beneficiaries to enforce the source-code obligation. The practical lesson is blunt: shipping copyleft code inside a closed, commercial product without complying is both copyright infringement and license breach, and saying an AI tool generated it does not change who is distributing the result.
Does the AI tool or its maker share the blame?
Liability for shipping infringing output generally falls on the party who distributes it, which is usually you, not the tool vendor. Whether the AI vendor also bears responsibility is being litigated. In Doe v. GitHub, developers sued GitHub, Microsoft, and OpenAI over the Copilot coding assistant, arguing it reproduced their open-source code and stripped copyright-management information. In September 2024 the court dismissed the federal DMCA section 1202 claims, applying an "identicality" requirement that most Copilot outputs do not meet, while breach-of-contract and open-source-license claims survived. The DMCA question went up to the Ninth Circuit, which heard argument in February 2026, with no decision issued as of the middle of that year.
The related fight over training data is splitting courts. In Thomson Reuters v. Ross Intelligence, a court rejected a fair-use defense where a non-generative AI was trained on a competitor's copyrighted material to build a directly competing product. In Bartz v. Anthropic and Kadrey v. Meta, by contrast, courts found that training large language models on books was transformative and therefore fair use, though Anthropic still faced liability for sourcing pirated copies in the first place. Most of these proceedings are still active or were resolved by settlement rather than by a final appellate decision, and they address training, not who owns the output.
Can you even own AI-generated code?
Often you cannot. United States copyright protects only works of human authorship. In Thaler v. Perlmutter, the D.C. Circuit affirmed in March 2025 that the Copyright Act requires a human author, and the Supreme Court denied review in 2026, leaving that holding in place. The court was careful to say this does not bar protection for work made with the assistance of AI; it bars protection for work authored by AI alone.
The Copyright Office reached the same conclusion in its January 2025 report on AI copyrightability: AI output is protectable only to the extent a human exercised creative control over the expression, and prompting alone generally does not supply that control. Its registration guidance, published at 88 Fed. Reg. 16,190, requires applicants to identify and disclaim purely AI-generated portions of a work.
The practical consequence is sharp. If your codebase was generated by an AI tool with little or no human creative input, you may hold no enforceable copyright in those portions, and a competitor could copy them freely. Yet you can still be liable if the same tool reproduced someone else's protected code. Practitioners describe this asymmetry as "all the liability, none of the protection."
Two companies, one AI, similar code: who infringes?
Probably neither, on copyright grounds alone. Copyright protects against copying, not against independent creation. In Feist Publications v. Rural Telephone Service, the Supreme Court held that originality means a work was independently created by its author rather than copied. So if Company A and Company B each prompt the same AI and receive similar code, without either copying the other, the similarity by itself does not make one liable to the other. A plaintiff must prove actual copying, typically by showing access plus substantial similarity.

The AI twist cuts deeper. If the overlapping code is purely AI-generated, it may not be copyrightable for either side, so there may be nothing to sue over. The more realistic risk in that scenario is not the two companies suing each other; it is that both pulled from a model that reproduced a third party's protected code, which exposes both of them to that third party.
How to lower your legal risk with AI coding tools
The law is unsettled at the edges, but the risk-reduction playbook is fairly settled. The following are steps organizations commonly take; they are general practices, not legal advice for your specific situation.

- Scan AI output for license provenance with software-composition-analysis tools before it ships.
- Treat copyleft matches (GPL, LGPL, AGPL) as stop-the-line events, and isolate or rewrite rather than embed them in closed code.
- Preserve copyright notices and NOTICE files for any permissively licensed components you keep.
- Document meaningful human authorship, such as selection, arrangement, and modification, if you want to claim any copyright in the result.
- Read your AI tool's terms for the scope and limits of any output indemnification it offers.
- For business-critical code, have counsel review the license posture before launch.
Next steps
The fast-moving part of this topic is who bears liability when a model reproduces its training data, and whether AI output can ever be owned. Both are in active litigation. To see how the pieces connect for United States readers, start with the AI, copyright, and code hub. If you build or sell across borders, compare the worldwide rules, where Europe in particular imposes stricter training-transparency duties. For the related question of using open-weight AI models in a product, see AI model licensing and open-source attribution.
This is general legal information, not legal advice. It describes United States federal copyright law as of 2026-06-25 and does not address your specific facts. Copyright disputes are fact-specific, and the law on AI-generated works is evolving, with several cited cases still on appeal. Consult an attorney licensed in your jurisdiction before making decisions about AI-generated or open-source code.
Related articles
- AI, copyright, and code in the United States
- How AI and copyright differ worldwide
- AI model licensing and open-source attribution
- AI laws and regulation in the United States
Last updated: 2026-06-25. Statutes and cases cited reflect their status as of 2026-06-25; several AI-related decisions remain on appeal.
Frequently Asked Questions
Is code written by ChatGPT or Copilot copyrighted?
Purely AI-generated code generally is not copyrightable in the United States, because copyright requires human authorship (Thaler v. Perlmutter; U.S. Copyright Office, 2025). Code where a human made meaningful creative choices may be protected to the extent of that human contribution.
Can I get sued if an AI tool copied open-source code into my product?
Yes. Copyright infringement is strict liability under 17 U.S.C. § 501, so you can be liable even if you did not know. Innocent intent may reduce statutory damages to as low as $200 per work under § 504(c)(2), but it does not eliminate the claim.
Does 'open source' mean I can use the code however I want?
No. Open-source code is licensed copyright, not public domain. You must follow the license, which may require attribution (MIT, Apache 2.0) or that your derivative work also be released under the same open-source license (GPL, AGPL).
What is the AGPL network clause?
Under AGPL-3.0 section 13, if you modify the software and let users interact with it over a network, you must make the corresponding source available to those users, even if you never distribute the code as a download. This commonly affects software-as-a-service products.
Is copyright the same in every US state?
Yes. Copyright is exclusively federal under 17 U.S.C. § 301, so it does not vary by state. State law can still apply to related claims, such as trade-secret misappropriation or breach of a license contract.
Who is liable if Copilot suggests infringing code, me or GitHub?
Liability for shipping infringing output usually falls on the party that distributes it, which is typically the developer. Whether the tool vendor also shares liability is being litigated in Doe v. GitHub, currently on appeal to the Ninth Circuit.
If two companies use the same AI and get similar code, can one sue the other?
Generally no, because copyright does not bar independent creation (Feist v. Rural Telephone). A plaintiff must prove the other party actually copied its code, not merely that the two results look similar.
Can I copyright software I built mostly with AI?
Only the parts reflecting meaningful human authorship. The Copyright Office requires applicants to disclaim purely AI-generated material when registering (88 Fed. Reg. 16,190), and portions with no human creative input may be unprotectable.
Sources and References
- 17 U.S.C. § 301 (federal preemption of state copyright law)(law.cornell.edu)
- 17 U.S.C. § 102 (subject matter of copyright; idea/expression)(law.cornell.edu)
- 17 U.S.C. § 106 (exclusive rights in copyrighted works)(law.cornell.edu)
- 17 U.S.C. § 501 (infringement of copyright)(law.cornell.edu)
- 17 U.S.C. § 504 (remedies; statutory damages, innocent and willful)(law.cornell.edu)
- 17 U.S.C. § 411 (registration as a prerequisite to an infringement suit)(law.cornell.edu)
- Buck v. Jewell-LaSalle Realty Co., 283 U.S. 191 (1931)(law.cornell.edu)
- Fourth Estate Public Benefit Corp. v. Wall-Street.com, LLC, 586 U.S. 296 (2019)(law.cornell.edu)
- Feist Publications, Inc. v. Rural Telephone Service Co., 499 U.S. 340 (1991)(law.cornell.edu)
- Thaler v. Perlmutter, No. 23-5233 (D.C. Cir. Mar. 18, 2025)(media.cadc.uscourts.gov).gov
- U.S. Copyright Office, Copyright and Artificial Intelligence, Part 2: Copyrightability (2025)(copyright.gov).gov
- Copyright Registration Guidance: Works Containing Material Generated by Artificial Intelligence, 88 Fed. Reg. 16,190 (Mar. 16, 2023)(federalregister.gov).gov
- Jacobsen v. Katzer, 535 F.3d 1373 (Fed. Cir. 2008)(courtlistener.com)
- Artifex Software, Inc. v. Hancom, Inc. (N.D. Cal. 2017) (GPL enforceable as a contract)(wsgr.com)
- Doe v. GitHub, Inc., No. 4:22-cv-06823-JST (N.D. Cal.) (GitHub Copilot litigation docket)(courtlistener.com)
- Software Freedom Conservancy v. Vizio, Inc. (GPL third-party-beneficiary enforcement)(sfconservancy.org)
- Thomson Reuters Enterprise Centre GmbH v. Ross Intelligence Inc. (D. Del. Feb. 11, 2025)(dwt.com)
- Bartz v. Anthropic PBC, No. 3:24-cv-05417 (N.D. Cal. June 23, 2025)(afslaw.com)
- Kadrey v. Meta Platforms, Inc., No. 23-cv-03417-VC (N.D. Cal. June 25, 2025)(goodwinlaw.com)
- The Open Source Definition, Open Source Initiative(opensource.org)
- GNU Affero General Public License v3.0 (AGPL-3.0), § 13 (network use)(gnu.org)
- Apache License, Version 2.0(apache.org)