Open source has always been based on a simple but powerful exchange: you may use, study, modify, and share the code, but you must respect the license. That bargain created Linux, Kubernetes, PostgreSQL, Python, countless security libraries, and the infrastructure behind much of the modern internet.
Generative AI puts pressure on that bargain.
Large AI models are trained on enormous amounts of text, images, audio, video, and source code. A significant part of that material was made publicly available by people who wanted to share, collaborate, document, teach, or publish. Public availability, however, is not the same as permission for every possible commercial use. A repository on the internet is not automatically a waiver of copyright. An open source license is not an invitation to ignore attribution, copyleft, notice, source-sharing obligations, or restrictions in dependency licenses.
That is the core dilemma: AI companies often argue that training is analysis, learning, or fair use. Many creators and open source maintainers argue that model training involves copying protected work at industrial scale, often without permission, compensation, attribution, or a practical way to opt out.
Open source code is easy to collect. It is structured, searchable, versioned, and hosted in public repositories. It also contains comments, tests, issue discussions, examples, commit history, documentation, and configuration files.
For AI model builders, this is extremely valuable training material. For maintainers, it creates several risks.
This is not only a question of whether a model can output a perfect copy of a function. That happened more visibly in early AI coding tools, where prompts could sometimes reproduce recognizable code. As products matured, providers became more careful about filters, similarity checks, and output controls. But avoiding obvious verbatim reproduction does not solve the deeper issue. The training process may still have depended on code whose license terms were never carried forward.
In other words, the copyright problem does not disappear just because the evidence becomes harder to detect in the output.
This is especially important for reciprocal licenses such as the GPL and AGPL. These licenses are not just permission slips. They grant broad freedoms, but they also require that derivative works, or software distributed under the relevant conditions, preserve those freedoms. If a model was trained on GPL code and then produces code that is substantially based on that GPL input, the user may unknowingly introduce GPL obligations into their own project. If that project is closed source, proprietary, or distributed under an incompatible license, the result can be a license violation.
The practical problem is that the user usually cannot know. The AI assistant does not say: "this suggestion was derived from GPL-licensed code", "this pattern came from an AGPL project", or "this output resembles Apache-licensed code and requires preserving notices". The license context was present in the training data, but it is missing from the answer. That breaks the compliance chain that open source licensing depends on.
Developers learn from open source all the time. We read code, understand patterns, and write our own implementation. That is normal and healthy. Open source depends on this kind of learning.
AI training is different in scale, automation, and market effect. A human developer reading a project does not usually copy millions of repositories into a training pipeline, compress their statistical patterns into a commercial model, and sell access to code generation as a product. The model may not store files like a database, but the business value still comes from extracting patterns from other people's work.
This is why the discussion is so difficult. If every act of machine learning from public code requires individual permission, many AI systems become impractical to train. If no permission is required, the economic and moral rights of creators become much weaker. Both extremes create problems.
The legal landscape is not uniform. Countries are still trying to fit AI into copyright systems that were not written for large-scale model training.
The EU has a more explicit framework. The Directive on Copyright in the Digital Single Market contains text and data mining exceptions. Article 3 covers research organizations and cultural heritage institutions. Article 4 allows text and data mining more broadly, including commercially, but lets rights holders reserve their rights, for example through machine-readable means.
The EU AI Act adds another layer for general-purpose AI models. Providers have transparency and copyright-related obligations, including policies to comply with EU copyright law and summaries of training content. This does not fully answer whether a specific training run was lawful, but it moves the EU toward a model where AI providers must document more and rights holders have clearer tools to object.
The weakness is practical enforcement. Opt-out mechanisms are fragmented. robots.txt was designed for web crawlers, not
for nuanced copyright reservations across source repositories, package registries, mirrors, datasets, and forks. A small
open source maintainer may have a legal right to reserve use but no realistic way to audit whether a frontier model
respected it.
The US has no equivalent AI-specific copyright exception for training. The debate largely revolves around fair use, litigation, licensing deals, and market harm. The US Copyright Office has been studying AI and copyright in multiple reports, including digital replicas, copyrightability of AI outputs, and generative AI training. Its fair use guidance emphasizes that fair use is case-specific and depends on factors such as purpose, amount used, and market effect.
That makes the US more flexible but less predictable. AI companies can argue that training is transformative. Rights holders can argue that mass copying is commercial, substitutes licensing markets, and damages the value of their work. Courts are still shaping the boundaries.
For open source, the US approach creates uncertainty. A company may believe model training on public repositories is fair use, while maintainers may believe the company ignored license conditions. Until courts or legislation provide clearer answers, the practical result is an imbalance: large companies can absorb legal risk, while individual maintainers often cannot.
The UK is between these positions. The government has consulted on a copyright and AI framework that would combine a text and data mining exception, rights reservation, licensing, and stronger transparency. The official consultation recognizes that current UK law is disputed and that both creators and AI developers lack certainty.
This is an attempt to find a middle path: allow AI training at scale where rights are not reserved, but give rights holders more control and better visibility. Whether that can work depends on the technical details. An opt-out that only large publishers can use is not a fair system for independent developers, musicians, writers, and small open source projects.
Japan is often described as more permissive for information analysis and machine learning, although the details are still subject to interpretation and guidance. Japan's Agency for Cultural Affairs has published a general understanding of AI and copyright, making clear that the topic remains legally nuanced.
Singapore also has a relatively broad computational data analysis exception. The policy goal is to support innovation and AI development, but the tradeoff is familiar: broader training permissions can weaken the bargaining position of rights holders unless paired with transparency, licensing markets, or other safeguards.
The open source debate is part of a wider conflict over digital identity and creative labor.
Actors are fighting against AI systems that copy faces, body movement, and performances. Voice actors and singers are fighting against cloned voices that can produce new performances without consent. Writers and journalists are fighting models trained on books, articles, and archives. Visual artists are fighting image generators that can imitate their style or flood the market with derivative-looking work.
The pattern is similar in each case:
For actors and singers, the issue is not only copyright. It is also personality rights, publicity rights, labor law, contract law, consumer protection, and consent. A voice can be a performance, a biometric marker, a brand, and a personal identity all at once. A face can be an artistic asset, but also the person themselves.
Open source developers may not think of themselves as performers, but the economics are comparable. Their work becomes training material for a system that can compete with them, reduce attribution, and shift value from many small creators to a few large model providers.
One of the weakest arguments in the AI debate is that public access equals unrestricted use. The web has never worked that way. A blog post is public, but not free to republish as a book. A photo is public, but not free to use in an ad. A GitHub repository is public, but still governed by copyright and license terms.
Open source licenses are built on this distinction. They grant broad permissions, but those permissions come with conditions. MIT, Apache, BSD, GPL, AGPL, MPL, and other licenses make different choices about attribution, patent grants, source distribution, network use, and derivative works. Treating all public code as raw material erases these choices.
That is dangerous because license diversity is not an accident. It is how maintainers express intent.
There is no simple solution, but several principles would make the ecosystem healthier.
AI providers should publish meaningful summaries of training data sources. Not every individual file must necessarily be listed publicly, but broad statements like "trained on public data" are not enough. Developers, artists, publishers, and users need to know what types of material were used and under what legal theory.
If the law depends on opt-outs, they must be standardized, accessible, and enforceable. A small project should not need a legal department to say "do not train on this". Repositories, package registries, websites, and content platforms need clear mechanisms that AI crawlers actually respect.
Code assistants should help users understand licensing risk. If generated code is similar to known open source code, the tool should warn the user and surface the relevant license. Hiding similarity problems may reduce lawsuits in the short term, but it increases downstream compliance risk for developers and companies using the tool.
Some training uses should be licensed. This could include direct licensing, collective licensing, dataset marketplaces, or revenue-sharing models. The details will differ between source code, music, film, journalism, and visual art, but the principle is the same: if a commercial AI product depends on high-quality human work, the people who created that work should not be invisible.
Digital replicas of voices, faces, and performances should require consent. Labelling alone is not enough if a fake voice or face can be used to mislead, harass, defraud, or replace someone commercially. This is where copyright is only one part of the answer.
The legal situation is unsettled, but maintainers still have practical options.
None of this fully solves the problem. It simply reduces risk while law and industry practice catch up.
The greatest danger is not that AI learns from open source. Learning from open source is part of why the software world works.
The danger is that AI turns open collaboration into one-way extraction. If maintainers contribute code, documentation, bug reports, examples, and community knowledge, while the commercial value is captured elsewhere without attribution, license compliance, or support for the commons, the social contract weakens.
Open source depends on trust. AI companies need open source, but they also risk damaging the very ecosystem they rely on. Respecting licenses, publishing meaningful data transparency, supporting maintainers, and building opt-out and licensing mechanisms are not anti-AI positions. They are pro-sustainability positions.
AI can be a useful tool for developers, artists, writers, singers, actors, and companies. But usefulness does not erase property rights, consent, or credit. If society wants AI systems trained on the work of millions of people, it must also decide how those people retain agency over what they created.
That decision cannot be left only to the companies that already copied the data.