audit-allow-builds
Skill2 starsChanged 40 days agoMITView on GitHub
Audits pnpm allowBuilds whitelist packages for supply-chain risk: resolved lockfile versions, new registry releases, lifecycle scripts, trust downgrades, and incident intel. Runs checks and install verification. Use when the user asks about allowBuilds, postinstall/build scripts, strictDepBuilds, approve-builds, or whether native-build deps were compromised.
- Installs packages
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-auditSkill
- agentic-reactorSkill
- agent-orchestratorSkill
- ai-optimizationSkill
- architecture-synthesisSkill
- audit-ide-dependenciesSkill
- author-workflow-skillSkill
- bdd-strategizerSkill
- chrome-extension-mv3Skill
- concurrent-cli-agentsSkill
- control-feederSkill
- control-graphSkill
- cursor-transcript-harvestSkill
- cv-promote-guardSkill
- devcontainer-hardenedSkill
- dual-copy-skill-publishSkill
- explore-repo-readonlySkill
- finder-reactorSkill
- fix-dependency-securitySkill
- fusion-sageSkill
- git-worktreesSkill
- grok-host-prepSkill
- gt-flowSkill
- higher-order-decision-architectSkill
- looperSkill
- master-plannerSkill
- mvu-refactor-planSkill
- odysseus-navigatorSkill
- project-editor-profileSkill
- react-client-expertSkill
- semantic-markup-cssSkill
- semantic-nameSkill
- session-unit-orderSkill
- shell-kernel-ontologySkill
- skill-rename-propagationSkill
- split-to-prsSkill
- src-tree-reorganizeSkill
- stellar-roadmapSkill
- stellar-spacemapSkill
- subagent-delegationSkill
- subagent-explore-reportSkill
- supply-chain-hardenSkill
- tauri-agenticSkill
- tauri-ipc-debugSkill
- tidy-commit-pushSkill
- upgrade-packagesSkill
- verification-cockpitSkill
- x-agent-resourcesSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
Never: add true for convenience. Only packages that require native builds or documented postinstall (e.g.
- Very specific: line 73
If pnpm why finds nothing but the name remains true in allowBuilds, the whitelist entry is stale — set to false or remove after user …
- Distinctive: line 87
Check whether a newer release exists (supply-chain incidents often land as sudden patches):
- Distinctive: line 106
When upgrading an allowBuilds package, follow upgrade-packages and re-run this skill on the new lockfile versions.
- Distinctive: line 122
Use when audit is clean but risk is elevated (news, maintainer takeover, unexpected install failure):
- Distinctive: line 137
After known ecosystem incidents affecting an allowBuilds package:
- Distinctive: line 159
Run Step 3 script inspection on the exact version to be locked
- Distinctive: line 160
Prefer parent upgrade over expanding the whitelist
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Audit allowBuilds packages
Workflow for packages explicitly allowed to run lifecycle/build scripts (preinstall / install / postinstall) under pnpm’s allowBuilds map. These are the highest-risk install surface after a maintainer hijack or typosquat.
Pair with fix-dependency-security (audit, SFW, workspace policy) and upgrade-packages (bumps that may add new script runners).
Why this is separate
| Control | What it blocks |
pnpm audit | Known CVEs in resolved versions |
minimumReleaseAge / blockExoticSubdeps | Fresh or exotic installs |
trustPolicy: no-downgrade | Weaker npm trust evidence vs prior release |
allowBuilds | Which packages may execute code at install time |
A package can pass audit and still ship a malicious postinstall in a new patch. Re-audit allowBuilds entries after lockfile changes, incident news, or approving new build runners.
Workflow checklist
- [ ] 1. Read allowBuilds (true entries only) from pnpm-workspace.yaml
- [ ] 2. Map lockfile versions: pnpm why <pkg> for each
- [ ] 3. Drift: stale whitelist vs tree; unapproved builds (install dry-run)
- [ ] 4. Advisories: pnpm audit (focus on allowBuilds names)
- [ ] 5. Scripts: npm view <pkg>@<version> scripts (current + latest)
- [ ] 6. Intel: Socket package score / StepSecurity write-ups if suspicious
- [ ] 7. Reinstall verify: sfw pnpm install --frozen-lockfile
- [ ] 8. Report: versions, parents, actions takenStep 1: Inventory the whitelist
In pnpm-workspace.yaml, list every allowBuilds key set to true. Ignore false denials.
Confirm guardrails stay on (do not disable without user approval):
strictDepBuilds: truedangerouslyAllowAllBuilds: falsetrustPolicy: no-downgrade(when present)minimumReleaseAge/minimumReleaseAgeStrict(when present)
Never add true for convenience. Only packages that require native builds or documented postinstall (e.g. sharp, esbuild).
Step 2: Resolved versions in this repo
For each allowed package name:
pnpm why <package>Record:
- Exact version(s) in
pnpm-lock.yaml - Importer chain (direct dep vs transitive — e.g.
sharpvianextand@huggingface/transformers)
If pnpm why finds nothing but the name remains true in allowBuilds, the whitelist entry is stale — set to false or remove after user confirms nothing in the tree needs it (e.g. esbuild listed but not installed).
List all packages in the tree that still have ignored builds:
pnpm install --frozen-lockfile 2>&1 | rg -i "ignored build|ERR_PNPM_IGNORED_BUILDS|unreviewed"With strictDepBuilds, install fails until every script runner is explicitly allowed or denied.
Step 3: New versions vs locked versions
Check whether a newer release exists (supply-chain incidents often land as sudden patches):
pnpm outdated esbuild sharp onnxruntime-node protobufjs unrs-resolverFor each locked and latest version you care about, inspect lifecycle scripts on the registry:
npm view <package>@<locked-version> scripts version --json
npm view <package>@latest scripts version --jsonRed flags (investigate before bumping or re-allowing):
- New or changed
postinstall/install/preinstallon a package that previously had none - Scripts that curl, download binaries from non-project domains, or read env secrets
- Version published within
minimumReleaseAgewindow (install may be blocked — intentional)
When upgrading an allowBuilds package, follow upgrade-packages and re-run this skill on the new lockfile versions.
Step 4: CVE / advisory pass
pnpm auditCross-check output paths for allowBuilds package names. Fix via overrides or parent bumps per fix-dependency-security — do not only silence advisories.
Step 5: Supply-chain intel (incidents & behavior)
Use when audit is clean but risk is elevated (news, maintainer takeover, unexpected install failure):
| Source | Use |
| Socket package | socket package deep pkg:npm/<name>@<version> — install-script and behavior signals |
Socket Firewall (sfw) | Blocks confirmed malicious fetches on reinstall |
| StepSecurity | npm incident timelines (typosquat, token leak) |
https://socket.dev/npm/package/<name> | Quick human review |
Optional (if @socketsecurity/cli / socket is installed globally):
socket package deep pkg:npm/sharp@0.34.5After known ecosystem incidents affecting an allowBuilds package:
pnpm store prune
sfw pnpm install --frozen-lockfileStep 6: Approving or denying builds
Interactive or explicit approval writes pnpm-workspace.yaml:
pnpm approve-builds # interactive
pnpm approve-builds sharp !core-js # allow sharp, deny core-js
pnpm approve-builds --all # only with explicit user approvalBefore setting a new entry to true:
- Confirm the dependency is required (
pnpm why) - Run Step 3 script inspection on the exact version to be locked
- Prefer parent upgrade over expanding the whitelist
pnpm add --allow-build=<pkg> adds the same map entry — treat like approve-builds.
Step 7: Validate
sfw pnpm install --frozen-lockfile
pnpm audit
pnpm type-check
pnpm lint
pnpm build # if native modules (sharp, onnxruntime-node) changedSummarize for the user:
| Package | Locked version | Parents | Latest on registry | Script delta | Action |
| … | … | … | … | none / changed | hold / bump / deny build |
Project-specific notes
See examples/README.md for example allowBuilds whitelists (e.g. Next.js + ML native deps).
Anti-patterns
- Setting
dangerouslyAllowAllBuilds: trueto silenceERR_PNPM_IGNORED_BUILDS - Adding packages to
allowBuildswithoutpnpm whyandnpm view … scripts - Assuming
pnpm auditclean means postinstall-safe - Leaving
truefor packages no longer in the lockfile - Approving
--allpending builds without per-package review - Skipping
sfwreinstall after a published npm incident affecting an allowBuilds name
Related skills
- fix-dependency-security — audit, overrides, SFW,
minimumReleaseAge,trustPolicy - audit-ide-dependencies — editor extensions/plugin caches (when IDE trees have their own lockfiles)
- upgrade-packages — version bumps; re-run this audit after Tier A/B/C upgrades
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

