Quick answer: Should AI-generated code be open source? There is no legal rule that says it must be. The argument for it rests on two points: models learned from open source code, and code written entirely by an AI may not be copyrightable. Whichever side you take, your team needs the same thing first: a record of which agent wrote what, from which task, and who reviewed it.
On November 17, 2026, a post titled “All AI-generated code should be Open Source” sat at the top of Hacker News with more than 1,200 points and 650 comments. The thread is loud, but the question underneath it is practical. If your agents write a growing share of your codebase, who owns that code, under what license, and who answers for it when it breaks?
What the “AI-generated code should be open source” argument says
The case for open-sourcing AI-generated code is an ethical claim plus a legal one: models were trained on open source and Creative Commons code, so closing their output launders those licenses, and code without a human author may not be copyrightable anyway, so it should be released under an open license or CC0.
Jakub Jankiewicz’s post makes four moves:
- Training data. Models learned from decades of open source code and from Stack Overflow answers, which carry Creative Commons licenses that require attribution. Turning that into closed code “feels like license laundering,” in his words.
- Authorship. Purely AI-generated code has no human author, so it should not be copyrightable. He points to the monkey selfie dispute and to the U.S. Copyright Office’s position on AI.
- Jurisdiction. Some countries, like the UK, grant limited protection to computer-generated works, so the rules are not uniform.
- The remedy. Developers should release AI-generated code under an open source license or dedicate it to the public domain with CC0, at least where humans did little beyond writing prompts.
That last point matters most for teams: he is targeting code nobody reviewed or changed, not code a human designed and an agent typed.
Copyright and AI-generated code: where the law stands
The legal half of the argument has real support in the U.S. and less support elsewhere.
In January 2025 the U.S. Copyright Office published Part 2 of its AI report, on copyrightability. Its position: copyright requires human authorship, prompts alone generally do not give a person enough control over the output, and human contributions such as selecting, arranging, or modifying the output can still be protected. In March 2025 the D.C. Circuit affirmed in Thaler v. Perlmutter that the Copyright Act requires a human author.
The UK takes a different line. Section 9(3) of the Copyright, Designs and Patents Act 1988 treats the author of a computer-generated work as the person who made the arrangements necessary for its creation.
So in the U.S., a file an agent produced with no meaningful human edits may have weak or no copyright protection. A file a developer restructured, trimmed, and extended likely does. Most production code sits somewhere between those two, and the line runs through your review process.
The counter-arguments, side by side
The strongest objections in the thread are not “the author is wrong about the law.” They are about what follows from it.
| The argument | The counter-argument |
|---|---|
| Models trained on open source, so the output should be open | Training-data claims are being fought in court; a license on the output does not settle them |
| Uncopyrightable code should be released | Uncopyrightable is not the same as published; nothing in the Copyright Office report requires you to release code |
| Low-effort code deserves no protection | Almost no production code is zero-effort: specs, review, tests, and edits are human work |
| Open licenses honor the commons | A blanket CC0 can strip protection from human contributions mixed into the same file |
| The rule should be uniform across countries | Copyright law is national; the UK rule above already differs from the U.S. one |
Notice what both columns assume. Every row depends on knowing how much of a given change came from an agent and how much a person shaped it. You cannot pick a license policy, answer a customer’s provenance question, or argue authorship without that record.
Who is accountable for agent-written code?
The license debate is open. Accountability is not. The person who merged the change owns it, whatever wrote the first draft.
That is the core idea in our post on human ownership of agent work. A bug in agent-written code is still your bug. A leaked secret in an agent’s pull request is still your incident.
Agents research, execute, test, and report. People set direction, grant authority, and accept the result. The open source debate does not change that split; it raises the cost of losing track of it.

Provenance for AI-generated code: what to record
Provenance is the record of where a change came from. For agent-written code, a useful record answers six questions:
- Which task asked for the change, with its requirement and acceptance criteria.
- Which agent did the work, and on which runtime and model.
- Which run produced it, with start time, end time, and trigger source.
- Which pull request carried it into the repository.
- Who reviewed it, and what they changed before accepting.
- What license the repository applies to that code.
Most teams already have pieces of this. The pull request has the diff and the reviewer. Git can carry structured metadata through commit trailers. Some coding agents, Claude Code among them, add a co-author trailer by default, and you can extend that convention with your own keys:
fix(auth): return 401 instead of 500 on expired refresh token
Refresh tokens past their TTL threw an unhandled TokenExpiredError
in the session middleware. Map it to a 401 with a retry hint.
Co-Authored-By: Claude <[email protected]>
Agent-Task: COIN-1287
Agent-Run: 3f9c2a71-0b4e-4c8a-9d51-6e2f4b7a1c09
Reviewed-By: Priya Shah
Human-Edits: renamed handler, added regression test
Trailers travel with the commit, so they survive repository moves. What they cannot hold is the run itself: the tool calls, the failed attempts, the discussion behind the final shape.
For license tracking at the file level, SPDX identifiers and the REUSE conventions give each file a license header that tools can check. If your team decides some generated assets go out under CC0, this is where that decision becomes checkable.
How Sharkly keeps the record on the task
Sharkly is a work management system for people and coding agents. You assign a Task to an Agent the same way you assign it to a person, and the Task stays the shared record for the team.
That record is the provenance trail most teams are missing:
- The Task holds the requirement, the Assignee, comments, attachments, and an Activity timeline of task changes.
- The execution log shows, per run, why it was queued, when it started and ended, tool calls and Runtime events, the trigger source, and any failure details, as the task execution docs describe.
- Agent comments meant for the team are saved as Comments linked to the run, so the explanation sits next to the evidence.
- Review signals: an Agent can leave a Task waiting for human review, which routes it to the responsible person instead of merging silently.
- Pull request links: the GitHub integration links pull requests and syncs issues into a Space, so the code change and the task point at each other.

Sharkly does not decide your license, and it is not a compliance product. It keeps the facts a license decision depends on in one place instead of private terminal sessions.
A provenance policy you can adopt this week
Use the smallest policy that answers the six questions above. Start here:
- One task per agent change. No agent work without a task ID. Ad hoc chat is fine for exploring; anything that ships gets a task.
- Put the task ID in the branch and the commit. A trailer or a branch prefix is enough for search later.
- Require a named human reviewer. The reviewer’s name goes on the pull request and the task, and their edits are noted.
- Write a license line per repository. Decide whether agent-written code follows the repository’s existing license (the default for most teams) or something else, and write it in
CONTRIBUTING.md. - Tag files whose license differs. Use SPDX headers if you choose CC0 or another license for generated assets.
- Keep run logs as long as you keep pull requests. If you would keep the review thread, keep the run that produced the diff.
For deeper review mechanics, see how to review AI-generated code with task-level evidence and where to put approval gates for coding agents.
Use a light policy when agents only touch internal tools and tests. Use the full six steps when agent code ships to customers, runs in regulated environments, or lands in a repository you already publish under an open source license.
Should your team open-source its agent-written code?
Probably not by default, and not because of this thread alone. The law is still moving, most agent output in a reviewed workflow carries real human contribution, and a blanket CC0 release can give away more than you intended.
The better move is to make the question answerable. When a customer or your legal team asks “how much of this did an agent write, and who checked it,” you open one record and show the task, the run, the pull request, and the reviewer.
If you already run Claude Code, Codex, or another coding agent, connect one Computer to Sharkly, assign one low-risk task to an Agent, and check what the task record shows when the run finishes. That record is your provenance trail, whichever way the open source debate lands.
FAQ
Is AI-generated code copyrightable?
In the U.S., code produced by AI with no meaningful human contribution is likely not copyrightable, per the Copyright Office’s 2025 report and Thaler v. Perlmutter. Human selection, arrangement, and modification of the output can still be protected. Other countries, including the UK, handle computer-generated works differently.
Do I have to open-source code that an AI agent wrote?
No law requires it. The Hacker News post argues that you should on ethical grounds. Code that is not copyrightable is not automatically public; you can still keep it private.
Who is responsible for bugs in AI-generated code?
The team that merged it. An agent can write the change, but the person who accepted the pull request owns the result. Record that person on the task and the pull request.
How do I track which code an AI agent wrote?
Tie every agent change to a task, add the task and run IDs as commit trailers, link the pull request to the task, and record the human reviewer. A task board that keeps the agent’s run log gives you the rest.
Does CC0 make sense for AI-generated code?
It can for clearly separable generated assets, such as fixtures or scaffolding. Applying CC0 to mixed files risks releasing the human-written parts too, so tag those files with SPDX headers instead of relicensing whole repositories.



