Skip to main content

Open Source Licensing Explained for Developers

Updated 6 min readMarkdown
Part of seriesProgramming

Every commercial codebase ships with dozens of open source dependencies, and almost none of those dependencies get a license review before someone runs npm install or pip install. Synopsys publishes an annual Open Source Security and Risk Analysis report, and its 2024 edition found license conflicts in the majority of scanned commercial codebases. Engineering teams treat licensing as a legal afterthought, but license terms determine what a company can build, sell, and keep proprietary.

Permissive vs Copyleft: The Core Distinction

Open source licenses split into two functional categories, and the difference between them changes what you owe downstream.

Permissive licenses (MIT, Apache 2.0, BSD) let you use, modify, and redistribute code with minimal obligations. You keep the original copyright notice and license text in your distribution, but beyond that you can embed the code in a closed-source commercial product, modify it privately, and never publish your changes. Apache 2.0 adds an explicit patent grant: contributors license their patents covering the code to users, closing a legal gap that MIT and BSD leave open. Most companies default to permissive dependencies specifically because they impose no reciprocal obligation.

Copyleft licenses (GPL, AGPL, LGPL) require derivative works to carry the same license. The GNU General Public License mandates that distributing a modified version of GPL-licensed code, or a work that links against it in ways the license treats as derivative, requires releasing the source under GPL too. The Affero GPL (AGPL) closes the loophole that let companies run modified GPL code as a network service without distributing anything: it triggers the same disclosure obligation the moment users interact with the software over a network, not just when a binary ships. The Lesser GPL (LGPL) sits in between: it permits linking from proprietary code without forcing that code to inherit the GPL, but modifications to the LGPL component itself still require release.

What This Means for Commercial Products

A company embedding OSS in a commercial product faces a direct decision tree. Permissive dependencies are safe defaults for proprietary products because they impose no disclosure requirement.

GPL dependencies work if a team treats them as intentionally isolated components, not casually imported utilities. Static linking or direct code inclusion generally pulls surrounding code into GPL obligations. Calling a GPL-licensed tool as a separate process, or interacting with it over a defined interface without linking, preserves more legal separation, though courts genuinely contest the exact boundary and interpret "derivative work" differently by jurisdiction.

AGPL dependencies carry the highest risk for any company running software as a service. If a SaaS product incorporates AGPL code anywhere in its serving path, the company may owe users the complete source of its modifications, including proprietary business logic layered on top. Legal teams at SaaS companies frequently ban AGPL outright rather than litigate the boundary case by case. A startup that builds a core feature on an AGPL library and only discovers the obligation during due diligence for a funding round faces an expensive problem: rewriting the component, negotiating a commercial license from the copyright holder, or disclosing source code it never intended to release.

License Compatibility Conflicts

Dependencies do not exist in isolation. An application typically imports dozens of packages, each carrying its own license, and compatibility conflicts happen when two licenses in the same dependency tree impose contradictory obligations.

The most common conflict: a GPL-licensed library and an Apache 2.0-licensed library used together in ways that create a combined work. The Free Software Foundation considers GPLv2 and Apache 2.0 incompatible because Apache 2.0's patent termination clause conflicts with GPLv2's terms. GPLv3 resolved this specific conflict and is compatible with Apache 2.0. This means the GPL version in a dependency tree matters, not just the fact that something is "GPL licensed."

A second common conflict arises from license proliferation within a single project: one contributor pulls in an AGPL utility, another pulls in a BSD-licensed one, and nobody checks whether the combination is legally coherent. Compatibility is not symmetric or transitive in the way developers often assume.

Resolving a conflict usually means replacing one dependency, isolating the conflicting component behind a clean interface boundary, or negotiating a commercial license directly with the maintainer.

Dependency Auditing and SBOM Practices

Manual license review does not scale past a handful of dependencies, and modern applications routinely carry hundreds of transitive dependencies through package managers. Automated auditing is the only workable approach at scale.

A Software Bill of Materials (SBOM) is a structured inventory of every component in a codebase, including transitive dependencies, versions, and license identifiers. SPDX and CycloneDX are the two dominant SBOM formats, and both now appear in procurement requirements from large enterprise buyers and government contracts, following the U.S. cybersecurity executive order that pushed SBOM adoption starting in 2021.

Tools like FOSSA, Snyk, and the OSS Review Toolkit scan a dependency tree, resolve each package's declared license, flag known conflicts, and generate an SBOM automatically as part of a CI pipeline. Running this scan on every pull request, not just at release time, catches license problems while a change is still easy to revert, rather than months later when the offending library is load-bearing.

A working audit process defines an allowed license list (MIT, Apache 2.0, BSD variants, plus a small number of reviewed exceptions), fails CI automatically when a new dependency falls outside that list, and requires documented legal sign-off for exceptions. Without automation, license drift accumulates the way technical debt does: silently, until an acquisition or customer security questionnaire forces a reckoning.

Common Mistakes Engineering Teams Make

Shipping AGPL code without realizing it. Package managers do not surface license terms prominently, and a transitive dependency three levels deep can carry an AGPL license nobody on the team ever sees. This is the single most expensive licensing mistake because it stays invisible until legal, a customer, or an acquirer asks about it.

Ignoring license changes on upgrade. A dependency's license can change between versions. Several notable projects, including Redis and Elasticsearch, moved away from permissive licenses to source-available terms like the Business Source License in recent years. A team that upgrades a pinned dependency during routine maintenance can inherit new legal terms without any code change triggering review.

Treating "open source" as a single legal category. Developers often assume all open source licenses are interchangeable because the code is publicly visible. MIT and AGPL carry entirely different obligations despite people labeling both open source, and conflating them causes most licensing incidents.

Skipping license review for internal tools. Internal-only software still triggers AGPL obligations, and in some interpretations GPL ones, once a team exposes the tool as a service. Teams that make license decisions for convenience often watch them turn into production liabilities once a prototype ships.

Licensing is not a one-time checkbox. It shifts every time a dependency updates, someone adds a package, or a deployment model changes from on-premise to SaaS. Treating it with the rigor of security scanning, not as a formality a team handles once at kickoff, keeps a growing dependency tree from becoming a liability.

No comments yet. Be the first to comment.

More from this blog