skip to content

When adding an open-source library to a commercial product, why can a permissive license (like MIT or Apache 2.0) and a copyleft license (like GPL or AGPL) lead to very different legal outcomes for your codebase, even if the two libraries do the exact same technical job?

level: middleimportance: should knowfreq 45%

answer

  1. permissive = few obligations (MIT/Apache)
  2. copyleft = share-alike derivative works (GPL)
  3. AGPL closes SaaS loophole via network use
  4. distribution vs internal use vs linking matters
  5. license scanning before deep integration

basics

~20 s

Some licenses (MIT, Apache) let you use code freely in a closed-source product. Others (GPL, AGPL) can require you to release your own product's source code, or at least the parts that link to that library, under the same license if you distribute or run it as a service.

solid answer

~40 s

Permissive licenses like MIT and Apache 2.0 impose almost no obligations beyond keeping the copyright notice - you can bundle the code into a closed-source commercial product freely. Copyleft licenses like GPL require that any derivative work you distribute must also be released under GPL terms, which is often incompatible with a closed-source product. AGPL goes further, extending that obligation to software offered as a network service, not just distributed binaries - directly relevant to SaaS. The risk isn't abstract: a component chosen purely for capability fit can force an unplanned open-sourcing of proprietary code, or a costly late-stage replacement, if licensing wasn't checked before it got embedded. Static versus dynamic linking, and 'distribution' versus 'internal use,' also change the analysis and are exactly where legal ambiguity and real incidents occur.

go deeper

for a junior

Should know that 'open source' doesn't mean 'no restrictions' and be able to name the basic difference between permissive and copyleft licenses.

for a middle

Should recognize which license category a candidate dependency falls under and know to flag copyleft/AGPL dependencies for review before deep integration.

for a senior

Should factor licensing into architectural decisions (e.g., isolating a risky dependency behind a service boundary) and know when to involve legal review proactively rather than reactively.

for a principal

Should set organizational policy for dependency license scanning and approval, and understand the business-level trade-offs (dual licensing, commercial exceptions, acquisition due-diligence exposure) well enough to guide product and legal strategy.

## How license conditions travel with the code The mechanism starts with understanding that an open-source license is a set of conditions attached to the copyright of the code, and those conditions travel with the code into whatever you build with it. - **Permissive licenses** - MIT, BSD, Apache 2.0 - grant broad rights to use, modify, and redistribute the code with very few strings attached: typically just preserving the original copyright and license notice, and in Apache 2.0's case, a patent grant and a notice requirement for modifications. Under a permissive license, you can embed the library into a closed-source commercial product, modify it privately, and never publish your changes, and you are legally in the clear. - **Copyleft licenses** work differently: the GNU General Public License (GPL) requires that if you distribute a work that is a 'derivative' of GPL-licensed code (which, depending on how it's linked and used, can include your own application code), you must release the complete corresponding source under the same GPL terms. This is often called a 'viral' property, because the obligation propagates to code that touches the GPL component in certain ways. - **The Affero GPL (AGPL)** closes what its authors saw as a loophole in GPL: GPL's obligation to share source only triggers on distribution of the binary, so a company could run GPL code as a backend service without ever distributing it, and never trigger the sharing requirement. AGPL extends the trigger to include making the software available over a network, which is precisely the SaaS delivery model most modern products use, meaning an AGPL dependency embedded in a SaaS backend can obligate you to publish your entire service's source code to every user who interacts with it over the network. ## The two philosophies behind the split This distinction exists because open-source licensing was designed around different philosophies of what 'freedom' means: - **permissive licenses** maximize the freedom of downstream users, including commercial ones, to do whatever they want with the code; - **copyleft licenses** prioritize keeping the code and its derivatives free forever, using legal obligation to prevent a proprietary product from closing off improvements built on open work. Both are legitimate, well-established philosophies, but they have opposite implications for a company building closed-source commercial software, so the license attached to a candidate component is not a technical detail - it is a legal and business decision with real consequences. ## The trade-off engineers face The trade-off engineers face is that the technically best-fitting component for a job is sometimes copyleft-licensed, and the second-best option is permissively licensed, and choosing between them trades engineering quality against legal risk and business flexibility. Adopting the copyleft option might be fine if the product itself is or will become open source, or if the copyleft component is used only internally in ways that don't trigger distribution (this determination is genuinely legally nuanced and usually needs actual legal review, not just engineering judgment). Avoiding it preserves closed-source flexibility but may mean settling for a less capable or less mature component, or writing more custom code. ## Failure modes that have played out publicly Failure modes here are not hypothetical; they've played out publicly. - Companies have had to rip out and replace copyleft-licensed database or infrastructure components discovered mid-integration, after significant engineering investment had already gone into building around them, once legal counsel flagged the license during a review, contract negotiation, or acquisition due-diligence process - a pattern echoed by several database vendors that moved from AGPL to even stricter source-available licenses specifically to restrict SaaS-style offerings without a commercial license. - Another common failure mode is **license incompatibility** within a single codebase: pulling in two dependencies whose licenses can't legally coexist in the same distributed work, which usually isn't caught by engineers at all since it requires legal or specialized tooling analysis, and gets discovered late, often during an acquisition's legal due diligence, when it becomes an expensive scramble. ## A worked scenario A concrete, worked scenario: a team building a closed-source SaaS analytics product evaluates two candidate full-text search libraries. One is Apache 2.0 licensed and slightly less feature-rich; the other is AGPL licensed and has better out-of-the-box relevance tuning. If the team picks the AGPL option purely on capability fit and embeds it directly into their backend service, they may now be obligated to make their entire backend's source available to any user of the hosted service - a business-incompatible outcome for most commercial SaaS companies - unless they either: - purchase a commercial license offered by the AGPL project (many dual-license specifically to sell an exception to this obligation), or - isolate the AGPL component behind a strict process or network boundary in a way a lawyer confirms does not constitute a combined work under the license. In practice, this means license compatibility has to be checked before deep integration, ideally via automated license scanning in the dependency pipeline, not discovered after the component is load-bearing.

  • Why does AGPL matter more for a SaaS company than plain GPL, given both are copyleft?
    GPL's source-sharing obligation is triggered by distributing the software's binary or code to someone else; a SaaS company that only runs the code on its own servers and never hands out a binary technically never distributes it, so plain GPL's trigger doesn't fire. AGPL specifically adds 'making it available over a network' as a trigger, which is exactly how a SaaS product is delivered, so it closes that loophole and directly implicates typical cloud/SaaS architectures.
  • If legal review flags a candidate component as copyleft-incompatible with your closed-source product, what are the realistic options besides dropping the component entirely?
    Check if the project offers a commercial or dual license, which many copyleft open-source businesses sell specifically to grant an exception to the copyleft terms in exchange for payment. Alternatively, isolate the component behind a well-defined process or network boundary (e.g., calling it as a separate service via a stable API) in a way legal counsel confirms avoids creating a combined work, though this still requires actual legal sign-off, not just engineering assumption.
  • Why can't engineers reliably resolve license-compatibility questions on their own without legal input?
    Determining whether a specific pattern of linking, bundling, or network use constitutes a derivative work or combined work under a given license is a matter of legal interpretation that varies by jurisdiction and has genuinely contested edge cases even among lawyers. Engineers can and should flag license types and usage patterns early using automated scanning, but the actual risk determination for a borderline case needs qualified legal review, not just reading the license text.

Like borrowing a recipe: a permissive license is a chef saying 'use this however you like, just credit me'; a copyleft license is a chef saying 'you can use this, but if you serve any dish that includes it, you must publish your entire menu's recipes too.'

saying these in an interview costs you the question

  • Assumes 'open source' means 'free to use however I want' without checking the specific license
  • Doesn't know the difference between GPL's distribution trigger and AGPL's network-use trigger
  • Adds a copyleft dependency to a closed-source codebase without any legal review
  • Believes license compatibility is purely an engineering decision with no legal dimension
  • Unaware that some open-source projects dual-license specifically to sell commercial exceptions

context