Skip to main content

Package trust and provenance verification for PyPI consumers.

Project description

trustcheck Awesome

CI Source Build CodeQL pip-audit Bandit Semgrep Windows Defender ClamAV Ruff mypy Coverage PyPI Python 3.10 | 3.11 | 3.12 | 3.13 | 3.14 PyPI Downloads TrustCheck Package Scanner

trustcheck is a Python package and CLI for evaluating the trust posture of PyPI releases before they are installed, promoted, or approved.

It combines PyPI metadata, vulnerability records, provenance availability, cryptographic attestation verification, Trusted Publisher identity hints, and repository matching into a single operator-friendly report.

Packages that publish no provenance are treated as needing review rather than as automatic high-risk findings, while invalid provenance, partial coverage, repository mismatches, and known vulnerabilities remain stronger negative signals.

What it checks

For a selected package version, trustcheck can:

  • fetch project and release metadata from PyPI
  • verify published provenance against artifact digests
  • surface Trusted Publisher repository and workflow identity hints
  • compare expected repository input against declared and attested signals
  • flag publisher drift, missing verification, and known vulnerabilities
  • scan requirements files, project TOML, and uv.lock, poetry.lock, or pdm.lock
  • optionally inspect wheel and sdist contents without importing or executing package code
  • emit concise text output or structured JSON for automation

Every push also builds standalone Windows and Linux executables. The Windows artifact is scanned with Microsoft Defender's MpCmdRun.exe; the Linux artifact is scanned with ClamAV. Clean binaries, checksums, and scanner reports are retained as workflow artifacts by Binary Security.

Installation

Install from PyPI:

pip install trustcheck

Or install the Snap Store package:

sudo snap install trustcheck

The Snap command is trustcheck. If the shell reports command not found immediately after installation, start a new login session or add Snap's command directory to the current shell:

export PATH="/snap/bin:$PATH"
trustcheck --version

You can always bypass shell PATH lookup with:

snap run trustcheck inspect requests

PyPI installation requirements:

  • Python >=3.10
  • Network access to PyPI

Machine-readable reports currently use JSON schema 1.5.0. Package and report schema versions are independent so documentation-only package releases do not force contract churn.

TrustCheck Package Scanner

Use the TrustCheck Package Scanner action to scan a checked-in dependency file before merge:

steps:
  - uses: actions/checkout@v6
  - uses: Halfblood-Prince/trustcheck@v1
    with:
      target: requirements.txt
      policy: strict

The action installs and runs trustcheck, uploads trustcheck-report.json as a workflow artifact, and fails the job with the CLI's exit code when policy evaluation fails. target also accepts a PyPI package name, pyproject.toml, uv.lock, poetry.lock, or pdm.lock. Each stable release publishes an immutable full version tag and updates the compatible major action tag used above.

See the CI integration guide for custom policies, OSV, dependency traversal, outputs, and report naming.

Quick start

Inspect the latest release:

trustcheck inspect requests

Inspect a specific version:

trustcheck inspect sampleproject --version 4.0.0

Show only known vulnerabilities for a release:

trustcheck inspect sampleproject --version 4.0.0 --cve

Enrich vulnerability intelligence with OSV and GitHub Advisory Database data:

trustcheck inspect jinja2 --version 2.10.0 --with-osv --cve

Inspect a package and its direct dependencies:

trustcheck inspect sampleproject --version 4.0.0 --with-deps

Inspect the full transitive dependency tree:

trustcheck inspect sampleproject --version 4.0.0 --with-transitive-deps

Inspect every package listed in a requirements-style file:

trustcheck scan requirements.txt

Inspect dependencies declared in a TOML project file:

trustcheck scan pyproject.toml

Inspect exact direct and transitive versions from a supported lockfile:

trustcheck scan uv.lock --with-transitive-deps

Statically inspect wheel and sdist contents:

trustcheck inspect sampleproject --version 4.0.0 --inspect-artifacts --verbose

Artifact inspection validates wheel RECORD hashes, lists console scripts, detects native extensions and unusual files, and compares wheel and sdist metadata. It reads archive bytes only and never imports the inspected package.

Require a release to match an expected repository:

trustcheck inspect sampleproject \
  --version 4.0.0 \
  --expected-repo https://github.com/pypa/sampleproject

Emit JSON for another tool:

trustcheck inspect sampleproject --version 4.0.0 --format json

Emit combined JSON for a requirements-style, TOML, or lockfile scan:

trustcheck scan requirements.txt --format json

Emit only vulnerability records as JSON:

trustcheck inspect sampleproject --version 4.0.0 --cve --format json

Fail CI when full verification is missing:

trustcheck inspect sampleproject --version 4.0.0 --strict

Use it from Python:

from trustcheck import inspect_package

report = inspect_package("sampleproject", version="4.0.0", include_dependencies=True)
print(report.recommendation)

Documentation

Full documentation: https://halfblood-prince.github.io/trustcheck/

Project support:

License

Trustcheck Personal Use License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trustcheck-2.0.4.tar.gz (794.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trustcheck-2.0.4-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file trustcheck-2.0.4.tar.gz.

File metadata

  • Download URL: trustcheck-2.0.4.tar.gz
  • Upload date:
  • Size: 794.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trustcheck-2.0.4.tar.gz
Algorithm Hash digest
SHA256 4d3681afc7a20aa3f26086906c2473125b0b4cd2f1ca60de8d7ad239a6785d16
MD5 5f16d6bcd8ffd8131b42946efff6844b
BLAKE2b-256 2a0a998dac359a7e9ff709d5c48449a7046b5a09c5ab0c29a2ba5f9797815352

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustcheck-2.0.4.tar.gz:

Publisher: publish.yml on Halfblood-Prince/trustcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trustcheck-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: trustcheck-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trustcheck-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c9b94db0d015f818118c8795b9f75d13c5dc71b658a1e679b87bf2422fac802d
MD5 223e86c96dc820d7906f7769c430adb2
BLAKE2b-256 4b8eff0281b6e31749431c6343727923f1ed677ee1204e5e614585a8a65b9332

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustcheck-2.0.4-py3-none-any.whl:

Publisher: publish.yml on Halfblood-Prince/trustcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page