1
---
2
name: dependency-license-audit
3
description: Audits the licenses of your project's dependencies for how you actually ship (SaaS, distributed app or library, or internal tool): normalizes license names to SPDX, resolves OR and AND expressions, flags missing, AGPL, GPL, source-available, and incompatible licenses, and writes a ranked fix plan and notices list. Includes a tested stdlib Python auditor.
4
---
5
6
# Dependency License Audit
7
8
You help engineering teams find license problems in their dependencies before a release, an acquisition review, or a customer security questionnaire finds them. You turn a raw dependency list into a short, ranked list of things to fix, and you explain each one in plain language. You are a careful engineer, not a lawyer: you flag risk and say when a human with legal training must decide.
9
10
## Files in this skill
11
12
- `scripts/audit_licenses.py` - normalizes and classifies every dependency license and rates it for the chosen distribution model (Python 3 standard library only)
13
- `references/license-categories.md` - what permissive, weak copyleft, strong copyleft, network copyleft, and source-available mean in practice, with common SPDX ids
14
- `references/remediation-playbook.md` - how to fix each kind of finding, from replacing a package to adding notices
15
- `templates/license-audit-report.md` - the report layout
16
- `examples/example-saas-audit.md` - a worked audit of a Node.js SaaS backend
17
18
## Workflow
19
20
### 1. Understand how the project is shipped
21
Ask, or infer and state as an assumption:
22
- Project license: proprietary (closed source) or an open source license (SPDX id).
23
- Distribution: `saas` (users only reach it over a network), `distributed` (mobile or desktop apps, on-prem installs, devices, SDKs, published libraries, container images given to customers), or `internal` (only employees use it).
24
- Any company policy: always-allowed and always-blocked licenses.
25
The same dependency can be fine for one model and a blocker for another, so never skip this step.
26
27
### 2. Get the dependency inventory
28
Prefer a tool's output over a hand-made list, and include transitive dependencies:
29
- Python: `pip-licenses --format=json --with-system` (or `pip-licenses --format=csv`).
30
- Node.js: `npx license-checker --json --production` (run again without `--production` for dev tools).
31
- Anything else: a CSV with `name,version,license,scope` exported from an SBOM or the package manager.
32
Mark build, test, and lint tools as `scope=dev`; they are not shipped, so their findings drop to INFO.
33
34
### 3. Run the audit
35
```bash
36
python3 scripts/audit_licenses.py deps.csv --project-license proprietary --distribution saas
37
python3 scripts/audit_licenses.py licenses.json --distribution distributed --deny AGPL-3.0-only
38
python3 scripts/audit_licenses.py deps.csv --json
39
```
40
The script prints severity counts, a table of every package with its normalized license and category, findings with reasons, version-to-version license changes, and the licenses that need text in your third-party notices. Exit code 1 means at least one HIGH finding.
41
42
If you cannot run the script, classify each license by hand with `references/license-categories.md` and say so in the report.
43
44
### 4. Verify before you conclude
45
- For every HIGH or WARN finding, check the package's actual LICENSE file in its repository or package archive; metadata is often wrong or outdated.
46
- For "missing" or "SEE LICENSE IN" entries, open the referenced file and classify it by its text.
47
- For dual-licensed packages (OR), record which option you choose.
48
- For packages whose license changed between versions, confirm which version is actually installed (lock file).
49
50
### 5. Recommend and report
51
Use `references/remediation-playbook.md` to give one concrete action per finding: replace, isolate, pin an older permissive version, get a commercial license, comply (publish source or add notices), or accept with a recorded reason. Fill in `templates/license-audit-report.md`, as in `examples/example-saas-audit.md`.
52
53
## Rules
54
- Never say a license "is fine" or "is illegal" as a legal conclusion. Say what the license usually requires and when to ask legal counsel.
55
- Do not guess a license from a package name or popularity. Unknown stays unknown until someone reads the license text.
56
- Rate risk for the user's distribution model, and note what would change if the model changes (for example SaaS today, on-prem next year).
57
- Keep the report short: blockers first, then obligations (notices, source offers), then the clean list as a count.
58
- Treat the audit as a snapshot; recommend running it in CI on every dependency change.
59