If you shipped code this week, some of it was probably written by an AI. The question of who legally owns that code is less settled than most developers assume — and the answer depends on three things that have nothing to do with how good the code is.
That’s the core argument of a detailed analysis by Sena Evren published on O’Reilly Radar, which walks through the copyright implications of AI-assisted coding with the specificity the topic demands.
🔍 THE BOTTOM LINE: Code generated by AI tools like Claude Code, Cursor, and Codex may be uncopyrightable, owned by your employer, or contaminated by open source licenses you can’t see. Some of this is settled law. Some is actively contested. Most developers haven’t thought about any of it.
The Copyright Rule Nobody Told You
The legal baseline is straightforward: copyright only protects work created by a human. The US Copyright Office has confirmed this consistently, and the DC Circuit upheld it in the Thaler case. When the Supreme Court declined to hear the Thaler appeal in March 2026, the position held: works predominantly generated by AI without meaningful human authorship are not eligible for copyright protection.
The key phrase is “meaningful human authorship.” The Copyright Office has deliberately refused to quantify it with a percentage or a number of edits. What courts look for is evidence that a human made genuine creative decisions — choosing the architecture, deciding what to reject, restructuring the output to fit a specific design. Specifying an objective to the model is not enough. Directing how the work is constructed is what counts.
In a typical agentic coding session — you write a one-line prompt, Claude Code plans the approach, generates five files, iterates through three versions, and you review and merge — your contribution is your architectural intent and your final approval. Whether that constitutes meaningful human authorship in a courtroom is an unresolved question with no definitive court ruling yet.
The Claude Code Leak Made It Real
On March 31, 2026, Anthropic accidentally published 512,000 lines of Claude Code’s source code in a routine software update through a missing configuration file. Before sunrise, the codebase was mirrored across GitHub. Before breakfast, a developer had used an AI tool to rewrite the entire thing in Python, and the “claw-code” repository hit 100,000 GitHub stars in a single day — the fastest in history.
Then came the DMCA takedowns. Then came the question nobody had a clean answer to: if Claude Code was, by Anthropic’s own lead engineer’s admission, predominantly written by Claude itself, does Anthropic even own it? Can you issue a DMCA takedown for code that copyright law may not protect?
That incident compressed every open question about AI-generated code ownership into a single news cycle. The same questions apply to your codebase, as we explored when the Claude Code leak first broke.
What Your Employer Probably Already Owns
Before you think about whether your code is copyrightable, there’s a more immediate question: even if it is, is it actually yours?
Your employment contract almost certainly says that anything you build at work belongs to your employer. That’s the work-for-hire doctrine. Using an AI coding tool during work hours, on a work project, on a work machine, does not change who owns the result.
Most employment contracts go further. Look for sections called “Intellectual Property,” “IP Assignment,” or “Work Product.” A clause that says “any work product created using company equipment or resources” or “any software created with the assistance of company-licensed tools” almost certainly covers your AI-assisted code.
The third clause is the one to watch. If your employer licenses Claude Code, Cursor, or Copilot for the team, and you use those tools to build a side project, a broad IP assignment clause may give the employer a claim over that project — even if you built it on your own time. New Zealand developers should note that local employment law provides some protections against overly broad IP clauses, but the default still favours the employer unless your contract explicitly carves out personal projects.
The Open Source Contamination Problem
Even if you own your AI-generated code, you may have already contaminated it with an open source license you can’t see.
AI coding tools are trained on massive amounts of public code, including code licensed under the GPL, LGPL, and other copyleft licenses. Copyleft licenses carry a specific obligation: if you distribute software that is a derivative of GPL-licensed code, you must release your own source code under the same license. The contamination travels silently — you won’t see a comment in your generated code saying “this function was derived from a GPL-licensed repository.”
This is not hypothetical. The CNN lawsuit against Perplexity and the Meta publishers lawsuit both touch on the broader question of what AI training data obligations flow through to outputs. For code, the GPL contamination risk is more concrete than for text — a function signature, an algorithm structure, or a variable naming pattern can be enough to trigger derivative work analysis.
NZ Angle
New Zealand’s copyright law — the Copyright Act 1994, currently under review — has no specific provisions for AI-generated works. The Ministry of Business, Innovation and Employment (MBIE) has been consulting on AI and intellectual property since 2024, but no legislative amendment has been introduced. In practice, New Zealand courts would likely follow the human-authorship principle established in US and UK case law, but there is no domestic ruling on AI-generated code ownership.
The NZ Privacy Commissioner’s office has been more active on AI than the copyright side. For Kiwi developers, the practical risk is the same as everywhere else: if you’re shipping AI-assisted code and haven’t reviewed your employment contract or considered GPL contamination, you’re operating in a legal grey zone that your competitors may exploit.
The Other Side
The O’Reilly analysis is clear about what is and isn’t settled. The Thaler case involved zero human involvement — the AI was listed as sole author. Most real-world AI coding involves substantial human direction, which may be enough to establish copyright under the “meaningful human authorship” standard. The Allen v. Perlmutter case, currently being litigated, challenges the Copyright Office’s denial of registration for a work created with over 600 detailed prompts and Photoshop editing. That case has not been decided yet.
The gap between what developers assume about AI-generated code ownership and what the law actually says is widening. Every day, millions of lines of AI-assisted code ship into production — into commercial products, open source repositories, and enterprise codebases. Most of the people writing that code believe they own it. Some of them are wrong.
The Claude Code leak made the question concrete in a way no court case has yet. When Anthropic’s own codebase — written partly by its own AI — was mirrored across GitHub and then hit with DMCA takedowns, the contradiction was visible to everyone. You can’t claim copyright protection for code that copyright law says you don’t own. Until the law catches up, developers are operating in a space where the rules are clear in theory and unclear in practice.
❓ FAQ
Can I copyright code that Claude or Cursor wrote for me? It depends on whether you made “meaningful human authorship” contributions — choosing the architecture, deciding what to reject, restructuring the output. Code you accepted verbatim from an AI tool may not be copyrightable. The US Copyright Office has not quantified how much human involvement is enough.
Does my employer own code I wrote with AI tools? Almost certainly yes, if you wrote it during work hours or using company-licensed tools. Most employment contracts include IP assignment clauses that cover AI-assisted work. Check your contract for “work product” or “IP Assignment” sections.
Can AI-generated code contain GPL obligations I don’t know about? Yes. AI coding tools are trained on public code including GPL-licensed repositories. If the model reproduces enough of a GPL-licensed function’s structure, your generated code could be considered a derivative work, triggering copyleft obligations. This has not been tested in court yet.
What was the Claude Code leak? On March 31, 2026, Anthropic accidentally published 512,000 lines of Claude Code’s source code through a missing configuration file. The codebase was mirrored across GitHub, hit 100,000 stars in a day, and was then hit with DMCA takedowns — raising the question of whether Anthropic can claim copyright on code that was partly written by its own AI.
Is New Zealand law different on this? No specific NZ legislation addresses AI-generated code ownership. The Copyright Act 1994 is under review but no AI provisions have been introduced. NZ courts would likely follow the human-authorship principle from US and UK case law, but there is no domestic ruling.
🔍 THE BOTTOM LINE: AI-generated code sits in a legal grey zone that most developers haven’t examined. The code may be uncopyrightable, it probably belongs to your employer, and it may carry hidden GPL obligations from training data. The Claude Code leak made the contradiction visible. Until the law catches up, the risk is yours.