Repository navigation
Description
Current behaviour
When a registry does not publish signing keys, audit signatures skips the packages installed
from it. That part is intended — #5479 asked for E400 to be treated like E404 for exactly
this reason, and the summary counts only what was checked, through auditedWithKeysCount.
What the summary does not say is how much was skipped. In a tree where some dependencies resolve
from a registry with keys and some from a registry without, the output and the exit code are
indistinguishable from a tree that was fully verified.
Reproduced on npm 10.9.8 with a local registry that answers 404 on /-/npm/v1/keys:
$ cat package.json
{ "name":"mixed-test","version":"1.0.0",
"dependencies":{ "@nl/nokeys-dep":"1.0.0", "lodash":"4.17.21" } }
$ cat .npmrc
@nl:registry=http://127.0.0.1:8899
$ npm audit signatures
audited 1 package in 0s
1 package has a verified registry signature
$ echo $?
0
@nl/nokeys-dep is in the tree and carries no signature. It is not in the audited count, not
under missing, not under invalid. Nothing in the output indicates it exists.
When nothing can be audited the command already does the right thing:
$ npm audit signatures
npm error found no dependencies to audit that were installed from a supported registry
$ echo $?
1
Why it matters
A pipeline that runs npm audit signatures and branches on the exit code is asking "is this tree
verified". In the mixed case it is told yes, when the honest answer is "the part of it that could
be checked". The configuration where this arises — part of the tree resolving through an internal
mirror, a proxy or a third-party registry that does not publish keys — is a common one, and
arguably the one where the gate matters most.
The tree's total is not printed next to the audited count, so the two cannot be compared without
counting the lockfile separately.
Suggested change
Report the skipped count. Something like:
audited 1 package in 0s
1 package skipped: no signing keys published by http://127.0.0.1:8899
1 package has a verified registry signature
The information is already in hand at that point — the edges walked, the registries resolved and
auditedWithKeysCount — so this is a reporting change rather than a behavioural one. Whether a
skipped package should also affect the exit code is a separate decision, and a flag along the
lines of --require-signatures would leave the current default alone.
I am not suggesting the skip itself should change.
Activity
tools: the frame, the seed and the method for the fourth target, comm…
tools/molds: mold 3, three-valued, on npm audit signatures and nono —…
tools/molds: mold 10, asymmetric cost — both controls are escaped by …
tools/molds: mold 17, compared silence — the whole difference between…
tools: the inventory deduplicated by repository, and npm/cli#10018 filed
nortesoftware commentedon Sep 26, 2026
The issue says nothing in the output indicates the skipped package. That holds on 10.9.8, where it was reproduced, but not from 11.2.0 on: since #8080 there is a line for each registry outside the Sigstore trust root. The mixed tree from the issue, on 12.1.0:
The same line appears for a registry that serves keys and whose packages verify, so it names the registry without saying whether its packages were checked. The summary and the exit code are unchanged.
npm/rfcs#550 proposed a warning for a mirror or proxy that omits signatures.
nortesoftware commentedon Oct 8, 2026
Three corrections to the issue.
The skip needs more than a registry without keys: that registry's document for the package has to carry neither signatures nor attestations. npmmirror publishes no keys, and for some versions its documents carry npmjs's signatures.
audit signaturesthen stops instead of skipping. On 12.1.0, with@typessent to npmmirror and the default on npmjs:With
@types/[email protected], whose document there carries neither, the same configuration printsaudited 1 packageand exits 0, as in the issue. 10.9.8 gives both results. The registry that counts is the one the configuration names when the audit runs, not the one in the lockfile.The issue said the command already errors when nothing can be audited. That holds on 10.9.8. From 11.11.0 (#9026) a keyless attestation is verified without registry keys, and it can be enough to pass a tree from a registry without keys. A local registry that publishes no keys, serving semver 7.8.5 with no signatures and, as its only attestation, the SLSA provenance from npmjs's, and a package with neither signatures nor attestations, on 12.1.0:
The second package is counted nowhere. 10.9.8 stops with
EMISSINGSIGNATUREKEYon the same tree, and without the attestation both give "found no dependencies to audit". I have not measured other trees.The issue also called the configuration a common one, with an internal mirror or a proxy as the example. I have no figure for that. A mirror without keys as the only registry makes the audit fail, outside the attestation case. The silent case needs a scope sent to one kind of registry and the rest to the other, in either direction. With npmmirror as the default and a scope on npmjs, 12.1.0 refuses the install with its default settings (
EALLOWREMOTE), and passes the tree once it is installed with--replace-registry-host=neveror--allow-remote=all, or by 10.9.8.A count of skipped packages has to decide what to do with the packages 11.11.0 and later verify by keyless attestation without registry keys.
fix(run-claude-cli): verify the CLI's npm signatures and signed manif…