agentleFS
QuentinCodyQuentinCody/interlinked-cli/skills/interlinked-supply-chain/SKILL.md

interlinked-supply-chain

Skill185 starsChanged 25 days agoMITView on GitHub

Respond to blocked package installs and manage the Interlinked supply-chain allowlist. Load this when `npm/pnpm/yarn/bun/pip/pipx/poetry/uv/cargo/gem/bundle/go/composer/mvn/dotnet` install is BLOCKED with `[interlinked:supply-chain]`, when adding a dependency to package.json / requirements.txt / pyproject.toml / Cargo.toml / go.mod is refused, when a version is rejected as \"not an exact pin\", when `npm ci` fails a lockfile-snapshot check, or when you need to approve a package (`interlinked allowlist add`), snapshot a lockfile, or verify deps. Package installs are default-deny; a package needs both allowlist membership AND an exact version pin.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Unpinned version?: Add the exact version: npm install lodash@4.17.21 (only if lodash is already allowlisted).

    line 60
  2. Very specific:

    Do not --force. Do not switch to editing the manifest (that's the second gate, also blocked).

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

interlinked-supply-chain — package installs are default-deny

In an Interlinked-guarded repo, every package install is blocked before it runs unless the exact package is pre-approved on .interlinked/package-allowlist.json. The stance: any new dependency is potentially malicious (a response to the npm/PyPI malware surge). You cannot install your way out, and you cannot silently self-approve. When blocked, the correct move is almost always to surface the need to the human, not to force-approve.

Two independent requirements for an install to pass: (a) the name is allowlisted AND (b) the version is an exact pin (pkg@1.2.3). An approved name at a floating version (lodash, lodash@^4, lodash@latest) is still blocked — a range can resolve to a newer, compromised release.

PyPI names use standard canonical spelling: case-insensitive, with runs of -, _ and . collapsed to -. PyYAML and pyyaml use the same grant. This does not authorize a different version. Conflicting legacy aliases fail closed; an authorized add replaces aliases with one canonical entry, and remove removes all aliases. Other ecosystems retain their own semantics. tests readiness python --json only proposes already-approved exact install argv; it never installs or adds an approval. Resolve missing grants through the existing operator boundary.

Load this when

  • A package install was blocked with [interlinked:supply-chain].
  • Editing a manifest (package.json, requirements.txt, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, *.csproj, …) to add a dep was refused.
  • npm ci / bare npm install / pip install -r fails a snapshot check.
  • You need to approve, snapshot, list, or verify allowlisted packages.

What gets blocked

ActionResultWhy
npm install left-pad (name not allowlisted)blocknot approved
npm install lodash / lodash@^4 / lodash@latestblocknot an exact pin (range/tag)
npm install lodash@4.17.21 (allowlisted + pinned)allow—
npm install --registry https://evil.tld pkg / --index-url …blockcustom registry bypasses signing
npm install git+https://… / tarball URL / file: specblocknever auto-approved (bypasses registry)
npm ci / bare npm install / pip install -r req.txt with no matching snapshotblocklockfile not snapshot-approved
Edit package.json to add "evil": "^1"blockmanifest-edit gate (a second, separate gate)
npm uninstall x / version bump of an existing depallownothing new enters
npm install ./local-dir (local path)allowin-workspace, version-controlled
install verb while the daemon is downblock (fail-closed)a dead guard is a security failure

Example block text:

[interlinked:supply-chain] npm add: 'left-pad' is not in the npm allowlist.
Run `interlinked allowlist add npm left-pad` after reviewing the package.

When an install is blocked: what to do

First, question the dependency — the cheapest approved package is the one you don't add. Confirm it's actually needed and not trivially replaceable (stdlib/native, or a dep already present); many "blocked install" situations are really "don't add this" (e.g. left-pad → native padStart). If it is warranted:

  1. Read the reason — it names the rule and the fix.
  2. Unpinned version? Add the exact version: npm install lodash@4.17.21 (only if lodash is already allowlisted).
  3. Unapproved package? Stop and surface to the human. State the package, version, and why you need it, and propose: interlinked allowlist add <ecosystem> <package> --by <human> --reason "…". Do not --force. Do not switch to editing the manifest (that's the second gate, also blocked).
  4. Snapshot mismatch (a sync like npm ci)? The manifest/lockfile changed vs the approved snapshot — a human re-runs interlinked allowlist snapshot --by <human>.
  5. Custom registry? Drop the --registry/--index-url override; use the default registry.
  6. Daemon down ([harness-offline])? interlinked harness start, then retry.

Getting a package approved (human sign-off operations)

An agent can record a request without granting approval:

interlinked allowlist propose npm example-package --package-version 1.2.3 --reason "Needed for the public API" --json

This writes a pending record under .interlinked/package-proposals/. It does not contact a registry, install anything, change the allowlist, or send a message. Writer identity remains unknown. Surface the concrete request for operator review; the operator provisions approval separately. In an externally frozen deployment, approval files and their path ancestors must be protected by the supervisor while proposal/receipt state stays writable. A same-UID local daemon and a proposal label do not establish that boundary.

interlinked allowlist add <ecosystem> <package> --by <name> [--reason <t>] [--version-range <r>] [--force]

--by is required. Ecosystems: npm, pypi, cargo, rubygems, go, composer, maven, gradle, nuget. --by is an attribution label, not authenticated approval. The local writable allowlist does not enforce an immutable-policy experiment: an agent with the same filesystem authority can change it. Such a deployment needs policy owned outside the agent's write scope (including its parent directory), with direct edits, replacement and CLI writes tested against that boundary. Guidance to request approval is not that boundary. add runs three admission screens (cheapest first) and refuses without --force if any fires:

  1. Typosquat (npm only, offline) — Levenshtein ≤2 to a popular package name.
  2. License (network) — the version's declared SPDX license vs the committed license_allowlist (recorded on the entry, re-checked later at manifest-edit time).
  3. OSV advisories (network, api.osv.dev) — open vulnerabilities against the version.

--force = "I reviewed this and accept the risk"; it records the finding as a note instead of refusing. An agent should not --force on its own initiative — approving a bad package is the worst failure mode (install then proceeds silently). Surface the screen output to the human. Screens 2–3 fail open with a loud note: when offline — a clean add with "screen skipped" notes did not pass those screens.

Whole-lockfile approval (unblocks npm ci / bare install / pip install -r):

interlinked allowlist snapshot --by <name> [--lockfile <name>]   # sha256 every manifest+lockfile in cwd

Re-snapshot whenever the manifest/lockfile changes — the gate matches on exact hash.

Command surface

CommandPurpose
interlinked allowlist add <eco> <pkg> --by <name> [--reason] [--version-range] [--force]Approve one package (3 screens).
interlinked allowlist remove <eco> <pkg>Delete an entry.
interlinked allowlist list [--ecosystem <e>] [--json]Show approved packages + snapshots.
interlinked allowlist snapshot --by <name> [--lockfile <n>]Hash + store manifest/lockfile state.
interlinked allowlist verifyDiff every committed manifest's deps vs the allowlist AND screen the root JS lockfile's resolved (transitive) packages; exits 1 on any unapproved (CI-gateable).

Transitive packages (added 2026-10-04)

The install gate sees only the packages NAMED on the command line. The registry resolves the rest, so a transitive dependency — including a native one (koffi pulled @koromix/koffi-darwin-arm64, a 1.2 MB .node) — reaches node_modules with no entry and no block. Two surfaces close that gap:

  • After an install (lockfile_transitive_deps, PostToolUse, warn-only, [proven]): the harness diffs the lockfile before and after the command and warns for every NEW package not on the allowlist, native ones first. It cannot block: the bytes are already on disk. An unparseable lockfile or a missing before-snapshot is reported as NOT MEASURED, never clean.
  • allowlist verify now fails when the root lockfile (package-lock.json, npm-shrinkwrap.json, pnpm-lock.yaml, yarn.lock, bun.lock) holds a package that is not on the allowlist, EVEN WHEN every direct dependency is approved. A matching lockfile_snapshots grant for that exact lockfile approves the whole resolved set. Rows are capped at 25 per lockfile plus one summary row; an unparseable lockfile is reported as NOT screened. Only the root lockfile is screened (the same scope allowlist snapshot hashes).

Remediation: review the transitive packages that verify lists (native evidence is called out), then have a human approve the resolved set with interlinked allowlist snapshot --lockfile <file> --by <name>, or approve individual packages with allowlist add. An agent must not snapshot to silence the check on its own.

Allowlist file format — .interlinked/package-allowlist.json (committed, PR-reviewed)

{
  "version": 1,
  "packages": { "npm": { "lodash": { "approved_by": "qcody", "reason": "utility",
                                      "version_range": "^4.0.0", "license": "MIT" } }, "pypi": {}, … },
  "lockfile_snapshots": { "package-lock.json": { "sha256": "…", "approved_by": "qcody" } },
  "license_allowlist": ["MIT", "Apache-2.0", …]
}

Malformed JSON loads as an empty allowlist (fail-safe: never blocks bootstrap on syntax; verify surfaces the parse error separately). A per-package version_range additionally constrains which requested version passes. license_allowlist is optional — when absent (as in a minimal file), admission falls back to a permissive built-in default seed.

Gotchas

  • Fail-closed when the daemon is down. The cold paths block installs (the coarse .mjs path blocks all install verbs and tells you to interlinked harness start).
  • Exact-pin is separate from membership. An allowlisted name is still blocked at a floating version. Pin grammar is per-ecosystem (npm/cargo/go need full major.minor.patch; PyPI ==24.2; RubyGems '7.1'; Maven/Gradle reject -SNAPSHOT).
  • Manifest-edit is a distinct gate. Get the package approved first, then edit the manifest, then install at the pin. Flipping a dep to a git/path/URL source counts as new → blocked. A plain version bump of an existing dep is allowed. Supported manifest classifiers retain a dependency's exact registry version when checking a version-scoped approval. For example, PyYAML==6.0.2 can satisfy an approval for 6.0.2; it is not treated as an unspecified request. Python extras and environment markers do not supply the package version. A wrong, missing or ambiguous pin cannot borrow a version from a marker, URL or nested table. This does not add unsupported manifest syntaxes or authorize an agent to approve its own dependencies.
  • interlinked audit is NOT this. It's the tamper-evident guard-decision log (see interlinked-observability). The dependency-vuln (SCA) lane runs in the default interlinked verify (the dep-audit tool, npm audit-based). Membership auditing = interlinked allowlist verify.
  • A few harness dev-tools are pre-allowed for membership (npm vitest/@vitest/coverage-v8/ @vitest/coverage-istanbul; pypi pytest/pytest-cov/coverage/radon) so the coverage gate isn't a catch-22 — they still need an exact pin. Everything else is default-deny.
  • --ignore-scripts warn still fires on allowlisted installs (defense-in-depth).
  • Env bypass INTERLINKED_DISABLE_PACKAGE_GUARD=1 is logged and defeats the whole layer for that command — for documented bootstrap flows only, not for getting unstuck.

Related skills

  • interlinked-harness — the general PreToolUse guard this gate is part of.
  • interlinked-observability — interlinked audit (the guard-log integrity check).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.