Who owns AI-generated code? Mostly nobody, until you change it
6m read time

Who owns AI-generated code? Mostly nobody, until you change it

A post arguing that all AI-generated code should be open source drew 612 comments on Hacker News on Sunday. Half of the proposal is already law: code with no human input gets no copyright. What does belong to you follows the same line as the code you understand.

Jakub Jankiewicz wrote that all AI-generated code should be open source. Yesterday it sat on the Hacker News front page with 612 comments.

The thread splits into two camps. One says the AI did the work, so the code isn't yours. The other says: I spent months making design decisions, testing and steering, so it is mine.

Both camps are arguing about effort. The law doesn't ask about effort. It asks who controlled the expression.

A line from prompt to refactor: the vendor's indemnity stops at your first change, and that is where your copyright starts.

The grievance is real ​

Jankiewicz has two arguments. The first is that the models were trained on decades of open source code, taken without permission or attribution. Building closed code on that output, he says, is license laundering.

The strongest support for it is in the thread. A maintainer of several AGPL projects describes a company that first shipped his code without his name, licence or source. After months of violation notices, the company had an LLM clone the system. His verdict on the clone: "It's as if you asked an LLM to rewrite Harry Potter, with the same plot, but bad dialogue."

That is a concrete harm, and one of the legal routes against it closed in the US in September. In Doe v. GitHub the Ninth Circuit held on 16 September, going by the complaint itself, that Copilot and Codex generate new code rather than copies with the copyright notice stripped out. The DMCA claim failed. Whether the output infringes, the court left open.

The second argument is already law ​

Jankiewicz's second argument is legal: code no human wrote gets no copyright. He is right, and since this spring it stands on firmer ground than ever.

  • United States. On 2 March the Supreme Court declined to hear Thaler v. Perlmutter, so the ruling below stands: no human author, no copyright. The Copyright Office report from January 2025 makes it concrete for current technology: "prompts do not alone provide sufficient control."
  • United Kingdom. Section 9(3) of the copyright act still protects works a computer generated on its own. In March the government proposed removing that protection. There is no bill yet.
  • Europe. The bar here has been the author's "own intellectual creation" since Infopaq in 2009. A model is not an author.

So purely generated code is, in practice, already nobody's. Jankiewicz is asking for something that is largely true already, just without a LICENSE file.

Where the proposal breaks ​

A licence presupposes ownership. Another commenter puts it in one sentence: "If AI code is not copyrightable, then no license can govern it."

An MIT or CC0 licence on code nobody holds rights to is a label. It changes nothing about what anyone else may do with it.

It doesn't help the AGPL maintainer either. If that clone were MIT-licensed tomorrow, his name would still not be on it. His problem sits on the training and attribution side, and a licensing duty on the output never reaches it.

A third commenter wondered whether his own code should be open source too, since he also trained on a vast corpus of open source code. I have no answer to that, except that my training data started in 1984 and was noticeably worse filtered.

Ownership runs through the moment you step in ​

The useful part is where the Copyright Office draws the line. Human contributions you can perceive in the output are protected, and so is the creative selection, coordination or arrangement of generated material. The report quotes a 1989 ruling that reads as if it were written last week: "The supplier of an idea is no more an 'author' of a program than is the supplier of the disk on which the program is stored."

Map that onto your own working day:

What you didWhose it is
Wrote a prompt, accepted the outputnobody's
Read the output and approved itnobody's, approving is not writing
Rewrote it, split it up, restructured ityours, for that part
Decided which pieces go where and how they fityours, for that arrangement

That is close to the line between code you understand and code you let through. You don't rewrite what you don't follow. The argument for never shipping code you can't explain to a colleague is an ownership argument as well. Legally, the part you can talk about is roughly the part that is yours.

Try proving which part is yours ​

Then the practical side. Suppose it ever matters: can you point at the lines you shaped?

I can't. When I went through 1,644 commits in ten of my public repositories, not one carried an agent trailer, because I had switched it off myself. The author field turned out to be filled in by whoever pressed merge. Nothing in that history says which lines came from me, so I cannot show that I wrote my own code, which is an awkward sentence to publish on a blog mostly about craft.

The vendor won't help you there. Anthropic's commercial terms assign you their rights in the output, literally "its right, title and interest (if any)". The two words in brackets do the work. If there are no rights, nothing is assigned.

And the IP indemnity in the same terms does not apply to "modifications made by Customer to the Services or Outputs". The part that becomes yours is exactly the part the vendor stops covering. I saw the same pattern with Copilot when I wrote about who is responsible when AI code goes wrong.

What I would do ​

I'm not a lawyer. This is what I do differently in my own work:

  • Don't claim copyright you can't back up. A copyright header on a file an agent wrote in one pass is an assertion with nothing under it.
  • Keep a record of where you stepped in, for the code that matters. The core of your product, the algorithm your client pays for. A commit in which you rewrite the generated version, with a message saying why, is evidence. A squash merge of forty agent commits erases it.
  • Read your client contract. Do you assign the intellectual property rights to your client, or warrant that the work is original? Then with generated code you may be promising something that doesn't exist.
  • Read your vendor's terms for "if any" and for the exclusions. Five minutes, and afterwards you know what you have and what you don't.

Jankiewicz asks who may use AI code. That is largely settled: anyone, as long as nobody changed it. The question left over is who can explain it. Because whoever owns the code, the bugs are yours.

(43 of 43)
1You don't have an AI problem. You have a process problem.2Why you should never ship code you don't understand3Stop copy-paste engineering4The lava layer: why AI code is slowly petrifying your codebase5The brilliant parrot problem: what AI actually does when it 'thinks'6The prompt is not the spec7The bureaucracy of bots: why we are checking the checker8The day Claude deleted my production database9The arms race for your trust: Mythos, Cyber and the security hype10Stop letting your agents write Markdown11Your agent's suffering is your technical debt speaking12You can't spot the bug if you didn't write the code13One in four: the security debt nobody's counting14Your 10x developer is gated by a 0.1x pipeline15Benchmarks said frontier. Developers said "dumb."16Caveman vs context-mode: small mouth, or smaller room?17Code churn is the lava you can still measure18The ceiling is made of concrete19The token-saver tax: walking back my Caveman advice20Even the malware is AI slop now21ThePrimeagen was right22Tokenmaxxing is what happens when you measure the wrong thing23They just asked the bot nicely: your support agent is the attack surface24Speed got cheap. Judgement didn't.25Your coding agent has no world model. You built it one.26The Ferrari has a limiter: a day with Claude Fable 527The off-switch was never yours28An open MCP server is worse than an open database29The most resilient job is eating its seed corn30The off-switch works both ways now31AI writes the tests. Mutation testing checks if they work.32How to get better at reading code: a practice routine33Learning to program in the age of AI: what I would learn first34Who is responsible for AI-generated code? You are, and 2026 wrote it down35When not to use AI for coding: the tasks I still do by hand36Hiring junior developers in 2026: the collapse is a hiring decision37Software estimation with AI: the typing was never the estimate38Slopsquatting: checking that the package exists is not a defence39Eight reports, one bar: judging an AI safety sprint40Nobody's agent went rogue41The price cut was never a discount42Why AI gives everyone the same name: 505 runs across 19 models43Who owns AI-generated code? Mostly nobody, until you change it