Getting Started

What is SCAL-P?

SCAL-P is a security layer for npm, pnpm, yarn, and bun that enforces policy, verifies integrity, and scores trust before packages hit node_modules.

SCAL-P (Secure Chain Assurance Layer for Packages) is a security CLI that wraps npm, pnpm, yarn, and bun to enforce policy, verify integrity, and score trust — before packages hit your node_modules.

Think of it as a guard for your dependency graph: you define rules, SCAL-P enforces them every time someone runs npm install (or pnpm, yarn, bun). No SaaS, no API keys, no remote calls — it runs entirely on your machine or CI.

SCAL-P does not replace your package manager. It sits in front of it, reads the resolved dependency tree, evaluates policy, and either allows, warns, or blocks the operation. The package manager still does the actual install.

At a glance:

Package managersnpm, pnpm, yarn, bun
PlatformsLinux, macOS, Windows
LanguageGo (zero external dependencies — stdlib only)
LicenseOpen source (Apache License 2.0)
ModeCLI tool — install as binary or go install
SaaS required?No. Fully self-contained, offline-capable.
Lockfile.scalp/lockfile.json — content-hash based, separate from package-lock.json

The core idea: make every dependency auditable, traceable, and controllable by policy. No implicit trust.

How it works

Every package manager follows the same basic flow: resolve dependencies, download tarballs, unpack into node_modules, execute lifecycle scripts. The problem is that execution and installation happen before you can inspect what's coming.

SCAL-P inserts itself into that flow at two points:

Pre-install (policy evaluation). When you run scalp install <pkg> or scalp ci, SCAL-P asks the package manager to resolve the dependency tree. It then evaluates every leaf — package name, version, publisher, registry, transitive depth — against your policy. If anything violates a rule, the operation stops before a single tarball is downloaded.

Post-install (hash verification). After the package manager finishes, SCAL-P walks node_modules, computes a SHA-512 hash for every package directory, and stores the result in .scalp/lockfile.json. On subsequent scalp audit runs, it re-hashes and compares — any mismatch means tampering.

The wrapper pattern works like this:

# Instead of:
npm install express

# You run:
scalp install express

Under the hood, scalp install resolves the tree, evaluates policy, then delegates the actual download and unpack to npm install. If policy passes, it runs and hashes the result. If policy fails, you get a clear violation report and nothing is installed.

SCAL-P also ships a scalp ci command designed for CI pipelines that bundles all steps — resolve, evaluate, block, install, audit, report — into a single command with one exit code.

Why this exists

The npm ecosystem has over 2 million packages. That scale created a massive attack surface. Supply chain attacks via malicious packages became a critical vector — and they keep getting worse:

  • debug + chalk (Sep 2025)18+ packages compromised including debug, chalk, ansi-styles, supports-color, strip-ansi. Combined impact: over 2 billion weekly downloads. Phishing attack on the maintainer bypassed TOTP. Payload targeted cryptocurrency wallets and Web3 transaction interception. [Cycode]
  • Axios (Mar 2026)one of the worst attacks of 2026. Compromised maintainer account published versions 1.14.1 and 0.30.4 tagged as latest. Axios has 100M+ weekly downloads. Payload: a phantom dependency (plain-crypto-js) delivering a cross-platform RAT. Stayed live for ~3 hours. [Huntress] [Elastic]
  • node-ipc (May 2026)three malicious versions (9.1.6, 9.2.3, 12.0.1) published from a compromised maintainer account. 10M+ weekly downloads. 80KB obfuscated payload in the main bundle stealing cloud and CI/CD credentials via DNS exfiltration. [Snyk] [Hacker News]
  • Shai-Hulud (2025–2026)self-replicating worm that steals npm/GitHub tokens and automatically publishes malicious versions to every package the token can access. Multiple waves ("The Third Coming", "Mini Shai-Hulud"). Uses Sigstore, OIDC abuse, and CI/CD persistence. [Palo Alto Unit42]
  • Mini Shai-Hulud (May 2026)ongoing worm campaign by TeamPCP. Compromised accounts publish 300+ malicious versions in 22 minutes. Targets include @antv/*, TanStack, SAP ecosystem, Mistral. Obfuscated Bun script steals AWS, GitHub, Kubernetes, npm tokens, and SSH keys, exfiltrates via C2 and GitHub repos, injects malicious CI/CD workflows, and self-propagates. [StepSecurity]

Existing tools address parts of the problem but leave gaps:

ToolWhat it doesWhat it doesn't do
npm auditDetects known CVEsNo authorship verification, no post-install integrity
Snyk / DependabotAlerts on vulnerabilitiesCan't block unauthorized packages by policy
package-lock.jsonPins exact versionsDoesn't prevent tampering or typosquatting
npm provenanceLinks build to repoOptional adoption, no enforcement

How SCAL-P fixes it

SCAL-P reverses the default trust model. Modern package managers execute code before you can verify what you're getting. SCAL-P flips the order:

Policy before trust — evaluate allow/deny rules and trust scores against the resolved dependency tree before a single byte is installed.

Hash after install — once packages are installed, SHA-512 hash every package directory and store it in a separate lockfile (.scalp/lockfile.json).

Audit always — every operation is logged to an append-only NDJSON audit log. You can always see what happened and why.

CI enforcementscalp ci wraps everything into a single command: resolve, evaluate, block, install, audit, report. One exit code.

Threat coverage

ThreatHow SCAL-P detects it
Compromised maintainer accountHash mismatch against lockfile on audit
Protestware / sabotagePost-install hash audit catches modified files
Malicious new versionBlocked by policy if not in allowlist
Transitive supply chainRecursive tree evaluation with max_depth limits
Low-quality packagesTrust score < min_score triggers violation
Release artifact tamperingscalp verify checks binary SHA-512 against checksums
Staged package tamperingscalp stage verify computes tarball hash and extracts identity
Staged package identity bypassPackage name extracted from tarball contents — not from user input
Staged package denylist evasionDenylist checked against actual tarball contents

Design principles

  • Zero external dependencies — only the Go standard library. Easy to build, audit, and vendor.
  • Don't break the user — no policy file means allow + warn. SCAL-P shouldn't block your deploy because you forgot a config file.
  • Audit-first — every event is logged before any decision is made.
  • Passthrough by default, guarded by choicescalp install without flags is transparent. --guarded activates enforcement.
  • Offline-first — network is a cache amplifier, not a requirement. Trust scores degrade gracefully.
  • Separate lockfile — SCAL-P locks installed content, not tarballs. Different purpose from package-lock.json.

When to use SCAL-P

  • You maintain an open source project with many dependents — SCAL-P catches compromised maintainer accounts and protestware before they reach your users.
  • Your CI pipeline installs dependencies on every deployscalp ci prevents a malicious PR dependency from reaching production.
  • You ship a binary or CLI toolscalp verify lets you checksum your releases and lets consumers verify them.
  • You publish npm packages in a multi-team org — policy rules prevent any team from pulling in unapproved dependencies.
  • You operate in a regulated environment — the append-only audit log gives you a verifiable record of every install decision.

When NOT to use SCAL-P

  • You need zero overhead in local development — same as any security tool. Run scalp install without --guarded for transparent passthrough, or skip it entirely in dev.
  • Your project has no lockfile or policy — SCAL-P works fine (allow + warn by default), but you'll get the most value with a policy configured.
  • You already use a different lockfile format — SCAL-P's .scalp/lockfile.json is complementary to package-lock.json, not a replacement.

What's next?

On this page