Safety CLI

Don't ship insecure code.

Safety command-line tool scans your dependencies for known security vulnerabilities.

Try it out

Safety CLI - The swiss-army knife of security scanning

Our popular open-source command-line tool for scanning Python environments for dependency security and compliance risks.

Safety CLI can be used in a variety of ways and situations, from securing developer machines to build pipelines and production systems.

If you are using something insecure, you'll get a report on what exactly is affected.

Inbox user interface

Test out our free non-commercial database

Testing out Safety CLI is as simple as running two commands.

To get started, install the command line client:

pip install safety

Once installed, run the safety check command:

safety check

This will check your current virtual environment, scanning all your installed dependencies.

To check a requirements file, run:

safety check -r requirements.txt

Note that this scan and data is for testing purposes only. The data is not up-to-date, and is not licensed for commercial use.
To start securing your Python dependencies using Safety CLI, start your free trial and get your API key.

Start securing your Python environments with our industry-leading vulnerability database

An API Key gives you access to our real-time commercial vulnerability database. Create an account to get one.

To use your API Key, append it with the --key parameter:

safety check --key={API_KEY}
safety check -r req.txt --key={API_KEY} Read the Safety CLI docs for more information and examples

Meet the Safety family

The Safety family is a set of tools that help you to keep your dependencies secure.

Safety CLI

Command line interface

Safety CLI is a command line tool that checks local dependencies for known security vulnerabilities.

Learn More

Safety CI

Customer profile user interface

Safety CI is integrated into and checks commits and Pull Requests on your GitHub repositories for insecure and outdated dependencies.

Learn More