Harness supply chain audit

From Intense-Visions/harness-engineering · View interactive version

Harness supply chain audit is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > 6-factor dependency risk evaluation adapted from Trail of Bits security skill patterns. Surfaces dependency risk flags for human review — not automated verdicts.

How to use this skill

Skill file

Harness Supply Chain Audit

6-factor dependency risk evaluation adapted from Trail of Bits security skill patterns. Surfaces dependency risk flags for human review — not automated verdicts.

When to Use

Iron Law

Present findings as flags for human review, never as verdicts. A dependency flagged as "high risk" may be entirely appropriate for a project. The skill surfaces signals; humans decide whether to act.


Process

Phase 1: INVENTORY — Build Dependency List

  1. Resolve project root. Use the path argument or default to the current directory.
  1. Detect lockfile. Check for the following in order:
  1. Parse direct dependencies from package.json:
  1. Parse transitive depth from lockfile:
  1. Build inventory table:

```

INVENTORY: <project-name>

Direct dependencies: N

Dev dependencies: N

Total packages (including transitives): N

Deep transitive packages (depth > 5): N

```

  1. Proceed to EVALUATE.

Phase 2: EVALUATE — Score Dependencies on 6 Factors

For each direct dependency (and any transitive with depth > 5), score on 6 factors:

Network access required: npm registry (https://registry.npmjs.org/<pkg>) and GitHub API (https://api.github.com/repos/<owner>/<repo>).

- If npm registry returns 404: mark as "unresolvable", flag for manual review, skip remaining factors

- If GitHub API rate limits hit: score maintenance-status as "unknown", continue with other factors

- If no GitHub repo link in package metadata: skip maintenance-status factor, note in report

Factor 1: Maintainer Concentration
Factor 2: Maintenance Status
Factor 3: Popularity Signal
Factor 4: Install Scripts
Factor 5: Known CVEs
Factor 6: Transitive Risk
Risk Scoring

Combine factor scores into an overall risk level:

| Overall Risk | Condition |

| ------------ | -------------------------------------------------------------- |

| Critical | Factor 5 is Critical (any high/critical CVE) |

| High | 2+ factors scored High, OR Factor 1 is High + Factor 2 is High |

| Medium | 1 factor scored High, OR 3+ factors scored Medium |

| Low | All factors Low or at most 1 Medium |


Phase 3: REPORT — Generate Risk Summary

  1. Produce risk summary table sorted by overall risk (Critical first):

```

Supply Chain Audit: <project-name>

Date: <ISO date>

Packages evaluated: N direct + M deep transitives

┌─────────────────────┬──────────┬────────────┬─────────────┬────────────┬──────┬─────────────┐

│ Package │ Version │ Maintainers│ Last Publish│ Downloads │ CVEs │ Overall Risk│

├─────────────────────┼──────────┼────────────┼─────────────┼────────────┼──────┼─────────────┤

│ example-pkg │ 1.2.3 │ 1 (HIGH) │ 18mo (HIGH) │ 500 (MED) │ none │ HIGH │

│ another-pkg │ 2.0.0 │ 12 │ 2mo │ 50k │ 1 mod│ MEDIUM │

└─────────────────────┴──────────┴────────────┴─────────────┴────────────┴──────┴─────────────┘

```

  1. Detail section for Critical and High risk packages:

```

HIGH RISK: example-pkg@1.2.3

├── Maintainer concentration: 1 maintainer (bus factor = 1)

├── Maintenance status: Last publish 18 months ago, no commits in 12 months

├── Popularity: 500 weekly downloads

├── Install scripts: none

├── Known CVEs: none

└── Transitive risk: depth 2, subtree 4 packages

Recommendation: Consider replacing with a well-maintained alternative,

or pin the version and monitor for abandonment.

```

  1. Install script warnings (any package with install scripts):

```

INSTALL SCRIPTS DETECTED:

```

  1. Summary line:

```

RESULT: 1 Critical, 2 High, 3 Medium, N Low — Review flagged items before release

```

  1. Output: Print report to stdout. If --output <file> was passed, also write to that file.

Gates

Harness Integration

Evidence Requirements

When reporting findings, cite the source for each factor:

Do not assert risk scores without citing the specific data point that generated the score.

Success Criteria

Escalation

Rationalizations to Reject

These are common rationalizations that sound reasonable but lead to incorrect results. When you catch yourself thinking any of these, stop and follow the documented process instead.

| Rationalization | Why It Is Wrong |

| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |

| "This package has high risk signals but it is widely used, so it must be safe" | The Iron Law: present findings as flags for human review, never as verdicts. Popularity does not eliminate bus-factor risk or maintenance abandonment. |

| "The npm API returned an error for this package, so I will skip it and move on" | API failures produce "unknown" scores with a note, not skips. Partial results with noted gaps are always better than incomplete audits. |

| "The install script is probably just native addon compilation, so I do not need to flag it" | Every install script must be flagged in the report. "Probably legitimate" is exactly the assumption that supply chain attacks exploit. |

Examples

Supply Chain Audit: my-project
Date: 2026-03-31
Packages evaluated: 24 direct + 3 deep transitives (depth > 5)

CRITICAL (1):
  lodash@4.17.20 — CVE-2021-23337 (high severity, unpatched)

HIGH (2):
  abandoned-util@0.9.1 — sole maintainer, last publish 22 months ago
  sketchy-helper@2.1.0 — sole maintainer, postinstall script detected

MEDIUM (3):
  small-lib@1.0.0 — 800 weekly downloads (low popularity signal)
  ...

LOW (18): no significant risk signals

INSTALL SCRIPTS:
  node-gyp@9.4.0 — postinstall (native compilation, likely legitimate)
  sketchy-helper@2.1.0 — postinstall (REVIEW: contents unknown)

RESULT: 1 Critical, 2 High, 3 Medium, 18 Low
Next steps: Update lodash to patch CVE. Review sketchy-helper postinstall script.
Consider alternatives to abandoned-util.

Example Output

Supply Chain Audit: my-project
Date: 2026-03-31
Packages evaluated: 24 direct + 3 deep transitives (depth > 5)

CRITICAL (1):
  lodash@4.17.20 — CVE-2021-23337 (high severity, unpatched)

HIGH (2):
  abandoned-util@0.9.1 — sole maintainer, last publish 22 months ago
  sketchy-helper@2.1.0 — sole maintainer, postinstall script detected

MEDIUM (3):
  small-lib@1.0.0 — 800 weekly downloads (low popularity signal)
  ...

LOW (18): no significant risk signals

INSTALL SCRIPTS:
  node-gyp@9.4.0 — postinstall (native compilation, likely legitimate)
  sketchy-helper@2.1.0 — postinstall (REVIEW: contents unknown)

RESULT: 1 Critical, 2 High, 3 Medium, 18 Low
Next steps: Update lodash to patch CVE. Review sketchy-helper postinstall script.
Consider alternatives to abandoned-util.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.