Package Registry · PEP 740 + OIDC

PyPI Trusted Publishing (OIDC) & PEP 740 Digital Attestations

Eliminate long-lived PYPI_API_TOKEN secrets with GitHub/GitLab OIDC Trusted Publishers, emit PEP 740 Sigstore attestations, and inspect wheel provenance offline.

100% Browser-Side · Zero Telemetry (connect-src 'none')

1. Paste SBOM or Sigstore / Rekor JSON

CycloneDX · SPDX · Sigstore
SPDX-2.3 JSON
70 / 100
WARN

Pass: 4 · Warnings: 3 · Errors: 0

Detected Format
SPDX-2.3
CC0-1.0 dataLicense
Packages
4
3 relationships
Missing PURL / SHA256
1 / 1
Out of 4 packages
NOASSERTION Licenses
1 / 4
Needs license audit
SBOM-SPDX-SPEC: SPDX-2.3 document detected PASS
Document: acme-inference-gateway-2.1.0
SBOM-SPDX-META: SPDX dataLicense (CC0-1.0), creators & namespace valid PASS
Creators: Tool: syft-1.18.1, Organization: Acme Cloud Security
SBOM-SPDX-PKGS: 4 SPDX packages inventoried PASS
Packages array parsed cleanly.
SBOM-SPDX-PURL: 1/4 package(s) missing externalRefs purl WARN
SBOM-SPDX-HASH: 1/4 package(s) missing SHA256/SHA512 checksum WARN
SBOM-SPDX-LIC: 1/4 package(s) have NOASSERTION/missing license WARN
SBOM-SPDX-REL: 3 SPDX relationships declared PASS
Document DESCRIBES root and DEPENDS_ON edges present.
Actionable CLI, CI & RapidAPI Fix Commands
# Generate SPDX 2.3 JSON with Syft or Trivy:
syft dir:. -o spdx-json=sbom.spdx.json
trivy fs --format spdx-json -o sbom.spdx.json .

# Attach SPDX predicate to container image with Cosign:
cosign attest --yes --predicate sbom.spdx.json --type spdxjson ghcr.io/org/app:v1.0.0

# Audit repository supply-chain & SBOM posture via RungLab RapidAPI v1.3.0:
curl -X POST 'https://runglab-developer-intelligence-api1.p.rapidapi.com/v1/supply-chain/audit' \
  -H 'Content-Type: application/json' -H 'x-rapidapi-key: <YOUR_KEY>' \
  -d '{"ecosystem":"pypi","packages":[{"name":"fastapi","version":"0.115.6"}]}'
VendorReady SBOM · Zero Upload $39 SOC 2 Procurement Dossier

Turn SBOMs & lockfiles into a 100-pt SOC 2 Procurement Dossier

Need CVE/CISA KEV risk scoring, directional SPDX copyleft checks, and buyer-ready SOC 2 security questionnaire evidence? Scan package-lock.json, requirements.txt, go.mod, CycloneDX or SPDX locally on VendorReady SBOM, export the $39 6-file SOC 2 Procurement Dossier, or call RungLab RapidAPI v1.3.0 (/v1/rekor/entry/{uuidOrIndex}, /v1/rekor/lookup, /v1/supply-chain/audit), Apify actors & MCP.

Specification & CI Field Reference

Field / Flag Expected Value Verification Purpose
Publishing Protocol OIDC Trusted Publisher (pypa/gh-action-pypi-publish) Zero stored API tokens; short-lived audience-scoped JWT
Attestation Standard PEP 740 (application/vnd.pypi.integrity.v1+json) Wraps Sigstore bundle + SLSA/PyPI publish predicate
SBOM Standard SPDX 2.3 / CycloneDX 1.6 (pkg:pypi/...) Pair with syft/pip-audit for dependency checksums
Verification CLI pypi-attestations verify pypi --repository ... <wheel> Verifies PEP 740 provenance & Fulcio OIDC claims

GitHub Actions — Zero-Secret PyPI Trusted Publishing + PEP 740

pypi-publish.yml
name: Publish Python Wheel (Trusted Publisher)
on:
  push:
    tags: ["v*"]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install build && python -m build
      - uses: actions/upload-artifact@v4
        with:
          name: dist-packages
          path: dist/

  publish:
    needs: build
    runs-on: ubuntu-latest
    environment: pypi
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: dist-packages
          path: dist/
      - uses: pypa/gh-action-pypi-publish@release/v1

Generate SPDX 2.3 SBOM & Verify PEP 740 Provenance

verify-pypi.sh
# Verify PEP 740 Sigstore attestation for a downloaded wheel
pip install pypi-attestations
pypi-attestations verify pypi \
  --repository https://github.com/org/repo \
  dist/my_package-1.0.0-py3-none-any.whl

# Generate SPDX 2.3 SBOM for Python environment
syft dir:. -o spdx-json=sbom.spdx.json

Key Security & Architecture Takeaways

  • PyPI Trusted Publishing removes static API tokens completely by exchanging a GitHub Actions OIDC JWT (scoped to repository + environment) for a 15-minute PyPI upload token.
  • Since late 2024, pypa/gh-action-pypi-publish automatically attaches PEP 740 Sigstore provenance attestations alongside every wheel and sdist.
  • Separating the build job (no id-token) from the isolated publish job (environment: pypi + id-token: write) stops compromised test runners from minting publish tokens.

Common Production Pitfalls to Avoid

  • Granting id-token: write at the workflow root instead of only on the final publish job allows PR/test steps to access OIDC tokens.
  • Mismatched environment name (e.g. PyPI configured for environment pypi while workflow uses release) triggers Trusted Publisher exchange 400 errors.
  • Generating Python SBOMs without lockfiles (requirements.txt hashes or uv.lock) leaves checksums[] empty in SPDX/CycloneDX output.

More Supply-Chain Attestation & SBOM Guides

← Back to SBOM & Sigstore Validator Hub · VendorReady SBOM ($39 SOC 2 Dossier) → · CORS & Webhook HMAC Debugger → · 14×14 License Matrix →

Frequently Asked Questions

What is the difference between PyPI Trusted Publishing and PEP 740 attestations?

Trusted Publishing authenticates the upload via OIDC without long-lived API tokens, whereas PEP 740 publishes a verifiable Sigstore provenance bundle alongside the wheel so downstream consumers can verify the build identity.

Does PyPI support both SPDX 2.3 and CycloneDX 1.6 SBOMs?

Yes — tools like syft and cyclonedx-py emit pkg:pypi/<name>@<version> PURLs and SHA256 digests in both formats. Paste yours into the validator above to check completeness.

How can I check Python package licenses against my project license?

Inspect SPDX licenseConcluded fields above, use our 14x14 License Compatibility Matrix (/licenses/), or automate batch audits via Apify ClearlyDefined License Auditor.