safety

Scan dependencies for known vulnerabilities and licenses.

118 个版本 Python >=3.9
安装
pip install safety
poetry add safety
pipenv install safety
conda install safety
描述

safety

Downloads CI Status License PyPI Version Python Versions Coverage

[!NOTE] Come and join us at SafetyCLI. We are hiring for various roles.

Table of Contents

Introduction

Safety CLI is a Python dependency vulnerability scanner designed to enhance software supply chain security by detecting packages with known vulnerabilities and malicious packages in local development environments, CI/CD, and production systems. Safety CLI can be deployed in minutes and provides clear, actionable recommendations for remediation of detected vulnerabilities.

Leveraging the industry's most comprehensive database of vulnerabilities and malicious packages, Safety CLI Scanner allows teams to detect vulnerabilities at every stage of the software development lifecycle.

Key Features

  • Versatile, comprehensive dependency security scanning for Python packages.
  • Leverages Safety DB, the most comprehensive vulnerability data available for Python.
  • Clear output with detailed recommendations for vulnerability remediation.
  • Automatically updates requirements files to secure versions of dependencies where available, guided by your project's policy settings.
  • Scanning of individual requirements files and project directories or system-wide scans on developer machines, CI/CD pipelines, and Production systems to detect vulnerable or malicious dependencies.
  • JSON, SBOM, HTML and text output.
  • Easy integration with CI/CD pipelines, including GitHub Actions.
  • Enterprise Ready: Safety CLI can be deployed to large teams with complex project setups with ease, on-premise or as a SaaS product.

Getting Started

GitHub Action

Command Line Interface

1. Installation

  • Install Safety on your development machine.
  • Run pip install safety.

2. Log In or Register

  • Run your first scan using safety scan.
  • If not authenticated, Safety will prompt for account creation or login.
  • Use safety auth to check authentication status.

3. Running Your First Scan

  • Navigate to a project directory and run safety scan.
  • Safety will perform a scan and present results in the Terminal.

Basic Commands

  • safety --help: Access help and display all available commands.
  • safety auth: Start authentication flow or display status.
  • safety scan: Perform a vulnerability scan in the current directory.
  • safety system-scan: Discover supply-chain assets on your development machine — AI assistants (e.g. Claude Code, Claude Desktop), dependencies, runtimes, environments, and developer tools. Available as part of the Safety commercial product — see https://getsafety.com/.
  • safety scan --apply-fixes: Update vulnerable dependencies.

Service-Level Agreement (SLA)

We are committed to maintaining a high level of responsiveness and transparency in managing issues reported in our codebases. This SLA outlines our policies and procedures for handling issues to ensure timely resolutions and effective communication with our community.

Detailed Documentation

Full documentation is available at https://docs.safetycli.com.

Included in the documentation are the following key topics:

Safety CLI 3

Vulnerability Remediation

Integration

Administration

Output

Miscellaneous

System status is available at https://status.safetycli.com

Further support is available by emailing support@safetycli.com.

License

Safety is released under the MIT License.

Upon creating an account, a 7-day free trial of our Team plan is offered to new users, after which they will be downgraded to our Free plan. This plan is limited to a single user and is not recommended for commercial purposes.

Our paid plans for commercial use begin at just $25 per seat per month and allow scans to be performed using our full vulnerability database, complete with 3x more tracked vulnerabilities and malicious packages than our free plan and other providers. To learn more about our Team and Enterprise plans, please visit https://safetycli.com/resources/plans or email sales@safetycli.com.

Supported Python Versions

Safety CLI 3 supports Python versions >=3.9. Further details on supported versions, as well as options to run Safety CLI on versions <3.9 using a Docker image are available in our Documentation Hub.

We maintain a policy of supporting all maintained and secure versions of Python, plus one minor version below the oldest maintained and secure version. Details on Python versions that meet these criteria can be found here: https://endoflife.date/python.

Resources

版本列表
3.8.1 2026-05-29
3.8.0 2026-05-26
3.8.0b4 2026-05-26
3.8.0b3 2026-03-12
3.8.0b2 2026-03-10
3.8.0b1 2026-02-25
3.8.0b0 2025-12-02
3.7.0 2025-11-06
3.7.0b5 2025-11-04
3.7.0b4 2025-11-03
3.7.0b3 2025-11-03
3.7.0b0 2025-10-22
3.6.2 2025-09-24
3.6.1 2025-09-01
3.6.0 2025-07-09
3.6.2b0 2025-09-23
3.6.1b0 2025-08-25
3.6.0b0 2025-07-09
3.5.2 2025-06-04
3.5.1 2025-05-14
3.5.0 2025-05-07
3.5.2b1 2025-06-03
3.5.1b0 2025-05-13
3.5.0b2 2025-05-06
3.5.0b1 2025-05-06
3.5.0b0 2025-05-05
3.4.0 2025-04-23
3.4.1b0 2025-04-29
3.4.0b9 2025-04-23
3.4.0b8 2025-04-22
3.4.0b7 2025-04-11
3.4.0b6 2025-04-07
3.4.0b5 2025-04-07
3.4.0b4 2025-04-01
3.4.0b3 2025-04-01
3.4.0b2 2025-04-01
3.4.0b1 2025-04-01
3.4.0b0 2025-03-31
3.3.1 2025-02-24
3.3.0 2025-02-14
3.3.1b0 2025-02-21
3.3.0b0 2025-02-13
3.2.14 2024-12-20
3.2.13 2024-12-11
3.2.12 2024-12-10
3.2.11 2024-11-12
3.2.10 2024-10-25
3.2.9 2024-10-24
3.2.8 2024-09-27
3.2.7 2024-08-29
3.2.6 2024-08-21
3.2.5 2024-08-09
3.2.4 2024-07-04
3.2.3 2024-06-10
3.2.2 2024-06-07
3.2.1 2024-06-05
3.2.0 2024-05-01
3.1.0 2024-03-26
3.0.1 2024-01-20
3.0.0 2024-01-18
3.0.0a2 2024-01-14
3.0.0a1 2024-01-12
2.4.0b2 2023-11-15
2.4.0b1 2023-02-26
2.3.5 2022-12-08
2.3.4 2022-12-08
2.3.3 2022-11-28
2.3.2 2022-11-21
2.3.1 2022-10-05
2.3.0 2022-10-05
2.2.1 2022-10-04
2.2.0 2022-09-19
2.1.1 2022-07-18
2.1.0 2022-07-14
2.0.0 2022-06-28
2.0b5 2022-06-24
2.0b4 2022-06-16
2.0b3 2022-05-30
2.0b2 2022-05-27
2.0b1 2022-05-08
1.10.3 2021-01-15
1.10.2 2021-01-11
1.10.2.post1 2021-01-12
1.10.1 2021-01-03
1.10.0 2020-12-20
1.9.0 2020-04-26
1.8.7 2020-03-10
1.8.6 2020-03-10
1.8.5 2019-02-04
1.8.4 2018-08-03
1.8.3 2018-07-24
1.8.2 2018-07-11
1.8.1 2018-04-06
1.8.0 2018-04-05
1.8.3b0 2018-07-24
1.7.0 2018-02-03
1.6.1 2017-10-20
1.6.0 2017-10-20
1.5.1 2017-07-20
1.5.0 2017-07-19
1.4.1 2017-07-04
1.4.0 2017-04-21
1.3.0 2017-04-21
1.2.0 2017-04-20
1.1.1 2017-03-27
1.1.0 2017-03-23
1.0.2 2017-03-23
1.0.1 2017-03-23
1.0.0 2017-03-23
0.6.0 2017-03-10
0.5.1 2016-11-08
0.5.0 2016-11-08
0.4.0 2016-11-07
0.3.0 2016-10-28
0.2.2 2016-10-21
0.2.1 2016-10-21
0.2.0 2016-10-20
0.1.0 2016-10-19