Don't ship insecure code.
Safety command-line tool scans your dependencies for known security vulnerabilities.
Try it out
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.
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.
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
The Safety family is a set of tools that help you to keep your dependencies secure.