Safeguard
Supply Chain•

npm, pnpm and Yarn supply chain settings: which one controls what?

A table of the documented package manager settings for release age, git dependencies, lockfile checks and install scripts in npm, pnpm and Yarn.

Safeguard Security Team
4 min read

npm, pnpm and Yarn each document settings for a release age delay, git dependency control and lockfile checks, but the names, units and defaults differ. This table lists what each project's own docs say, so you can write a team standard without guessing. Verify against your installed version.

The comparison

ControlnpmpnpmYarn
Delay new versionsmin-release-age in days, or before with a dateminimumReleaseAge in minutes, default 1440 since v11npmMinimalAgeGate, example value 1w
Exempt packages from the delaymin-release-age-excludeminimumReleaseAgeExcludenpmPreapprovedPackages, which exempts from all gates
Control git dependenciesallow-git with all, none or rootblockExoticSubdeps, default true, allows only direct exotic sourcesapprovedGitRepositories allowlist
Frozen installsnpm ci fails on mismatch and never writesfrozen lockfile settingsenableImmutableInstalls, default on CI
Verify lockfile contentintegrity hashes in the lockfilere-applies age and trust policy to lockfile entries unless trustLockfile is trueenableHardenedMode checks lockfile against the registry
Trust evidenceaudit signatures commandtrustPolicy no-downgradenot covered here
Third party install scriptsignore-scripts, default falsesee our separate postenableScripts, default false

Sources for each cell are the docs listed below. Where a cell says not covered here, I did not verify it, so do not read it as absent.

Reading the table

Units differ. npm uses days, pnpm uses minutes, Yarn takes a duration string. A copy and paste of "1" across tools means very different delays.

Defaults differ. pnpm turned on a one day age by default in v11, but in non-strict mode unless you set the value yourself. Yarn runs third party postinstall scripts off by default. npm's script default is to run them.

Exemptions differ in scope. Yarn's preapproved list exempts from every package gate, not just the age gate. A pnpm exclude applies by name to all versions unless you name a version.

Writing a team standard

  1. Choose one package manager per repository, and pin it. See Corepack and the packageManager field.
  2. Set a release age delay in the project config, with an explicit value.
  3. Block or allowlist git dependencies.
  4. Use the frozen install command in CI. See frozen lockfile flags compared.
  5. Decide the script policy and write it down. See how to disable install scripts.
  6. Put exceptions in version control with a reason, and review them on a schedule.

What settings cannot do

Settings reduce the odds of installing something bad. They do not tell you what is inside your tree today, whether a vulnerable function is reachable, or when a new advisory lands on something you already installed. That needs inventory and monitoring.

Where Safeguard fits

Safeguard's dependency scanning and SBOM generation work across these lockfile formats, with reachability analysis to prioritize findings and policies and gates to enforce your rules on pull requests. A free scan is at https://gold.safeguard.sh/scan.

Quick check

Is a one day delay the same in npm, pnpm and Yarn?

No. npm counts days, pnpm counts minutes, and Yarn takes a duration string. Check the unit before copying a value.

Do these settings replace vulnerability scanning?

No. They limit what installs. You still need an inventory and monitoring for advisories on components already in your tree.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.