A self-hosted autonomous agent that audits the open-source licenses of your dependencies before you ship. It reads
requirements.txt/package.json, maps each dependency to its SPDX license, classifies the risk (permissive, copyleft, proprietary, unknown) and grades it against a policy you control.
The problem it solves
Every release quietly pulls in dozens of transitive dependencies. One GPL or AGPL package linked into a product you distribute (or run as SaaS) can force you to open-source your own code; one "unknown" license is a compliance blind spot your legal team will find after launch. Checking this by hand does not scale, and it is exactly the kind of repetitive, rule-based verification an agent should own.
This agent turns that recurring chore into a one-command, offline, reproducible audit — with a clear allow / warn / deny verdict per dependency and a machine- readable report you can wire into CI.
Who it is for: engineers and release managers shipping software (libraries, apps, SaaS) who need a fast, honest license gate without a paid SCA platform.
What it does
- Scan a manifest and list its declared dependencies (Python + npm).
- Classify each dependency's license into a category using a bundled,
buyer-extendable SPDX knowledge base (
data/known_licenses.json). - Grade each category against your policy (
data/policy.json):allow | warn | deny. - Flag copyleft contamination (GPL/AGPL/LGPL/MPL), proprietary terms and unknown provenance so nothing ships unreviewed.
- Gate CI with
--strict(exit code 2 on any denied license). - Explain & remediate a risky package (permissive alternatives), enriched by your own LLM CLI when one is connected.
Architecture
┌──────────────────────────────────────────────────────────┐
│ Manifests: requirements.txt / package.json │
└───────────────────────────┬──────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────┐
│ OODA loop (deterministic core) │
│ OBSERVE → discover manifests under the scan dir │
│ ORIENT → parse dependencies (name + version) │
│ DECIDE → SPDX license → category → policy verdict │
│ ACT → report + violations + exit code │
└───────────────────────────┬──────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────┐
│ Knowledge base (data/*.json) · BYO-LLM adapter │
│ known_licenses / categories / policy (claude/kimi/codex)│
└──────────────────────────────────────────────────────────┘
Contents
| File | Role |
|---|---|
README.md |
This file — overview and quick-start |
SOUL.md |
Mission, values and the license-audit OODA states |
PROMPTS.md |
4 named, versioned prompts loaded by agent.py |
CHECKLIST.md |
20+ deploy/operate steps with command snippets |
SPEC.md |
Technical spec, configurable parameters, interfaces |
CUSTOMIZE.md |
Where to plug in your own SBOM / license data / policy |
OPERATING_COST_ESTIMATE.md |
Provider-agnostic cost method |
agent.py |
Runnable agent (deterministic core + BYO-LLM) |
llm_adapter.py |
BYO-LLM CLI adapter (claude/kimi/codex, no API key) |
data/known_licenses.json |
Seed package → SPDX license map (extend it) |
data/license_categories.json |
SPDX → category + copyleft flag |
data/policy.json |
Category → verdict (allow/warn/deny) |
data/requirements.txt |
Sample Python manifest (demo + smoke test) |
data/package.json |
Sample npm manifest (demo + smoke test) |
install.sh / deploy.sh |
One-shot Debian installer + systemd unit |
test_agent.py / smoke_test.sh |
Offline test suite (no keys) |
Quick-start
# 1) Install (Debian/Ubuntu VM): system deps + venv + optional systemd service
sudo bash install.sh
# venv only, run by hand: bash install.sh --no-service
# 2) Audit your own manifest
python3 agent.py audit --manifest /path/to/requirements.txt
# 3) Gate CI (non-zero exit if any denied license is present)
python3 agent.py audit --manifest package.json --strict || echo "license gate failed"
# 4) Explain a risky package and get a permissive alternative
python3 agent.py explain --package mysql-connector-python
No API key is required. If a Claude Code / Kimi Code / Codex CLI is logged in, the agent uses it to enrich explanations; otherwise it runs a fully deterministic core.
Deterministic first, smart if connected
The verdict is always computed by deterministic rules over your policy — the LLM never overrides a policy decision. It only explains risk and suggests alternatives when a CLI is available. That keeps audits reproducible and auditable.
Use a local model (Ollama)
The optional LLM step can also run on your own machine through Ollama, so no text leaves your server. No account and no API key.
ollama pull <model> # any chat model you like
export PACK_LLM=ollama # prefer Ollama even if a coding-agent CLI is installed
export PACK_OLLAMA_MODEL=<model> # optional: default is the first chat model the server lists
python3 -c "import llm_adapter; print(llm_adapter.detect())" # prints: ollama
PACK_OLLAMA_HOSTpoints to another server (defaulthttp://127.0.0.1:11434);OLLAMA_HOSTis also read whenPACK_LLM=ollama.PACK_OLLAMA_NUM_CTXsets the context size if your reports or prompts are long.- Without
PACK_LLM, a local Ollama server is used only when no Claude Code, Kimi Code or Codex CLI is found. - If the server is down or the model is missing, the pack keeps working in its deterministic mode.
Learning memory (local and private)
Every LLM call this pack makes is journaled in ./.pack_memory/ next to the code, so the pack can improve for you. Nothing is ever sent anywhere.
- What is kept: the task name, the masked input, the masked answer, status and latency. Keys, tokens, e-mails, phone numbers, IP addresses, card and IBAN numbers and personal paths are masked before writing; the system prompt is never stored.
- Teach it:
python3 pack_memory.py feedback last okconfirms a result,python3 pack_memory.py feedback last bad --fix "the right answer"corrects it. Confirmed and corrected runs are reused as validated examples when a similar input comes in. Unrated runs are never injected into a prompt. - Find similar cases:
python3 pack_memory.py similar "some text"andpython3 pack_memory.py clusters(groups of near-identical failures) work in plain Python, no model needed. Optional meaning-based matching uses an embedding model you already run locally:python3 pack_memory.py enable-semantic(Ollama on this machine only). - Share, only if you want:
python3 pack_memory.py exportwrites an anonymised summary (counts, statuses, size buckets, no text) for you to review. - Control:
PACK_MEMORY=0turns it off,PACK_MEMORY_STORE_TEXT=0keeps fingerprints only,python3 pack_memory.py purge --yeswipes it.
License
Personal use per purchase. Resale prohibited.
