Safeguard
Security Guides•

Where does each package ecosystem keep its license information?

A cheat sheet of where npm, PyPI, Maven, Cargo, NuGet, Composer and Go store license data, which are structured, and where you must read files instead.

Safeguard Security Team
3 min read

Each ecosystem stores license data differently. npm, Cargo, NuGet and Composer use manifest fields that accept SPDX style values. Python is moving to a validated License-Expression field. Maven uses free text names in the POM. Go has no field, so tools read license files. Know which signal you are reading before you trust it.

The comparison

EcosystemWhere the license livesStructured?Watch for
npmlicense field in package.jsonSPDX id, expression, SEE LICENSE IN, UNLICENSEDDeprecated licenses array
PythonLicense-Expression, legacy License and classifiersNew field validated, legacy free textMixed old and new packages
Mavenlicenses element in the POMFree text name, recommended SPDXMany spellings, inherited from parent
Cargolicense or license-file in Cargo.tomlSPDX 2.3 expressionCustom terms in license-file
NuGetlicense element in the nuspecSPDX expression or fileDeprecated licenseUrl
Composerlicense field in composer.jsonString or array, array means choiceproprietary, missing field
GoLICENSE style filesNo field, heuristic detectionEdited text, odd file names

What to do with this

The pattern is clear: where authors give a structured value, scanning is reliable and fast. Where they do not, you need file reading and human review. A good process uses the manifest value first, flags every legacy or free text case as lower confidence, and reads the file when the result matters.

Rules that work across all of them

  1. Read the exact version you ship, not the latest page.
  2. Treat a missing value as unknown.
  3. Parse operators. OR is a choice, AND is a requirement, WITH adds an exception.
  4. Keep the license text for custom values.
  5. Normalize names to SPDX before applying policy. See normalizing license names.
  6. Record your decision against the package and version.

For each ecosystem there is a deeper post: see NuGet, Composer, Cargo, Go and Maven.

Try it yourself

Click through it at your own pace, or open it full screen.

Look at the ecosystems represented in the inventory and think about which license signal each one provides.

Safeguard scans dependencies across ecosystems and builds SBOMs. Try a free scan.

Quick check

Which ecosystem has no license field?

Go. Tools find licenses by reading license files and matching their text.

Does a Composer array mean AND?

No. It means a choice between the listed licenses.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.