Sub topic 5
Permissive and Copyleft Licenses in Brief
What this chapter assumes
This chapter assumes you have used an AI coding assistant, you know Git and code review, and you have a general idea of what an open-source license is. It also builds on the previous chapters: copyright attaches to original expression, and the copyright holder decides who may copy, modify and distribute the work. A license is how a holder grants those permissions to others.
This is general education, not legal advice. License text is interpreted by courts, and the outcome depends on the country and the facts.
Why licenses matter for AI-assisted code
Open-source code is not public domain. Each project publishes its code under a license, and the license sets conditions. If you copy the code, you accept those conditions. If you ignore them, you may be infringing copyright, even though the code was freely available.
An AI assistant can produce code that looks like existing open-source code. The next chapters cover how that happens and what follows. To follow them, you first need to know what the common license families require. This chapter gives you that working model.
The two main families
Most open-source licenses fall into two families. They differ in what they ask of you when you redistribute the code or something built from it.
- Permissive licenses allow almost any use, including inside closed-source products. They ask mainly that you keep the copyright notice and the license text.
- Copyleft licenses also allow use, modification and redistribution. They add a condition: when you distribute a work that is based on the code, you must offer that work under the same license terms, including access to the source code.
The word "copyleft" is a play on "copyright." It uses the copyright system to keep software free to share, instead of to restrict it.
Permissive licenses
The most common permissive licenses are MIT, BSD (2-clause and 3-clause) and Apache 2.0.
- MIT is very short. It requires that the copyright notice and permission text stay with copies of the software.
- BSD licenses are similar. The 3-clause version adds a rule against using the authors' names to endorse your product.
- Apache 2.0 is longer. It requires you to keep notices, state significant changes you made, and carry along any
NOTICEfile. It also includes an explicit patent license from contributors. That patent grant ends for a user who sues over patent infringement in the covered software.
The practical obligation with permissive code is attribution. If generated code reproduces MIT-licensed code and you ship it without the notice, you have broken the license, even though the license is generous.
Copyleft licenses
Copyleft licenses vary in how far the "same terms" condition reaches. This reach is the key thing to understand.
- GPL (GNU General Public License) is strong copyleft. If you distribute a work that is a combination or derivative of GPL code, the whole combined work must be offered under the GPL, with source. GPL version 2 and version 3 are different and not always compatible with each other or with other licenses.
- LGPL (Lesser GPL) is weaker. You can link to an LGPL library from a proprietary program under certain conditions, but changes to the library itself must stay under the LGPL.
- MPL 2.0 (Mozilla Public License) works at the file level. Changes to MPL-covered files must be shared under the MPL. Other files in the same product can use a different license.
- AGPL (Affero GPL) is the GPL plus a network clause. If users interact with the modified program over a network, you must offer them the source, even if you never hand out copies. This matters for web services.
The following table compares them.
| License | Family | Keep notices | Share source of derived work | Network use triggers sharing |
|---|---|---|---|---|
| MIT, BSD | Permissive | Yes | No | No |
| Apache 2.0 | Permissive | Yes, plus changes and NOTICE | No | No |
| MPL 2.0 | Weak copyleft | Yes | Yes, for modified covered files | No |
| LGPL | Weak copyleft | Yes | Yes, for the library and its changes | No |
| GPL | Strong copyleft | Yes | Yes, for the whole derived work | No |
| AGPL | Strong copyleft | Yes | Yes, for the whole derived work | Yes |
What triggers an obligation
Copyleft conditions usually apply when you distribute the work, not when you only use it internally. Distribution means giving copies to someone else: shipping a binary, publishing a container image, delivering code to a client, or releasing a library. Running GPL code on your own servers for your own use generally does not trigger sharing. The AGPL is the main exception, because it treats network access as a trigger.
Two ideas decide whether a copyleft license reaches your code.
- Copying or deriving. The obligation attaches when your work contains copyrightable expression from the licensed code, or is derived from it. Writing code that solves the same problem in your own way does not copy the expression.
- Combining. Whether linking or bundling creates a single derived work is argued over, and it depends on the license and the facts. Teams usually take the cautious reading and get legal advice for borderline cases.
Small pieces matter too. Very short snippets, or code that has only one sensible form, may not be protectable expression. Do not rely on this casually. There is no fixed line length below which copying is safe.
Compatibility between licenses
A project often combines code from many sources. Licenses must be compatible, meaning you can satisfy all of them at once.
- Permissive code can usually go into a copyleft project. The combined work is then distributed under the copyleft terms, and the original notices must stay.
- Copyleft code cannot usually go into a permissive or proprietary project without forcing that project to adopt the copyleft terms.
- Some pairs conflict directly. For example, Apache 2.0 is generally considered compatible with GPL version 3 but not with GPL version 2 only.
If an assistant suggests code and you cannot tell its license, you cannot judge compatibility. That uncertainty is the core problem the later chapters address.
Where you see licenses in a repository
Projects state their license in a few standard places.
- A
LICENSEorCOPYINGfile at the repository root. - A header comment in each source file.
- Package metadata, such as the
licensefield inpackage.jsonorpyproject.toml.
The header format that tools read best is an SPDX identifier. SPDX is a standard list of short license names, such as MIT, Apache-2.0 and GPL-3.0-only. A header looks like this:
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2026 Example Corp.
def clamp(value: float, low: float, high: float) -> float:
return max(low, min(value, high))The header states the license under which the project distributes this file. It does not prove who wrote the code or that the code is free of third-party material. It is a declaration, and a reviewer still has to check that it is true.
Note the difference between GPL-3.0-only and GPL-3.0-or-later. The first limits you to version 3. The second lets recipients choose a later version. Copying the wrong identifier changes what you promise.
Common errors
- Treating "public on GitHub" as "free to use." A repository with no license file is not open source. By default, all rights are reserved, and you have no permission to copy it.
- Dropping notices. Permissive licenses are easy to satisfy, yet teams often strip the copyright line when pasting code. That is a breach.
- Assuming internal tools are exempt forever. Internal use is usually safe, but a tool that later ships to customers or runs as a network service can change the analysis.
- Mixing license versions. GPL-2.0-only and Apache-2.0 code in one distributed binary can create a conflict that cannot be fixed by notices alone.
- Believing a header settles ownership. An SPDX line records intent. It does not replace checking where the code came from.
Applying this to AI-assisted work
When a reviewer sees a block of generated code, the license questions are practical ones.
- Does the block look like a known project's code, such as unusual names, distinctive comments or a copyright line inside the suggestion?
- If so, what license does that project use, and which family is it in?
- Will your product distribute this code, or offer it over a network?
- If a conflict is possible, can you rewrite the section independently, replace it with a properly licensed library, or comply with the license?
Strong copyleft in a proprietary, distributed product is the highest-stakes case. Permissive code is usually fixable by adding the correct notice.
Exercises
Exercise
Your team ships a closed-source desktop application. A reviewer finds that a function generated by an assistant is a near-verbatim copy of a function from a GPL-3.0 project. Which family does this license belong to, and why is the situation higher risk than if the source had been MIT?
Show answer
GPL-3.0 is strong copyleft. Distributing the application as a derived work could require you to offer the whole work under the GPL with source, which conflicts with a closed-source model. MIT would only require keeping the copyright notice and license text, which is easy to satisfy.
Exercise
A company runs a modified AGPL-licensed program on its own web server. It never gives copies to anyone, but customers use it over the internet. Does the company have to offer source code to those users?
Show answer
Yes, in general. The AGPL's network clause treats interaction over a network as a trigger for offering the corresponding source, even without distributing copies. The GPL alone would not trigger on this use.
Exercise
A file begins with "SPDX-License-Identifier: MIT". Does this prove the code inside the file has no third-party GPL material?
Show answer
No. The header declares the license the project applies to the file. It does not verify where the code came from. A reviewer still has to check provenance.