Skip to content

Upgrading safety 2 to 3

Breaking2.3.5 → 3.8.1Breaking3Deprecated2New40Changed27Fixed67Other75

BreakingUpgrade verdict

3 breaking changes.

  • The system-scan command is gone, so anyone using it must switch to another approach.
  • The tool now uses a different HTTP library and handles secure connections and proxies explicitly, which can change how network requests behave.
  • This is a big new version of Safety CLI. It adds improvements and new features, but some things work differently than in version 2, so upgrading may require changes.
  • The license command now warns that it is deprecated.
5 items need code or config changes

safety publishes an official migration guide for version 3. It covers more than the release notes do.

Migrating from Safety 2.x to Safety CLI 3 ↗

Requires Python >=3.9 from 3.7.0b0 (none stated before).

Adds authlib >=1.2.0, certifi, filelock <4.0,>=3.16.1, httpx, jinja2 >=3.1.0, marshmallow >=3.15.0, nltk >=3.9, pydantic >=2.6.0, safety-schemas ==0.0.16, tenacity >=8.1.0, tomlkit, truststore >=0.10.4, typer <0.26.0,>=0.16.0, typing-extensions >=4.7.1.

Drops requests, setuptools.

Installs 41 packages in all (was 11).

Also installs annotated-doc, annotated-types, anyio, cffi, cloudpickle, cryptography, defusedxml, h11, httpcore, joblib, joserfc, markdown-it-py, markupsafe, mdurl, pycparser and 7 more.

No longer installs charset-normalizer, pyparsing, urllib3.

Moves packaging 21.3.0 → 26.3.0. Your build may pick other versions.

Breaking3
Removes the system-scan command.
system-scan
Migrates HTTP handling to httpx with explicit TLS and proxy configuration, a behavior change.
httpx
Safety 3.0.0 is a major update from 2.x with enhancements to core features, new capabilities, and breaking changes.
Deprecated2
Adds a deprecation message for the license command.
license
Adds a deprecation warning for the check argument.
check