Trusted Publishing
termKept in this browser · My desk
PyPI's way of uploading releases from CI without a stored API token: the CI job proves its identity with an OpenID Connect token, and PyPI issues a short-lived upload token to the project that trusts that identity.
The token PyPI mints is valid for 15 minutes. PyPI documents four providers: GitHub Actions, Google Cloud, ActiveState and GitLab CI/CD (continuous integration and continuous delivery). Its security model says to treat a trusted publisher as if it were an API token: protect the workflow, avoid pull_request_target triggers, use a dedicated environment with reviewers. Files published this way can carry PEP 740 attestations naming the repository and workflow; pip itself has been released like this since pip 25.0.
Also known as: trusted publisher, PyPI trusted publishing, OIDC publishing
Sources
- PyPI documentation, Publishing to PyPI with a Trusted Publisher: OpenID Connect, tokens valid for 15 minutes (read 2026-10-27)
- PyPI documentation, Trusted Publishing security model and considerations (read 2026-10-27)
- pip changelog, 25.0: released with trusted publishing and PEP 740 attestations (read 2026-10-27)