Almost every modern application is built on open source. A typical web app pulls in hundreds of packages through npm, NuGet or pip. Each of those packages comes with a licence, and each licence is a legal agreement about what you’re allowed to do with the code.
Most of the time, nothing goes wrong. But if you build commercial software, especially software you sell or deliver to clients, it’s worth knowing the difference between the licences you’re accepting.
This article is general information, not legal advice. For important commercial decisions, speak to a lawyer who knows software licensing.
Two families: permissive and copyleft
Open source licences fall into two broad groups.
Permissive licences let you do almost anything with the code, including using it in closed-source commercial products, as long as you keep the copyright notice and licence text.
Copyleft licences let you use, change and share the code, but if you distribute software built on it, you must make your source code available under the same licence. The aim is to keep improvements open.
The permissive licences
MIT
The most popular open source licence and the shortest. You can use, copy, modify, merge, publish, distribute, sublicense and sell the software. Your only real obligation: include the original copyright and licence notice. There’s no warranty.
Examples: React, .NET (runtime and SDK), Rails, jQuery and countless npm packages.
Apache License 2.0
Similar freedoms to MIT, with two important additions:
- An explicit patent grant. Contributors grant you a licence to any patents covering their contributions. If you sue someone claiming the software infringes your patent, you lose that licence.
- A NOTICE file requirement. If the project includes a NOTICE file, you must include it when you distribute, and you must state significant changes you made.
Many companies prefer Apache 2.0 because the patent clause gives more legal certainty. Examples: Kubernetes, Android (most of it), TensorFlow, Apache projects.
BSD (2-clause and 3-clause)
Very close to MIT. The 3-clause version adds that you can’t use the project’s or contributors’ names to endorse your product without permission.
The copyleft licences
GPL (GNU General Public License)
The best-known copyleft licence, used by Linux, WordPress and many others. The key rule: if you distribute software that includes or is derived from GPL code, the whole program must be released under the GPL, with source code available to the people you distribute it to.
Important nuances:
- Using GPL software internally without distributing it doesn’t trigger the obligation to share your code.
- Running GPL software on a server that users access over the network also generally doesn’t count as distribution under the GPL.
- What counts as a “derived work”, for example when linking libraries, is a frequently debated area. If your product closely combines with GPL code, get advice.
GPLv2 and GPLv3 differ in details; GPLv3 adds patent provisions and rules against locking down devices so modified software can’t be installed.
LGPL (Lesser GPL)
A softer copyleft designed for libraries. You can use an LGPL library in a closed-source application, typically by linking to it dynamically, without releasing your own code. If you modify the library itself, you must share those changes.
AGPL (Affero GPL)
The GPL with one big addition that matters for SaaS businesses: if users interact with the software over a network, you must offer them the source code, including your modifications. It closes the “server loophole”.
If you build a SaaS product and include AGPL code, your obligations can extend to your own code. Many companies have policies that ban or strictly review AGPL dependencies for this reason.
MPL (Mozilla Public License 2.0)
A “file-level” copyleft. Changes to MPL-licensed files must be shared, but you can combine those files with your own proprietary code in a larger product. A middle ground between permissive and GPL.
Quick comparison
| Licence | Use in closed-source product? | Must share your changes? | Must share your whole app? | Patent grant |
|---|---|---|---|---|
| MIT | Yes | No | No | No explicit grant |
| BSD | Yes | No | No | No explicit grant |
| Apache 2.0 | Yes | No (but note changes) | No | Yes |
| MPL 2.0 | Yes | Yes, for modified MPL files | No | Yes |
| LGPL | Yes, with conditions | Yes, for the library | Usually no | v3: yes |
| GPL | Only if not distributed | Yes, when distributed | Yes, when distributed | v3: yes |
| AGPL | Risky for SaaS | Yes | Yes, including over a network | Yes |
“Source-available” isn’t open source
A growing number of well-known projects have moved away from traditional open source licences to protect their business from cloud providers reselling them. Licences like the Business Source License (BSL), Server Side Public License (SSPL) and the Elastic License let you read and often use the code, but restrict certain commercial uses, such as offering the software as a competing managed service.
Some projects have since added back an open source licence option, and community forks have appeared in several cases. The point for you: don’t assume a popular project’s licence hasn’t changed. Check the licence of the exact version you use.
No licence means no permission
Code on GitHub with no licence file isn’t free to use. By default, copyright law reserves all rights to the author. You’d need their permission. The same applies to code snippets copied from blogs or forums unless they state a licence.
AI-generated code
AI coding assistants sometimes produce code that closely resembles existing open source code. Most major providers now include filters or indemnities for business customers, but it’s sensible to review larger generated blocks and run licence scanning on your codebase.
Practical checklist for software companies
- Know what you depend on. Generate a software bill of materials (SBOM) and list each dependency’s licence. Tools like GitHub’s dependency graph,
license-checkerfor npm,pip-licensesfor Python, and commercial scanners automate this. - Set a policy. For example: MIT, BSD, Apache and ISC are approved; MPL and LGPL need review; GPL and AGPL need sign-off; no-licence code is not allowed.
- Check licences in CI. Fail the build when a new dependency with a disallowed licence appears.
- Keep notices. Collect the required copyright and licence notices into a “third-party notices” file shipped with your product.
- Check client contracts. Many enterprise and government contracts require a list of open source components and their licences, and some forbid copyleft.
- Choose a licence for your own projects deliberately. MIT or Apache 2.0 if you want maximum adoption; GPL or AGPL if you want improvements to stay open.
Before you add the next dependency
Permissive licences like MIT, BSD and Apache 2.0 are easy to live with: keep the notices and you’re largely fine. Copyleft licences like GPL and AGPL come with real obligations once you distribute software or, with AGPL, run it as a service. Source-available licences look open but restrict commercial use.
None of this should scare you away from open source. It just needs the same attention you’d give any other contract, preferably before the dependency is woven deep into your product.
Leave a Comment