Safety 2 (formerly PyUp)
  • Welcome to Safety 2
  • 2023 Rebrand from PyUp to Safety Cybersecurity
  • Safety 2.x Basics
    • Getting started with Safety 2.x
    • Running a Safety Scan
    • License Scanning
  • Safety CLI 2 Scanner
    • Installation & Quick Start - Safety 2
    • Docker Containers
    • Inputs
    • Output Formats
    • Policy File
    • Applying Security Updates to Requirements Files
    • Exit Codes
    • Help and Support
    • Safety v1 to v2 Breaking Changes
  • Securing Git SCM Pipelines
    • Securing Git Repositories
    • GitHub Actions
      • Advanced Options: GitHub Actions
    • BitBucket Pipelines
    • Gitlab Pipelines
    • GitHub Integration
    • Scanning Development Environments with Git Post-Commit Hook
  • Troubleshooting
    • Invalid API Key Error
Powered by GitBook
On this page
  • Installation
  • Getting started
  1. Safety CLI 2 Scanner

Installation & Quick Start - Safety 2

PreviousLicense ScanningNextDocker Containers

Last updated 8 months ago

Existing Customers: Upgrade to Safety 3.0

Safety 3.0 is now available, providing system-wide scanning, unpinned package support, new SBOM and JSON output formats, and more.

Safety 2 is the previous iteration of our industry-leading Python dependency scanner. Safety is the best way to check your Python dependencies for security vulnerabilities and other compliance risks. It's our swiss-army knife tool that can be used in a variety of ways and situations, from securing developer machines, to build pipelines and production systems.

Installation

Safety is available for . You can install Safety CLI directly from PyPi using the following pip command:

pip install safety

Getting started

Once install, you can run a vulnerability scan on your Python dependencies in your current environment.

safety check --key <YOUR-API-KEY>

Or scan the dependencies in a particular requirements file:

safety check -r requirements.txt --key <YOUR-API-KEY>

download from PyPi