Quick Answer: AI-generated code should probably be released under an open source or public domain dedication such as CC0, but the legal basis is weaker than the argument's supporters suggest. Purely machine-written code may have no copyright owner at all, which means an open source license has nothing to grant. The strongest case for openness rests on training data provenance, fairness across jurisdictions, and the fact that many developers ship AI output with almost no review.
Most developers now have an AI assistant writing some portion of their code. The question is who, if anyone, owns the result. A Hacker News discussion recently made the case that all AI-generated code should be open source. The argument mixes ethics, copyright law, and practical software engineering, and some of its parts hold up better than others. Here's what actually matters.
The Training Data Argument: Open Source Went In, So Should It Come Out
The first claim is ethical. Large code models were trained on huge amounts of publicly available code, much of it under licenses like GPL, MIT, and Apache 2.0. Those licenses carry conditions: keep the copyright notice, preserve the license text, and in the case of copyleft licenses, share derivative works under the same terms. The author argues that turning this material into closed, proprietary output amounts to what he calls "license laundering."
The Stack Overflow piece is more concrete. Stack Overflow content has been licensed under Creative Commons Attribution-ShareAlike 4.0 since 2018, and that license requires attribution and share-alike treatment. Whether a model's output counts as a derivative work of its training data is an open question, and it's the subject of litigation. The class action Doe v. GitHub, filed in 2022 over GitHub Copilot, is one example. Courts have not settled the matter.
Here's where most people get it wrong: the training data argument is about what you owe the community, not about what the law requires. You can accept the ethical point while still doubting the legal mechanism.
The Copyright Argument: Who Owns Output Nobody Authored?
The second claim is legal. US copyright protects original works of authorship by human beings. The Ninth Circuit's decision in Naruto v. Slater (2018), the so-called "monkey selfie" case, held that a macaque could not hold copyright in photographs it took, and that animals lack statutory standing under the Copyright Act. The principle has been extended to machines. The D.C. Circuit affirmed in Thaler v. Perlmutter (2025) that a work generated autonomously by an AI system without human authorship is not eligible for copyright.
The US Copyright Office has taken the same position in its guidance on AI-generated material. Works must have human authorship, and applicants must disclose AI-generated content they include in a registration. Prompting alone generally does not make you the author of the output, according to the Office's guidance.
That's a meaningful point for developers. Code written by a model from a short prompt, with no human editing, may carry no copyright at all. Nobody owns it.
Jurisdictions diverge here. The UK's Copyright, Designs and Patents Act 1988 (section 9(3)) grants protection to "computer-generated" works, with the author defined as the person who made the arrangements necessary for the work's creation. The Wikimedia Commons policy the author cites takes a different practical approach: purely AI-generated images are tagged as public domain on that platform. The result is a patchwork, and a company shipping software across borders can't assume the same answer everywhere.
The Counter-Intuitive Part: Open Source Needs Copyright to Work
Most advocates treat "release it as open source" and "put it in the public domain" as interchangeable. They aren't, and the difference matters.
An open source license is a set of permissions the copyright holder grants to others. The MIT license says "permission is hereby granted"; the GPL grants freedoms to run, study, modify, and redistribute. Those permissions only have legal force if the licensor holds rights to grant. If AI-generated code has no copyright, a license on it has nothing to attach to. The GPL's copyleft obligations, which depend on copyright to enforce share-alike terms, would have nothing to act on.
This is why the practical answer is usually a public-domain dedication rather than a license. CC0 explicitly waives copyright to the extent possible and includes a fallback license for jurisdictions where waivers are not recognized. The Open Source Initiative recognizes CC0 as an approved license, which is why the author's suggestion of CC0 is more coherent than it may first appear.
Here's the catch: the claim that AI code is uncopyrightable doesn't tell you the code is safe to use freely. Your code may still contain fragments reproduced from training data, and that reproduced material may carry the original license obligations. Uncopyrightable and unencumbered are not the same thing.
Choosing a License: Comparing the Options
If you decide to release AI-assisted code, the choice of vehicle matters. Here's how the common options compare on the features that tend to matter for this question:
| Option | Attribution required | Copyleft | Explicit patent grant | Works if copyright is doubtful |
|---|---|---|---|---|
| CC0 1.0 | No | No | Patent waiver | Yes, designed for it |
| MIT | Yes (keep notice) | No | No | Weak, depends on copyright |
| Apache 2.0 | Yes (keep notice, NOTICE file) | No | Yes | Weak, depends on copyright |
| GPL-3.0 | Yes (keep notice) | Strong | Yes | Weak, copyleft has no hook |
Pick based on what you want the code to do after release. CC0 suits code you want anyone to use with no strings. Apache 2.0 suits projects where patent protection matters to contributors. GPL-3.0 suits projects where you want downstream improvements to stay open, provided you hold the copyright that enforces it.
What Developers Actually Do With AI Output
The author's strongest point is about practice. He notes that developers increasingly accept AI output without reviewing it, let alone modifying it. If the human contribution is writing a prompt and pressing accept, the authorship case for ownership is weak.
The real-world pattern is messier. A developer who asks a model for a function, reads it, adjusts variable names, adds error handling, and integrates it into a larger system has made creative and structural choices. The courts and the Copyright Office would probably treat the integrated system differently from the raw generated function. That boundary is not yet well defined, and anyone claiming a firm line is overstating what the law says.
This is the nuance the original argument glosses over. Pure AI output and heavily edited AI-assisted code sit at opposite ends of a spectrum. Treating both the same way creates problems in both directions.
That said, a bright-line rule has real value. Many teams already tag AI-generated commits, and some have written policies requiring human review before merge. Those practices don't resolve copyright questions, but they produce an audit trail, which is useful if a dispute arises.
Should You Adopt a Policy Now?
You don't need to wait for a final court ruling to act sensibly. The reasonable steps look like this:
- Track where AI-generated code enters your codebase, using commit tags or a contributor note.
- Require human review and modification for AI output before it ships.
- Run license and code-similarity scanning on AI-assisted code, using tools such as ScanCode Toolkit or FOSSA, to catch reproduced fragments.
- Decide, as a company policy, whether internal code gets a permissive or public-domain release, and document the reasoning.
- Consult counsel before releasing code publicly, especially if it's commercially sensitive.
Each step has a clear rationale. Tracking gives you evidence of human involvement. Review improves both quality and your authorship claim. Scanning catches the license risk the author's argument rightly points to.
Frequently Asked Questions
Is AI-generated code copyrightable?
In the United States, purely AI-generated code without meaningful human authorship generally cannot be copyrighted, according to the Copyright Office's guidance and the Thaler v. Perlmutter decision. Code with substantial human selection, arrangement, or modification may qualify for protection in the human-authored portions. Rules differ by country, so check local law.
Who owns code written by an AI assistant?
Ownership depends on the tool's terms of service and on the copyright status of the output. Most providers grant users rights to outputs, but a grant of rights from a provider can't create copyright where none exists. If the code is uncopyrightable, the practical question shifts to whether it reproduces third-party code under other licenses.
Why does CC0 make more sense than an open source license for AI code?
An open source license grants permissions under copyright. If there is no copyright, the license has nothing to grant. CC0 is a public-domain dedication that waives whatever rights exist, and it includes a fallback license for jurisdictions where a waiver isn't recognized. It fits the uncertainty better than MIT or GPL.
How do I release AI-generated code safely?
Track AI-assisted contributions, require human review and modification before release, and scan for reproduced third-party code using a license scanner. Choose CC0 or an approved open source license deliberately, and get legal advice for commercially sensitive projects.
Does using AI-generated code create license risk?
Yes, in some cases. Models can reproduce fragments of training data, and those fragments may carry obligations under licenses such as GPL or CC BY-SA. Scanning and review reduce the risk, but they don't eliminate it.
The most useful takeaway: treat AI-generated code as a question of provenance and accountability, not just ownership. Before your next release, run one AI-assisted module through a license scanner and record how much of it you actually changed. Pass this to a teammate who's shipping AI output without reading it.