> For the complete documentation index, see [llms.txt](https://docs.safetycli.com/safety-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.safetycli.com/safety-2/safety-cli-2-scanner/safety-v1-to-v2-breaking-changes.md).

# 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](/safety-2/safety-cli-2-scanner/output-formats.md) 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](/safety-2/safety-cli-2-scanner/policy-file.md) for detailed documentation and usage examples.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.safetycli.com/safety-2/safety-cli-2-scanner/safety-v1-to-v2-breaking-changes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
