1. The Transitive Dependency Blind Spot in AI-Accelerated PRs
With Cursor, Claude Code, and GitHub Copilot generating full feature pull requests in minutes,
developers add new open-source libraries far faster than human reviewers can inspect their
dependency graphs. Even when a developer checks the top-level license in package.json
or pyproject.toml, the real legal exposure rarely lives at depth 1.
A permissive MIT utility in npm often depends on a PDF renderer, image codec, or parser licensed
under AGPL-3.0-only, GPL-3.0-only, or SSPL-1.0 nested
deep in package-lock.json. Catching that package six months later during Series B
or M&A IP due diligence turns a 5-minute PR swap into a multi-week emergency rewrite.
2. Deterministic Parsing Across 6 Major Lockfile Formats
To inspect the dependency graph on every pull request in under 200ms without LLM hallucinations or heavyweight container builds, LicenseGuard parses committed lockfiles with pure, zero-dependency, size-bounded parsers — while being completely transparent about which lockfile formats embed SPDX license metadata natively versus inventory-only lockfile formats:
| Lockfile | Ecosystem | Versions & Structure Parsed | License & SBOM Capability |
|---|---|---|---|
package-lock.json |
Node.js / npm | Lockfile v2 & v3 packages map (any nesting depth) + v1 fallback |
Embedded transitive SPDX license scanning + full CycloneDX/SPDX SBOM inventory |
pnpm-lock.yaml |
Node.js / pnpm | v5, v6, and v9 packages: entries |
Full dependency inventory & CycloneDX/SPDX SBOM extraction + denyPackages enforcement (no embedded SPDX tags) |
yarn.lock |
Node.js / Yarn | Both Yarn v1 (Classic) and Yarn Berry (v2/v3/v4) | Full dependency inventory & CycloneDX/SPDX SBOM extraction + denyPackages enforcement (no embedded SPDX tags) |
Cargo.lock |
Rust | [[package]] TOML blocks with exact crate versions |
Full crate inventory & CycloneDX/SPDX SBOM extraction + denyPackages enforcement (no embedded SPDX tags) |
go.sum |
Go | Module paths & semantic versions across transitive Go modules | Full module inventory & CycloneDX/SPDX SBOM extraction + denyPackages enforcement (no embedded SPDX tags) |
poetry.lock |
Python | Resolved Python package & version stanzas | Full Python dependency inventory & CycloneDX/SPDX SBOM extraction + denyPackages enforcement (no embedded SPDX tags) |
Because pnpm-lock.yaml, yarn.lock, Cargo.lock,
go.sum, and poetry.lock store resolved package coordinates without
embedded SPDX strings, LicenseGuard records them cleanly as SBOM inventory (zero bogus
UNKNOWN annotation spam) while still blocking any explicitly restricted packages
declared in denyPackages. Alongside lockfiles, LicenseGuard evaluates
composer.lock (which embeds PHP SPDX license arrays), direct manifests
(package.json, requirements.txt, pyproject.toml,
go.mod, Cargo.toml, Gemfile.lock), flags incomplete
coverage (and fails closed in mode: enforce) whenever a lockfile exceeds GitHub's
1 MB Contents API limit or parser caps, and runs its deterministic regex + Shannon-entropy secret
scanner across added diff lines.
3. SPDX 2.3 Boolean AST Logic: Avoiding False Blocks on Dual Licenses
Naive string-matching scanners trigger constant developer revolt because they search for the
substring "GPL" and block perfectly safe dual-licensed crates and npm packages.
A formal SPDX 2.3 Abstract Syntax Tree (AST) evaluator eliminates false
positives:
// Policy Preset: commercial_strict (blocks GPL, AGPL, SSPL, LGPL, MPL)
1. "(MIT OR GPL-3.0-only)"
-> Disjunctive OR: MIT satisfies policy -> PASS (zero developer friction)
2. "(MIT AND GPL-3.0-only)"
-> Conjunctive AND: BOTH licenses apply -> DENY (blocks PR merge)
3. "((MIT OR BSD-3-Clause) AND Apache-2.0)"
-> Nested compound expression: all required branches permissive -> PASS
4. "AGPL-3.0-only" or "SSPL-1.0"
-> Strong network copyleft / source-available -> DENY with inline lockfile annotation
You can test any real package-lock.json or compound SPDX expression directly in
your browser with zero upload using our Interactive SPDX & Lockfile Tester.
4. Audited PR Waivers via /licenseguard allow & Tamper Resistance
Sometimes Legal approves a legitimate exception — for instance, a build-time code generator or test-only tool that never ships into production binaries. Static YAML edits alone slow down hotfix PRs, while unguarded chat commands create a security bypass.
LicenseGuard's PR comment waiver workflow solves both problems with strict authorization and auditability:
# Comment directly on the blocked Pull Request (exact version pinning recommended):
/licenseguard allow [email protected] --reason "Build-time codegen only (LEGAL-412)" --expires 2027-03-31
# Revoke an active waiver immediately:
/licenseguard revoke legacy-gpl-cli
-
Verified GitHub
admin/maintainPermission & No Self-Approval: LicenseGuard checks the commenter's live repository permission via GitHub's collaborator permission API (adminormaintainonly;write,triage,read,none, and lookup failures are rejected fail-closed —author_associationalone is never trusted). PR authors are explicitly blocked from self-approving waivers on their own pull requests. Enable theissue_commentwebhook event on your GitHub App to activate PR comment commands. -
Mandatory Reason, 30-Day Default Expiry (Max 365d), Version Pinning & Revocation:
Every waiver requires a quoted
--reason, defaults to a 30-day expiry when--expires YYYY-MM-DDis omitted (past dates and expiries beyond 365 days are rejected — waivers are never permanent), supports exact version pinning ([email protected], warning clearly when unpinned), and can be revoked anytime via/licenseguard revoke <pkg>with a loggedwaiver_revokedaudit event. -
Base-Branch Config Integrity:
.licenseguard.ymlis always read from the trusted base commit SHA — editing.licenseguard.ymlinside a PR cannot silently weaken your organization's policy or bypass a failing check.
5. CycloneDX 1.5 vs. SPDX 2.3 SBOM Exports for Due Diligence
Enterprise customers, procurement teams, and M&A technical auditors increasingly request a
machine-readable Software Bill of Materials (SBOM) alongside SOC 2 change-control
logs. Because LicenseGuard already records structured dependency, version, PURL
(pkg:npm/..., pkg:cargo/..., pkg:pypi/...), and SPDX
license verdicts per PR audit event, it can emit both major SBOM standards on demand:
| Dimension | CycloneDX 1.5 JSON | SPDX 2.3 JSON (ISO/IEC 5962) |
|---|---|---|
| Primary Audience | AppSec, vulnerability triage & SaaS customer security reviews | Legal counsel, open-source license compliance & M&A audits |
| Root Envelope | bomFormat: "CycloneDX", specVersion: "1.5" |
spdxVersion: "SPDX-2.3", SPDXID: "SPDXRef-DOCUMENT" |
| Component Identity | Standardized Package URLs (purl) + license expressions |
Deterministic SPDXRef-Package-* IDs + DESCRIBES links |
| Timestamp Precision | ISO-8601 UTC metadata timestamp | Strict UTC ISO-8601 without fractional seconds (YYYY-MM-DDTHH:mm:ssZ) |
6. Repository License & SBOM Governance Checklist
- Enable LicenseGuard as a required GitHub Check Run on protected branches (
main/release/*) across all private repositories. - Commit package lockfiles: npm
package-lock.jsonv2/v3 enables embedded transitive SPDX license scanning at any nesting depth, whilepnpm-lock.yaml,yarn.lock,Cargo.lock,go.sum, andpoetry.lockpopulate CycloneDX/SPDX SBOM inventories and enforce explicitdenyPackagesrules. - Start with the zero-config
commercial_strictpreset (or commit a base-branch.licenseguard.ymlwithmode: enforceso >1 MB / truncated lockfiles fail closed instead of passing silently). - Standardize temporary exceptions using
/licenseguard allow <pkg>@<version> --reason "..." [--expires YYYY-MM-DD]and/licenseguard revoke <pkg>— requiring GitHubadmin/maintainrepository permission, blocking PR author self-approval, defaulting to 30-day expiry (max 365 days), with theissue_commentwebhook event enabled on the GitHub App. - Export CycloneDX 1.5 or SPDX 2.3 SBOMs alongside RFC-4180 CSV and HMAC-SHA256 signed JSON PR audit bundles before major enterprise deals or annual audits.
7. Frequently Asked Questions
Why isn't scanning package.json or Cargo.toml enough to prevent GPL or AGPL contamination?
Top-level manifest files only list direct dependencies. Most packages in modern JavaScript,
Rust, Go, and Python codebases arrive transitively through lockfiles. npm
package-lock.json v2/v3 (and PHP composer.lock) embed SPDX license
tags at any nesting depth for immediate copyleft blocking, while pnpm-lock.yaml,
yarn.lock, Cargo.lock, go.sum, and
poetry.lock provide full resolved dependency inventories for CycloneDX/SPDX
SBOM exports and explicit denyPackages enforcement.
How should dual-licensed SPDX expressions like (MIT OR GPL-3.0-only) be evaluated?
LicenseGuard evaluates expressions with a formal SPDX 2.3 AST: OR passes if at
least one branch is allowed by policy (so MIT OR GPL-3.0-only passes cleanly),
while AND requires every branch to satisfy policy (so MIT AND GPL-3.0-only
correctly blocks).
Who is allowed to run /licenseguard allow or /licenseguard revoke on a GitHub Pull Request?
Only repository collaborators with verified GitHub admin or maintain
repository permission (checked live via GitHub's collaborator permission API, failing closed
on lookup failure or lower roles like write/triage/read).
PR authors cannot self-approve waivers on their own pull requests, waivers default to a 30-day
expiry (max 365 days), support exact version pinning ([email protected]) and revocation
via /licenseguard revoke <pkg>, and require enabling the
issue_comment webhook event on the GitHub App.
Should my team export CycloneDX 1.5 or SPDX 2.3 SBOMs?
CycloneDX 1.5 is widely used by AppSec and security questionnaire workflows, while SPDX 2.3 (ISO/IEC 5962) is standard for legal and open-source licensing audits. Exporting both formats from the same verified audit stream covers both enterprise buyer requirements cleanly.
Enforce Deterministic License, Secret & SBOM Gates on GitHub
Flat organization pricing (never per-seat): Free for public repos + 1 private repo, US$29/mo Team, US$79/mo Org, and US$199/mo Compliance with signed audit & SBOM exports.