> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/snyk-cli/commands/fix.md).

# Fix

{% hint style="info" %}
`snyk fix --agentic` is a new LLM-driven command. It is distinct from the legacy `snyk fix` command, which used a deterministic fix engine and is deprecated.
{% endhint %}

## Prerequisites

To use the `snyk fix --agentic` command:

* Install the latest version of the [Snyk CLI](https://github.com/snyk/user-docs/tree/main/developer-tools/snyk-cli/install-or-update-the-snyk-cli/README.md)
* [Authenticate](/developer-tools/snyk-cli/commands/auth.md) your machine with the Snyk CLI using `snyk auth`
* Configure an LLM provider API key. See [Remediation Agent](https://github.com/snyk/user-docs/tree/main/agent-security/remediation-agent.md) for supported providers and setup instructions.

## Usage

`snyk fix --agentic --experimental --sca|--sast [<PATH>]`

## Description

The `snyk fix --agentic` command is an LLM-driven vulnerability remediation command. It scans your project for vulnerabilities, generates a fix plan enriched with Snyk's security intelligence, and walks you through applying and verifying each fix interactively. Use `--auto-approve` to apply fixes without prompting.

Choose what to remediate with a product flag:

* `--sca` — Snyk Open Source. Fixes vulnerable dependencies by bumping versions and adding overrides.
* `--sast` — Snyk Code. Applies Snyk Agent Fix suggestions for source-code security issues and rescans to confirm the issue is resolved.

You must pass exactly one of `--sca` or `--sast`. The `--experimental` flag is required alongside `--agentic`.

For conceptual documentation about the Remediation Agent, including setup instructions and supported IDEs, see [Remediation Agent](https://github.com/snyk/user-docs/tree/main/agent-security/remediation-agent.md).

## Exit codes

**0**: Success. Vulnerabilities were remediated.\
**1**: Action needed. Some vulnerabilities could not be fixed.\
**2**: Failure. An error occurred. Use `-d` to output the debug logs.

## Debug

Use the `-d` option to output the debug logs.

## Options

### `--agentic`

Enable the LLM-driven fix flow. Required to use this command in agentic mode.

### `--experimental`

Required alongside `--agentic`. Acknowledges early-access status.

### `--sca`

Remediate Snyk Open Source (dependency) vulnerabilities. Mutually exclusive with `--sast`.

### `--sast`

Remediate Snyk Code (source-code) issues. Mutually exclusive with `--sca`.

### `--provider=<PROVIDER>`

LLM provider to use. Accepted values: `anthropic` (default), `openai`, `vertex`, `litellm`, `ollama`.

Example: `snyk fix --agentic --experimental --sca --provider=openai`

### `--model=<MODEL>`

Model ID. Required for Ollama (for example, `llama3.1`). Optional override for Anthropic and OpenAI.

Example: `snyk fix --agentic --experimental --sca --provider=ollama --model=llama3.1`

### `--dry-run`

Show the fix plan without applying changes.

Example: `snyk fix --agentic --experimental --sca --dry-run`

### `--auto-approve`

Automatically approve fixes for all discovered issues. Combine with `--issue-ids` or `--severity-threshold` to restrict scope.

### `--issue-ids=<ID>[,<ID>]...`

Comma-separated list of Snyk issue IDs to fix.

Example: `snyk fix --agentic --experimental --sca --issue-ids=SNYK-JS-FOO-123,SNYK-JS-BAR-456`

### `--severity-threshold=<SEVERITY>`

Fix issues at or above this severity. Accepted values: `CRITICAL`, `HIGH`, `MEDIUM`.

Example: `snyk fix --agentic --experimental --sca --severity-threshold=HIGH`

### `--no-breakability`

Skip the Snyk breakability assessment and use local heuristics only.

### `-d`, `--debug`

Print debug information to stderr.


---

# 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.snyk.io/developer-tools/snyk-cli/commands/fix.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.
