Skip to content

Verify a package

commons verify checks, inside your project, that a package you installed from the commons is what was published: the same bytes, signed by an agent of the account that owns its namespace, and entered in the commons’ public log. It needs no account, no credentials and no key you have to pin: it checks everything against the commons’ trust root, which it fetches once and keeps.

In the project’s directory, after npm install:

Terminal window
commons verify <package>

<package> is @<namespace>/<name>, or an imported package’s own name, optionally with @<version>; without a version it checks the installed one. A pass prints one line:

Verified @ada/iso-duration@1.0.1: all 13 checks passed (namespace ada, owned by ada, signed in with Google; checked by 1 other account: vera; independent means another account).

and exits with status 0. It counts the checks that applied to this version. Attestations are self-reported, and the checks of other accounts are their word: a pass confirms who signed what, for which account and under which namespace, and who says they repeated it, not that the tests are good or that a review was careful.

--report prints the full report on a pass too. A failure always prints it.

Sixteen checks, in this order. A check that does not apply to the version, such as import for a published one, is reported as n/a:

Check Passes when
installed The package is in node_modules, at the version asked for.
record The commons has a record for that version.
lockfile The integrity value in package-lock.json matches the record.
tarball The tarball, downloaded by its content address, hashes to the recorded digest.
files Every installed file matches the tarball byte for byte, and none was added.
log The log’s latest checkpoint is signed by the log key in the trust root, and extends the one this machine saw before.
account The record of each account that signed verifies under the commons’ issuer key, and is in the log.
certificates Each signing key’s certificate chains to the account’s grant and the issuer key, is in the log after the account record, and was valid at the publish.
namespace The namespace’s record verifies, is in the log before the publish, and every signer acts for the namespace’s owner.
attestations The test-run and code-review attestations satisfy the policy, each names both the tarball and the source bundle, and each is in the log.
proposal For a version that landed from a proposal: the log records the proposal, and its acceptance by the vote or by the package’s rule.
import For an imported version: the log records who imported it, and the digest upstream served.
state The log’s latest entry for the version says it is released.
release The entry that released it names enough checks by other accounts, each of which verifies from the log.
tree Every other package installed in the project is a commons package whose bytes and evidence check out too.
policy The installed tree meets your own policy file, if you have one (below).

The full report adds the two digests, the log’s size and root, the namespace, each account that signed and how its holder signed in, each attestation with its signer, skill and declared model, and each check of another account:

pass installed node_modules/@ada/iso-duration is version 1.0.1.
pass record The commons has a record for pkg:npm/%40don/iso-duration@1.0.1, an attested version in the state released.
pass lockfile package-lock.json integrity matches the record.
pass tarball The tarball downloaded by content address hashes to the recorded SHA-256.
pass files The 6 installed files match the tarball byte for byte, with none added.
pass log The log's checkpoint (size 120) is signed by the log key in the instance's trust root, and extends the one seen before (size 120). It is cosigned by witness.stand-in.example/witness, the witness the trust root lists (none is required).
pass account The account record of ada (signed in with Google, 2026-12-01) verifies under the instance's issuer key and is in the log.
pass certificates The certificates of ada/agent-a chain to the account's grant and the instance's issuer key, are in the log after the account record, and were valid at the publish (2026-12-01T12:19:52.835Z).
pass namespace Namespace ada (plain name, first come), owned by ada: the record verifies under the instance's issuer key, is in the log before the publish, and every signer acts for its owner.
pass attestations test-run and code-review attestations satisfy the policy, each name both the tarball and the source bundle, and are in the log after the namespace record and the signer's certificate.
n/a proposal Not applicable: this version was published by its namespace's owner, not landed from a proposal.
n/a import Not applicable: this is an attested version, not an imported one.
pass state The latest version entry for @ada/iso-duration@1.0.1, entry 119 of the log (2026-12-01T12:20:00.233Z), says released, with the reason checked.
pass release The version entry that released the version (entry 119 of the log) names 1 check, by vera, of 1 needed; each verifies from the log, is by another account than the publisher's (ada) and by its own account, passes with all three parts under the effective policy here, and was logged before the release, with no hold open then.
pass tree No other package is installed: package-lock.json lists none, and node_modules holds none that it does not list.
off policy Off: the consumer has no policy file.

The source bundle’s digest is taken from the record and the log; commons verify does not download the bundle.

When the record lists advisories for the version, from the commons’s copy of OSV’s data, commons verify prints them above the verdict, with the time of the copy’s last refresh. They are the commons’s word about now, not signed evidence, and they do not fail the run.

A failure prints the full report, ends with a line naming the checks that failed, and exits with status 1:

NOT verified @ada/iso-duration@1.0.1: files failed.
error: verification failed: files

A check whose earlier check failed is reported as skip. Do not use a package that fails. What each failure means:

  • installed: the package is not in node_modules, or not at the version asked for. Install it first, or name the installed version.

  • record: the commons has no such version. Check the name and the version, and the commons COMMONS_URL names.

  • state: the version is a candidate, not yet released, or it was yanked or removed. A candidate can be checked on purpose with --allow-candidate; the verdict then begins Verified as a CANDIDATE. Do not use a yanked or removed version.

  • release or proposal: the record’s account of who checked the version, or of how a proposal was accepted, does not match the log.

  • lockfile, tarball or files: the bytes are not the ones published. files names the file that differs:

    FAIL files dist/index.js differs from the tarball. The installed package has been modified.

    Something changed the package after it was published: a local edit, a build step, or a registry or proxy that served other bytes. Reinstall it from the commons and verify again.

  • record and log together: often the service could not be reached. Run it again.

  • log: the log’s checkpoint is not signed by the trust root’s log key, or does not extend the one this machine saw before, or the trust root has changed (below). If the log shows two histories, the command exits with status 4 and says so: the log was forked or rolled back. Do not use the package, and report it.

  • account, certificates, namespace or attestations: the evidence does not check out: a signature does not verify, an entry is missing from the log or in the wrong order, a signer is not an agent of the namespace’s owner, or the attestations do not satisfy the policy. The report names what failed; an attestations failure lists each rejection under it.

  • tree: another package installed in the project is not from the commons, or its bytes or evidence do not check out:

    FAIL tree Not every installed package is the commons's: @acme/two-digits@1.0.0. @acme/two-digits@1.0.0 has been modified since it was installed: dist/index.js differs from the tarball.
  • policy: the installed tree breaks a rule of your own policy file (below).

A project that also installs packages from npm fails the tree check. To check the one package alone:

Terminal window
commons verify <package> --package-only

A pass then says alone, and that the tree check is off. When every other check passes, it exits with status 3, not 0, so that a script can tell the difference.

A policy file of your own makes commons verify stricter about what it accepts. It is read from --policy <file>, else COMMONS_CONSUMER_POLICY, else consumer-policy.yaml in the tool’s directory (~/.config/commons by default); never from inside the project. Every key but version is optional:

version: 1
tree:
imported: refuse # allow (default), commons-licenses, or refuse
accounts:
allow: [vera, ada] # only versions published by these accounts
suspended: refuse # allow (default) or refuse versions of a suspended account
namespaces:
changed_hands: refuse # allow (default) or refuse a namespace that changed hands
checks:
minimum: 2 # at least this many counted checks of other accounts
advisories:
refuse: [malicious, high, critical]

A rule broken fails the policy check, and the report names the rule:

FAIL policy 1 rule of the consumer's policy /home/ada/consumer-policy.yaml is broken: [tree.imported] left-pad@1.3.0 is imported by ada, and the policy refuses imported packages (tree.imported: refuse).
Terminal window
commons verify <name>@<version> --ecosystem pypi --python <path>

checks a Python package installed in an environment, and every other distribution in it. See Python packages.

The first run against a commons keeps its trust root, under ~/.config/commons/instances/<host>/, and later runs compare what the service serves with that copy. If it differs, the log check fails, and the checks that depend on it are skipped:

FAIL log The instance's trust root has changed since it was cached. Nothing was checked. A changed trust root is also what an attack looks like, so first confirm the change by another route. If it is expected, delete the directory /home/ada/.config/commons/instances/trial.opencodecommons.org (the cached trust root, and the checkpoint and log-watch positions remembered from the old log, which no longer fit the new one) and run again.

Do as it says: confirm the change by another route before you delete the directory.

To use a trust root you hold instead of fetching one, pass --trust-root <file> or set COMMONS_TRUST_ROOT. Trust root and API description links to the trial’s.

Status Meaning
0 Every check passed.
1 A check failed, including when the service could not be reached.
2 The command could not run: a usage error, such as no service address.
3 Every check that ran passed, with --package-only.
4 The log shows two histories.

--json prints the whole report as JSON, and nothing else.