---
name: supply-chain-install-protection
description: Configure, verify, and reason about install-time package-manager protection, minimum release age gates, Socket Firewall shims, dependency audits, and supply-chain risk on developer machines and repos.
version: 1.0.0-codex
author: Hermes Agent, adapted for Codex
license: MIT
title: supply-chain-install-protection
canonical_url: https://skilld.dev/gh/kartikkabadi/skills/supply-chain-install-protection
last_updated: 2026-09-26T19:16:41.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install kartikkabadi/skills/supply-chain-install-protection`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/supply-chain-install-protection`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/kartikkabadi/skills/supply-chain-install-protection) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/supply-chain-install-protection`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/supply-chain-install-protection --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/supply-chain-install-protection --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Supply-Chain Install Protection

Use when the user asks to verify, harden, troubleshoot, or bypass package-manager install-time protection, or when auditing whether a machine/repo is affected by dependency compromise.

Goal: make the safe path the default path for future installs. Do not pretend future-fetch protection retroactively audits already-installed packages.

## Scope Model

Separate four jobs:

1. Install-time firewalling: intercept future package artifact fetches.
2. Cache reset: remove local package caches so future installs must fetch through protection.
3. Existing dependency audit: scan manifests, lockfiles, SBOMs, and installed state.
4. Whole-machine security review: OS/package posture, repo discovery, dependency audits, LaunchAgents/services, and redacted secret-pattern triage.

Do not conflate them.

## Default Workflow

1. Inspect authoritative docs before changing security config.
2. Verify current local state: package managers, shims, shell resolution, and relevant config.
3. Prefer PATH shims over aliases for developer-machine hardening.
4. Wrap only documented-supported managers; unsupported wrappers are security theater.
5. Preserve bypass and rollback.
6. Verify with no-install smoke tests before real installs.
7. Ask before cache clearing, external scans, installs/upgrades, CI changes, or private metadata upload.

## Whole-Machine Audit Workflow

Use when the user asks for a machine-wide supply-chain/security check.

1. Inventory before scanning: git repos, manifests/locks, package manager state, OS update state, Homebrew outdated state, launch agents/services when relevant.
2. Keep secret scanning redacted: report detector/confidence/file/line only; do not print candidate values.
3. Exclude `.env`, credential stores, SSH material, browser profiles, and protected dotfiles unless explicitly scoped.
4. Ask before transmitting dependency metadata externally.
5. Run ecosystem audits from the correct working directory:
   - `npm audit --json --audit-level=low` where npm lockfiles exist.
   - `pnpm audit --json --audit-level=low` where `pnpm-lock.yaml` exists.
   - `bun audit --json` where Bun locks exist.
   - `uvx pip-audit ...` for Python requirements/project locks.
   - `cargo-audit audit --json` from each `Cargo.lock` parent directory.
6. Report clean signals, active repo risks, archive/reference noise, manual review queues, and recommended next actions separately.

## Minimum Release Age Verification

Distinguish native age gates from firewalling:

- npm: `min-release-age` / moving `before` cutoff.
- pnpm: `minimumReleaseAge` in minutes (`pnpm config set minimumReleaseAge 4320 --global` or `~/.config/pnpm/config.yaml`; does **not** read npm `min-release-age` from `~/.npmrc`).
- Yarn Berry: `npmMinimalAgeGate`.
- Bun: `[install].minimumReleaseAge` in seconds.
- uv: `exclude-newer`.
- raw pip and standard cargo do not have first-class rolling minimum-release-age gates.

Existing lockfiles and already-installed packages are not automatically re-aged. Age gates mainly affect future resolution/fetch behavior.

## Remediation Workflow

1. Patch repo-by-repo, not with one machine-wide upgrade blast.
2. Check `git status` and preserve user work before dependency edits.
3. Use the repo's native package manager and lockfile.
4. Use overrides/resolutions only when normal updates cannot lift a vulnerable transitive dependency.
5. Re-run the exact audit after each repo patch and report advisory counts.
6. Run the smallest meaningful build/test gate after the audit is clean.
7. Use install-protection bypass only for tests/builds when no package fetch is occurring; do not bypass protected installs unless the user explicitly approves.

## Pitfalls

- Do not report protection as active just because a tool is installed. Active means package-manager invocations actually route through protection.
- Do not say a machine is clean just because future-fetch protection is active.
- Do not scan private repos with external services without approval.
- Do not read or print full dotfiles if they may contain secrets; target relevant snippets.
- Do not run one root audit and assume nested workspaces were covered.

## Socket Firewall (sfw) — machine layout

**Interactive shells (done on the user Mac):** aliases at end of `~/.zshrc` / `~/.bashrc` → `sfw <pm>`. Bypass: `command npm …`.

**Non-interactive / Codex / Cursor agents:** aliases do not apply. Use:

1. `~/.sfw-agent-bin/<pm>` wrappers (`exec /opt/homebrew/bin/sfw <pm> "$@"`).
2. Codex `[shell_environment_policy.set] PATH` prepends `~/.sfw-agent-bin` (keep `inherit = "core"`).
3. Cursor user rule: prefix installs with `sfw` unless the user approves bypass.

Do not put agent shims on global interactive PATH (fnm ordering).

**CI:** Per job, after checkout:

```yaml
- uses: socketdev/action@v1.3.1
  with:
    mode: firewall-free
```

Then `sfw npm ci`, `sfw pnpm install …`, `sfw bun install …`, `sfw cargo fetch` / `sfw cargo build` on cold registry fetches. Skip label-bot / spell-check workflows with no installs.

**Bazel-heavy jobs:** wrap explicit `pnpm`/`cargo` steps first; pilot before mass Bazel edits.
