PyPI Mandates 2FA for Critical Projects
PyPI mandated 2FA for critical project maintainers in 2023. Supply chain security for Python packages improved with authentication requirements. If you maintain popular PyPI packages, 2FA is mandatory.
Accuracy-reviewed by the editorial team
On , the Python Package Index (PyPI) mandated two-factor authentication (2FA) for maintainers of critical projects. The policy expands PyPI’s 2022 security initiative and leverages funding from the Open Source Security Foundation (OpenSSF) to distribute hardware security keys and improve trusted publishing workflows. Maintainers of packages classified as critical—based on download volume and dependency centrality—must enable 2FA using authenticator apps or hardware keys to continue publishing. Teams that depend on the Python ecosystem should accelerate supply-chain security programs to stay compliant, reduce credential compromise, and align with emerging regulatory expectations.
Risk context and threat environment
Open-source software supply chains have faced credential theft, typosquatting, and dependency confusion attacks. High-profile incidents, including the ctx and phishing package hijackings, showed how compromised maintainer accounts can distribute malware to downstream users. Federal directives—such as the U.S. Executive Order 14028, CISA’s Open Source Software Security Roadmap, and OMB Memorandum M-22-18—emphasize multi-factor authentication as a foundational control. PyPI’s mandate aligns the Python ecosystem with broader efforts by npm, RubyGems, and GitHub to require MFA for high-impact publishers.
Scope and enforcement timelines
PyPI classifies a project as critical when it meets thresholds for download counts or transitive dependency reach, using statistics similar to those used for prior security-key distributions. Once designated, maintainers receive notifications and must enable 2FA before the enforcement date. Accounts without 2FA lose the ability to publish new releases or updates. PyPI provides dashboards for maintainers to confirm status and configure authentication factors. The Python Software Foundation (PSF) continues to refine criteria, with plans to expand the critical project list as monitoring improves.
Implementation guidance for maintainers
- Enroll in 2FA: Configure authenticator apps (TOTP) or hardware security keys (FIDO2/WebAuthn). Maintain backup codes stored in password managers or secure vaults. For organizational accounts, distribute at least two keys per maintainer to avoid lockouts.
- Adopt hardware tokens: PyPI offers YubiKey and other hardware key vouchers through its partnership with OpenSSF and the Alpha-Omega project, ensuring phishing-resistant authentication. Teams should document issuance, custody, and replacement procedures.
- Enable trusted publishing: Use automation workflows (for example, GitHub Actions, GitLab CI/CD) that authenticate via OpenID Connect to PyPI, producing signed artifacts without human-held credentials. This reduces risk when maintainers rotate devices or leave the organization.
- Audit automation tokens: Review existing API tokens, rotate secrets, and limit scopes. Replace legacy passwords with project-scoped tokens to eliminate shared credentials.
Enterprise supply-chain response
Security leaders should treat PyPI’s policy as a catalyst for broader open-source governance. Conduct software bill of materials (SBOM) reviews to identify critical PyPI dependencies. Engage with maintainers—either internal teams or external community projects—to verify MFA adoption and continuity plans. Update vendor and third-party risk assessments to include MFA requirements for open-source contributions. For regulated industries (finance, healthcare, energy), map PyPI controls to frameworks such as NIST SSDF, ISO/IEC 27034, and the EU NIS2 Directive, which reference secure development and strong authentication.
Policy and compliance considerations
PyPI’s enforcement supports compliance with government procurement rules that demand secure software attestations. OMB’s M-22-18 memo requires vendors to attest to MFA, code integrity, and provenance; PyPI’s trusted publishing and 2FA features provide evidence for such attestations. Teams preparing for U.S. Secure Software Development attestation forms should document PyPI MFA status, artifact signing practices, and release approvals. European and Asia-Pacific regulators now scrutinise software supply chains, making PyPI compliance a practical baseline for demonstrating due diligence.
Operational good practices
Account hygiene: Enforce unique email addresses for PyPI accounts, integrate with password managers, and monitor for credential reuse. Require maintainers to complete security awareness training covering phishing, social engineering, and package signing.
Release automation: standardize CI/CD pipelines that trigger releases from protected branches with mandatory code review. Combine PyPI trusted publishing with reproducible builds and digital signatures (PEP 458/TUF) to improve provenance.
Monitoring and alerting: Subscribe to PyPI RSS feeds or API notifications for package updates. Implement anomaly detection on dependency updates, verifying maintainers and release metadata before deployment.
Incident response: Develop playbooks for compromised packages, including revocation procedures, dependency lockdown, and communication to downstream customers.
Measurement and assurance
Track metrics such as percentage of critical package maintainers with 2FA enabled, number of hardware keys distributed, trusted publishing adoption rate, and mean time to rotate credentials after personnel changes. Monitor download anomalies, malware detections, and vulnerability disclosures (CVEs) tied to critical packages. Incorporate results into board and audit reports alongside other software supply-chain indicators like SBOM coverage and dependency update cadence.
Developer enablement and change management
Maintainers often span volunteer contributors and enterprise teams. Provide step-by-step onboarding guides, recorded walkthroughs, and office hours to reduce friction adopting MFA and trusted publishing. Establish escalation contacts to help community maintainers recover access or obtain replacement hardware keys quickly. Integrate MFA status checks into internal developer portals so engineering leaders can monitor compliance across distributed teams. Encourage the use of dependency management tools (Renovate, Dependabot) to automate update testing once maintainers release secured packages.
Regulatory and customer communications
Document PyPI compliance for customers seeking assurance under SOC 2, ISO 27001, or vendor questionnaires. Include the mandate in software supply-chain transparency reports, highlighting MFA coverage, signed artifacts, and response plans. For government contracts, reference PyPI’s controls in Plan of Action and Milestones (POA&M) submissions and continuous monitoring updates.
Community engagement and support
Teams reliant on open source should contribute resources—funding, developer time, or security expertise—to maintainers adapting to the mandate. Participate in OpenSSF working groups, sponsor PyPI critical projects, and support initiatives like Python’s `pip-audit` and `bandit` to bolster ecosystem resilience. Encourage developers to file feedback through PyPI’s issue trackers to improve usability, documentation, and support for diverse authentication methods.
Future roadmap
PyPI plans further improvements: expanded trusted publishing providers, mandatory project-scoped API tokens, and integration with The Update Framework (TUF) for end-to-end signing. Watch for additional funding announcements under the U.S. CHIPS and Science Act and EU Cyber Resilience Act that may impose stricter supply-chain obligations. Anticipate harmonization across ecosystems as npm, RubyGems, and Cargo adopt similar MFA and provenance requirements.
Further reading
- PyPI Blog — Two-factor authentication required for critical projects
- Python Software Foundation — PyPI security improvements
- CISA Open Source Software Security Roadmap
- GitHub Actions — Trusted publishing for PyPI announcement
Partnering with engineering and security teams to implement PyPI MFA, trusted publishing, and supply-chain governance controls aligned with regulatory expectations.
Continue in the Cybersecurity pillar
Return to the hub for curated research and deep-dive guides.
Latest guides
-
Network Security Fundamentals Explained Practically
A practitioner-focused guide to network security fundamentals covering firewalls, segmentation, IDS/IPS, DNS security, VPNs, wireless security, zero trust architecture, and traffic…
-
Complete Beginner Cybersecurity Guide for Home Users
A practical cybersecurity guide designed for non-technical home users. Covers threat awareness, home network security, password management, multi-factor authentication, device…
-
Cybersecurity Operations Playbook
Use our research to align NIST CSF 2.0, CISA KEV deadlines, and sector mandates across threat intelligence, exposure management, and incident response teams.
Further reading
- PyPI Blog — Two-factor authentication required for critical projects — PyPI
- Python Software Foundation — PyPI security improvements — Python Software Foundation
- CISA Open Source Software Security Roadmap — Cybersecurity and Infrastructure Security Agency
- GitHub Actions — Trusted publishing for PyPI — GitHub
Comments
Community
We publish only high-quality, respectful contributions. Every submission is reviewed for clarity, sourcing, and safety before it appears here.
No approved comments yet. Add the first perspective.