Agent Skill
Supply chain risk auditor (Trail of Bits)
Audits a project's dependencies with bundled scripts: advisories across the lockfile, abandoned upstreams, npm publisher concentration and install scripts.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit 149d7b2, the version we read, wherever the install method supports it.
npx skills
npx skills add trailofbits/skills@149d7b21f4067765b82e67029730b42d228ef4b4 --skill supply-chain-risk-auditor -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add trailofbits/skills
/plugin install supply-chain-risk-auditor@trailofbitsRun inside Claude Code. Installs the whole supply-chain-risk-auditor plugin from its default branch, not the pinned commit.
npx skills
npx skills add trailofbits/skills@149d7b21f4067765b82e67029730b42d228ef4b4 --skill supply-chain-risk-auditor -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add trailofbits/skills@149d7b21f4067765b82e67029730b42d228ef4b4 --skill supply-chain-risk-auditor -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install trailofbits/skills plugins/supply-chain-risk-auditor/skills/supply-chain-risk-auditor --pin 149d7b21f4067765b82e67029730b42d228ef4b4 --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add trailofbits/skills@149d7b21f4067765b82e67029730b42d228ef4b4 --skill supply-chain-risk-auditorPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
Audits a project’s dependencies for supply-chain risk, with the measuring done by bundled Python scripts rather than the model. The skill explains why: when the agent collected figures by hand, it got maintainer counts and download numbers badly wrong. collect.py reads manifests and lockfiles (npm, Python with uv.lock, Go modules), then checks version-matched security advisories for direct dependencies and the whole lockfile tree, flags abandoned or archived upstream repositories, measures how concentrated npm publishing rights are, and lists packages with install-time scripts. render.py turns the findings JSON into a Markdown report. Two rules are built in: missing data is never treated as evidence of risk, and a run that measured nothing fails instead of reporting a clean result.
When to use it
Before adopting a large dependency, at the start of a security engagement, after a scare in your ecosystem, or as a periodic review of what your lockfile pulls in.
When to skip it
Projects whose lockfile it does not read: yarn.lock, pnpm-lock.yaml and poetry.lock are not parsed, and the report falls back to pinned or latest versions, so transitive results are weaker there. It also does not replace a software composition analysis tool in CI; it is a point-in-time audit.
Try it
Audit the dependencies of this repository for supply-chain risk. Write the
report outside the repo, and for each flagged install script say whether
npm ci --ignore-scripts would work for us.
What it can touch
- Bundles scripts
- Yes
- Pre-approved tools
- Read Write Bash Glob Grep
- Needs
- uv; GitHub CLI (gh), logged in, for API rate limits; Network access to advisory and registry APIs
- Client-specific fields
- None, spec fields only
Its scripts run with your permissions, and it may have changed since the commit we read. How to check a skill.
allowed-tools pre-approves Read Write Bash Glob Grep. The scripts run with uv and call advisory databases, package registries and the GitHub API over the network, using your gh login for rate limits (without it, GitHub allows 60 requests an hour and many checks come back unassessable). It reads your manifests; it does not install your dependencies. Content is licensed CC-BY-SA-4.0.
At commit 149d7b2 the SKILL.md is 122 lines long. Alongside it:
agents/(1 entry)assets/(1 entry)scripts/(10 entries)
Alternatives
Skill scanner for the other supply chain an agent has, its skills; see also our security checklist for third-party skills. Modern Python sets up Dependabot and pip-audit for ongoing checks.
SKILL.md
The file exactly as published at the reviewed commit, reproduced under its CC-BY-SA-4.0 licence.
---
name: supply-chain-risk-auditor
description: "Audits a project's dependencies for supply-chain risk: version-matched advisories for direct dependencies and the full lockfile tree, abandoned or archived upstreams, npm publisher concentration, and install-time script execution. Use when asked to audit dependencies, assess supply-chain or third-party package risk, or review a dependency tree before an engagement."
allowed-tools: Read Write Bash Glob Grep
---
# Supply Chain Risk Auditor
Generates a supply-chain risk report for a project's direct dependencies (npm, PyPI,
Go), plus an advisory sweep of everything its lockfile resolves. Two deterministic
scripts do the measuring; your job is the judgment they refuse to automate.
## Why the scripts do the measuring, not you
Every figure in this report is a claim about somebody else's project, and hand-collected
figures were measured wrong before this skill was rebuilt around scripts: GitHub
contributor counts said five-plus people maintain `lodash` where npm's ACL says one, and
`gh` saw zero downloads for a package that moves 164 million a week. Do not estimate
maintainer counts, downloads, staleness, or CVE history from `gh`, web search, or
memory — run the collector, and quote what it measured.
The scripts enforce two rules worth knowing before you read their output:
- **Unavailable data is never evidence of risk.** Every criterion resolves to
assessed-clean, assessed-flagged, or unassessable-with-a-reason.
- **An absent measurement is never a clean verdict.** A run that measured nothing exits
non-zero instead of printing a report that finds nothing.
## Workflow
1. Confirm the target directory has manifests: `package.json`, `pyproject.toml`,
`requirements*.txt`, or `go.mod`. If none exist, say so and stop — do not audit an
ecosystem this collector does not parse by hand. Lockfiles read for exact versions
and the transitive sweep: `package-lock.json`/`npm-shrinkwrap.json`, `uv.lock`, and
a go 1.17+ `go.mod`. `yarn.lock`, `pnpm-lock.yaml`, and `poetry.lock` are not read —
the report says so when they are present, and versions fall back to pins or the
latest release.
2. Check `gh auth status`. Unauthenticated GitHub allows 60 requests/hour against 5,000,
and the collector makes several per dependency; expect repository criteria to come
back unassessable without it. Say so rather than fixing it silently.
3. Collect, then render. Put outputs somewhere outside the audited repository unless
asked otherwise:
```sh
uv run {baseDir}/scripts/collect.py <project-dir> --json <out-dir>/findings.json
uv run {baseDir}/scripts/render.py <out-dir>/findings.json --out <out-dir>/report.md
```
Expect a few minutes for ~50 dependencies — several HTTP requests per dependency,
more with many Go modules, and slower without authenticated `gh`. If `collect.py`
exits non-zero, it is refusing to report — relay its message verbatim instead of
retrying or working around it.
4. Read `report.md` and `findings.json`. The report is the deliverable; the JSON carries
the datum behind every verdict when you need to cite one.
5. Add what the collector cannot, clearly separated from what it measured:
- A short narrative for this reader: what to act on first, and why.
- Upgrade paths for advisory findings — check whether the fix is a patch or a major
version away.
- Replacement candidates for abandoned or archived dependencies. Verify a candidate
exists in the registry before naming it, and label these as judgment, not
measurement.
- For flagged install scripts: whether `npm ci --ignore-scripts` is viable for this
project's build.
## Style for what you add
Write added prose the way a security report reads, and apply the same register to the
report addendum and the final reply alike — replies get pasted into tickets and reports
verbatim. State the finding, the datum behind it, and the action.
- Impersonal and declarative: no first or second person ("I ran the collector", "you
should upgrade"), no contractions, no exclamation points.
- Active voice, with the subject matter as the actor: "upgrading to 1.19.0 clears all
25 advisories", not "it is recommended that axios be upgraded".
- Objective: no intensifiers or subjective framing ("very", "significant",
"fortunately"), and no guesses about why the project chose what it chose.
- Tense: past for what the audit did, present for the state of the dependencies,
future for the consequences of acting or not.
- Constructive: a recommendation names the action and its cost, never a culprit.
If the `report-writing:writing-style` skill is available in the session, follow it —
it is the full version of this register.
The rendered report carries facts only. The interpretive rules below are instructions
to you, not content for the reader — do not copy them into the deliverable as caveats
or framing.
## Reading the report
- **Unassessable is not risk.** PyPI publishes no maintainer ACL and Go has no registry;
those rows say what could not be known, not what is wrong.
- **The coverage table bounds every claim.** "No advisories" means "none among what was
assessed" — check the assessed count before repeating a clean verdict.
- **Quote figures verbatim.** Do not re-derive, round, or embellish the report's
numbers; every one is reproducible from the artifact.
- **Absence from the findings is not endorsement.** A dependency with no findings was
measured against these criteria only.
## Rationalizations to reject
- "`gh` can give me maintainer counts faster than the collector." Measured wrong — repo
contributors and registry publish rights are different populations.
- "No findings, so the dependencies are safe." Read the coverage table; on PyPI and Go,
half the criteria are structurally unassessable.
- "The unassessable rows would just confuse the reader; I'll drop them." They are the
boundary of every claim in the report. Dropping them turns partial coverage into a
clean bill of health, which is the failure this skill was rebuilt to prevent.
- "The version is probably close enough." A range checked at latest-release and a
lockfile-resolved version are different claims; the report labels which one it makes.
Keep the label.
## When not to use
- License compliance auditing.
- Scanning the target's own source for vulnerabilities or secrets — this skill never
reads dependency source, only registry, advisory, and repository metadata.
- Judging whether the project installs or builds. The audit is designed to work from
nothing more than the dependency list — manifests and lockfiles — and never installs,
builds, or executes anything. Broken installs and import-time breakage are out of
scope, and worth saying so if the user seems to expect them.
- Ecosystems other than npm, PyPI, and Go; say the ecosystem is unsupported rather than
improvising an audit for it.Related skills
Skill scanner (Sentry)
Audits an agent skill for prompt injection, risky scripts, excessive permissions, secret exposure and supply-chain problems, with a static scan script.
Modern Python setup (Trail of Bits)
Trail of Bits' skill that sets up or migrates Python projects to uv, ruff and ty, with pyproject templates, PEP 723 scripts, pre-commit hooks and Dependabot.
Agentic Actions auditor (Trail of Bits)
Audits GitHub Actions workflows that run Claude Code, Codex, Gemini CLI or GitHub AI Inference for paths where attacker input reaches the agent.
Guides and recipes that use Supply chain risk auditor (Trail of Bits)
- Audit and upgrade risky dependencies with an agent
Audit project dependencies with Trail of Bits' supply-chain-risk-auditor skill, group upgrades by risk, update one batch on a branch and prove tests pass.
- Skill scripts: bundling code in a skill without making it unsafe
When a skill should ship a script instead of instructions, how to write skill scripts agents can run reliably, and what a reviewer checks before trusting one.
- AI security
Defending against prompt injection, data leakage and over-permissioned agents.