Safety v1 to v2 Breaking Changes

Safety v2 is a major improvement in features and we recommend you upgrade as soon as possible.

Below is a list of the difference between Safety 1.x and Safety v2 including breaking changes you want to be aware of.

New screen/text output

Safety v2's new screen and text output is much more comprehensive than Safety 1.x. It removes the old table format and makes room for more information including report meta-information, packages found, vulnerabilities found as well as remediation (fix) recommendations for each package found with vulnerabilities.

New and improved JSON structure

Safety 2's JSON output is new and different from Safety 1.x. We overhauled the structure for improved clarity and to allow for the inclusion of a lot more data. Please refer to Safety 2.0: Outputs to read more about this new JSON structure.

Improved exit codes

Safety 2 now natively supports exit codes. It will return a zero (success) exit code for scans that find no vulnerabilities, and non-zero exit codes for scans that find vulnerabilities or have other issues.

Safety policy file

Safety 2 introduces local security policy files so that your team can configure and share a security policy for each Python project you are scanning using Safety. Please refer to Safety 2.0: Policy file for detailed documentation and usage examples.

Last updated