AI生成代码是否应全部开源引发争论
开源开发者 Jakub T. Jankiewicz 提议,AI 生成的代码应以开源许可证发布或进入公有领域;他的理由包括模型受益于开源代码积累,以及纯 AI 生成内容缺少人类作者。该文在 Hacker News 引发支持与反对,部分开发者认为不能因使用 Claude Code 就公开包含数月人工设计、调试和测试的项目。InfoQ 还称 Anthropic 的招股书承认 Claude Code 输出可能复现开源软件并触发许可义务,但这一表述未在所给材料中得到独立核实。
这场争论凸显了 AI 代码进入专有软件开发后,权属、署名和源代码披露风险仍缺乏明确边界。
This may be a hot take, but I strongly believe that all code generated by AI should be Open Source. And here's why.
First of all, AI models were trained on a massive corpus of Open Source code written since RMS announced the GNU Project and the Free Software Movement. That code was simply scraped from the internet and used without permission or proper attribution. The models were also trained on Stack Overflow and Stack Exchange sister projects, which are released under Creative Commons licenses that legally require attribution. Turning this collective knowledge into proprietary, closed-source code feels like license laundering.
The second reason is legal: purely AI-generated code is not written by a human, meaning it should not be copyrightable. The foundation for this principle in the US goes back to the famous Monkey Selfie dispute, which established that non-humans cannot hold copyrights. A precedent later cited by the U.S. Copyright Office regarding AI. Following the same logic, Wikimedia Commons requires all purely AI-generated images to be tagged as Public Domain.
However, copyright laws differ across the globe. For instance, countries like the UK grant limited copyright protection to computer-generated works. To make things fair across all jurisdictions, and to honor the open ecosystem that made AI possible, developers and companies should explicitly release AI-generated code under Open Source licenses or dedicate it to the public domain using the Creative Commons Zero (CC0) license.
Of course, code is not always 100% manual or 100% automated. However, developers more and more rely on AI without even reviewing the generated output, let alone modifying it to fit their specific needs. Code like this, where humans put little effort, except writing prompts, should definitely be Open Source.
If you find this article interesting you may want to follow me on Twitter: @jcubic and on LinkedIn.