safety
Scan dependencies for known vulnerabilities and licenses.
What it is and what it does
Safety CLI is a command-line tool that scans Python project dependencies against a vulnerability database to identify packages with known security issues and detect malicious packages. It integrates into development workflows, CI/CD pipelines, and production systems to catch supply chain risks early. The tool can output findings in multiple formats (JSON, SBOM, HTML, text) and optionally apply automated fixes to update vulnerable dependencies to secure versions.
The package depends on a suite of common Python libraries—httpx for HTTP requests, pydantic for data validation, typer for CLI structure, and others—to deliver scanning, authentication, and reporting. It requires Python >=3.9 and is actively maintained with recent releases. A free tier is available after an initial trial period, though access to the full vulnerability database requires a paid subscription.
Use it for:
- Scan a local project directory before committing code to detect vulnerable dependencies early in development
- Integrate into GitHub Actions or other CI/CD pipelines to block builds when high-severity vulnerabilities are found
- Automatically remediate vulnerable dependencies by running `safety scan --apply-fixes` to update requirements files
- Generate SBOM or JSON reports for compliance audits and supply chain transparency documentation
- Monitor system-wide dependencies on developer machines to detect risks in installed tools and runtimes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Safety CLI scans Python project dependencies for known vulnerabilities and malicious packages, then reports findings and can automatically update vulnerable dependencies to secure versions.
Yes, if you need Python dependency vulnerability scanning. Safety CLI is actively maintained, has low install friction, and integrates well into CI/CD workflows. The free tier is limited but available; commercial use and comprehensive coverage require a paid plan. No known vulnerabilities in the package itself as of the fact sheet date.
Install
safety on PyPI
pip
pip install safetyuv
uv add safetypoetry
poetry add safetyInstalling safety
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with recent releases and carries 19 runtime dependencies including httpx, pydantic, and click—a moderate but manageable dependency footprint for a security scanning tool.
License in practice
Released under the MIT License (permissive), so you can use it freely in commercial and private projects. A free tier is available after a 7-day trial, though the full vulnerability database requires a paid plan.
Quickstart
pip install safety
safety auth
safety scan
Requires Python >=3.9. Authentication is required to run scans; the tool will prompt for account creation or login on first use.
Verify before relying
- Whether the free plan's vulnerability database coverage is sufficient for your project's security requirements
- How the tool's remediation suggestions align with your dependency management workflow
- Performance characteristics when scanning large monorepos or projects with many dependencies
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 19 — authlib, certifi, click, dparse, filelock, httpx, jinja2, marshmallow, nltk, packaging, pydantic, ruamel-yaml, safety-schemas, tenacity, tomli, tomlkit, truststore, typer, typing-extensions |
| Maintenance | actively maintained — 77 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,775,644/month — #2,040 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: safety-3.8.1-py3-none-any.whl
Keywords: dependencies, licenses, safety, scan, vulnerabilities
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
guarddogGuardDog is a CLI tool that scans PyPI, npm,…
permissive · top 15,000 on PyPI
pysentry-rsPySentry scans Python projects for known…
permissive · top 15,000 on PyPI
sealights-python-agentIntegrates Python applications with Tricentis…
unclear · top 15,000 on PyPI
ca9ca9 analyzes Python package supply chains to…
copyleft · top 15,000 on PyPI
uv-secureScans uv.lock, pylock.toml, and…
permissive · top 15,000 on PyPI
pip-auditpip-audit scans Python environments and…
permissive · top 1,000 on PyPI
picklescanScans Python Pickle files and related…
permissive · top 15,000 on PyPI
pipmasterProgrammatically ensures Python packages are…
permissive · top 15,000 on PyPI
pysnykA Python client library for the Snyk API that…
permissive · top 15,000 on PyPI
pyre-checkPysa is a static analysis tool that tracks data…
permissive · top 15,000 on PyPI