Skip to content
SEO Optimizer is live, Audit on page SEO and AI-search readiness. Try it free
Code Quality

Open Source License Compliance for Dev Teams

·5 min read

A typical web app pulls in hundreds of open source packages, and every one of them comes with a license. Most are permissive and easy to follow. A few come with conditions that can require you to publish your own source code, or forbid the way you use them. Open source license compliance is about knowing which is which before a customer, an investor's due diligence or a lawyer asks. This guide covers the license types, the risky ones and how to check automatically. It is practical guidance, not legal advice.

The Main License Categories

CategoryExamplesWhat it usually means for you
PermissiveMIT, BSD, Apache-2.0, ISCUse it anywhere, including closed-source products. Keep the copyright and license notice. Apache-2.0 also has patent terms and a NOTICE file.
Weak copyleftLGPL, MPL-2.0, EPL-2.0Changes to the library itself must be shared under the same license. Your own code that only uses it usually does not.
Strong copyleftGPL-2.0, GPL-3.0If you distribute software that includes it, the combined work may need to be released under the GPL, with source.
Network copyleftAGPL-3.0Like GPL, but triggered by letting users interact with the software over a network, which covers most SaaS.
Source-availableSSPL, BUSL, Elastic License 2.0, Commons ClauseNot open source. Limits commercial or competing use, often for hosted services.
Unknown or missingNo license, custom textNo license means no permission. Treat it as a risk until clarified.

Where Open Source License Compliance Goes Wrong

  • AGPL in a SaaS backend. Many teams assume "we don't distribute, so GPL doesn't apply". The AGPL was written for exactly that case.
  • GPL in shipped software. Desktop apps, mobile apps, on-premise installs, firmware and SDKs you hand to customers are distribution.
  • Source-available licenses after a relicense. Several well-known projects moved from open source to source-available licenses. An upgrade can change your obligations without anyone noticing.
  • Transitive dependencies. The risky license is rarely in your direct dependencies. It is three levels down.
  • Missing attribution. Even permissive licenses require you to keep notices. Shipped apps should include a third-party notices file.
  • Dual and combined licenses. SPDX expressions like MIT OR GPL-3.0 let you choose, while MIT AND GPL-3.0 binds you to both.

SPDX: The Common Language for Licenses

SPDX is a standard list of license identifiers, such as MIT, Apache-2.0 and GPL-3.0-or-later, plus a simple syntax for combining them. Package registries use SPDX identifiers, which is what makes automated open source license compliance checks possible. When you write your own package.json or pyproject.toml, use a valid SPDX identifier so others can check you too.

A Practical Open Source License Compliance Process

  1. Write a short policy. Which categories are allowed, which need review, which are not allowed. A common starting point for SaaS: permissive allowed, weak copyleft allowed with review, GPL reviewed, AGPL and source-available not allowed without legal sign-off.
  2. Inventory every dependency, including transitive ones, from your lockfiles.
  3. Check licenses automatically on every pull request or release, not once a year.
  4. Handle exceptions explicitly. Record approved exceptions with a reason, so the same package is not reviewed every month.
  5. Produce notices for anything you ship to customers.
  6. Recheck after upgrades. License changes happen in new major versions.

Automate the License Check

The Repo Scanner includes license checks alongside its security scans. It reads the dependencies from your lockfiles and manifests, looks up each package's SPDX license from deps.dev for npm, PyPI, Go, Maven, Cargo, NuGet and RubyGems, and sorts each into permissive, weak copyleft, strong copyleft, network copyleft, source-available (restricted) or unknown. By default it flags copyleft licenses that can oblige you to publish your own source, with weak copyleft at a lower severity, and it understands OR and AND expressions. You can set your own policy in the repository:

.scanverra/license-policy.jsonA per-repo license policy
{
  "allow": ["LGPL-3.0-only"],
  "deny": ["WTFPL"],
  "ignore": ["internal-package"]
}

The same scan finds vulnerable dependencies and outdated packages, so one report covers both license risk and security risk. The software composition analysis guide explains how dependency scanning works, and how to fix outdated dependencies covers upgrades. You can run it in CI with the CLI too.

What a Tool Cannot Decide for You

A scanner tells you what license each package declares. It cannot tell you how a license applies to your particular product, whether your use counts as distribution, or whether a commercial license is worth buying. For anything flagged as strong copyleft, network copyleft or source-available in a product you sell, get advice from someone who knows licensing. Good open source license compliance is mostly about catching those cases early, while switching to another package is still cheap.

FAQ

Häufig gestellte Fragen

It means following the terms of the licenses on the open source software you use, such as keeping notices, sharing source code when a copyleft license requires it, and avoiding licenses that forbid your use.

Usually the GPL is triggered by distributing software, so a hosted service that never ships the code may not trigger it. The AGPL is different: it applies when users interact with the software over a network. Get advice for your specific case.

Permissive licenses like MIT and Apache-2.0 let you use code in closed-source products if you keep notices. Copyleft licenses like the GPL require derived works you distribute to be released under the same license.

No. Licenses such as SSPL, BUSL and Elastic License 2.0 make the source visible but limit commercial or competing use, so they do not meet the open source definition.

Use a tool that reads your lockfiles, including transitive dependencies, looks up each package's SPDX license and compares it to your policy. Scanverra's Repo Scanner does this alongside its security checks.

Automate this in your next PR

Run a free repo scan and see outdated dependencies, CVEs, and code quality issues before they ship.

Run a free repo scan