---
title: "Autofix"
description: "Use Seer's Autofix to automatically find the root cause of issues and generate code fixes."
url: https://docs.sentry.io/product/ai-in-sentry/seer/autofix/
---

# Autofix

**Autofix** is a collaborative workflow to find the root cause of, and solution to, issues. It uses Sentry's context (issue details, tracing data, logs, and profiles), your codebases (integrated through GitHub), and its interactions with you to identify and reason through problems in your code. Autofix can propose a solution, or be configured to follow through and open a PR with the solution.

## [Getting Started](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#getting-started)

Set up Issue Autofix in your organization or on specific projects:

1. Connect to GitHub through the [Sentry GitHub integration](https://docs.sentry.io/organization/integrations/source-code-mgmt/github.md). You can follow the steps in [Seer settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/) to get started. **Note:** Seer can only be integrated with the cloud version of GitHub.

2. Select which repositories you want to connect to Sentry, go to [Seer SCM Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/scm/) to make sure your repositories are connected.

3. Connect projects to repositories in [Seer Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/projects/). Seer will use the repositories connected to the project to perform Autofix (including Root Cause Analysis and Code Generation).

4. Optionally enable [PR creation](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/repos/) and/or delegate to a [coding agent](https://sentry.io/orgredirect/organizations/:orgslug/settings/integrations/?category=coding%20agent).

## [How Issue Autofix Works](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#how-issue-autofix-works)

Seer's Issue Autofix flow follows a three step process:

1. [Root Cause Analysis](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#root-cause-analysis): Analyze the issue using Sentry's context and your codebases and determine the root cause
2. [Solution Identification](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#solution-identification): Identify a solution based on the analysis
3. [Code Generation](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#code-generation): Generate a code fix and (optionally) open a PR

You can always manually trigger the Autofix flow from the Issue Details page. Issues will automatically trigger the flow when an agent is configured for background handoff and the Issue is highly actionable with 10+ events captured and high medium or above fixability score.

If you've recently set up Seer, existing issues will need Autofix to be run manually.

### [Root Cause Analysis](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#root-cause-analysis)

Once Root Cause Analysis has been triggered, Seer will review the issue and relevant code to help identify the root cause and propose a solution. You'll see a live stream of Seer's thought process in real time as it works through the problem. You can expand key insights to see supporting event data and code, tracing a clear path back to the root cause.

At any time, you can step in to add context or feedback; collaboration usually leads to the best results. If Seer encounters gaps in its understanding, it will ask for your input.

The final root cause analysis will show you the sequence of events that led to the issue, and a detailed analysis of the most likely culprit. This includes helpful annotations, such as links back to the exact lines of code and/or Sentry telemetry that are relevant to the analysis.

### [Solution Identification](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#solution-identification)

Once Seer has completed its root cause analysis, it will begin searching for a solution. It will look similar to the root cause analysis process, where Seer shows its work, but with a focus on finding a solution.

When it's finished, you will see the recommended solution. From here, you can:

1. Remove any steps or actions that you disagree with
2. Add any additional steps or instructions, for example request additional unit tests to prevent regressions of the original error

Once you are ready to proceed, you can select "Code It Up" to generate code resolving the bug.

### [Code Generation](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#code-generation)

During the coding step, Seer will identify the code patch (or patches) needed to implement the solution. When it's done, you'll see a preview showing the suggested diffs across your codebase. If the fix involves service dependencies, you may see edits spanning across multiple repositories.

From here, you can choose to draft a PR, or checkout the code changes locally for further iteration. If you choose to checkout the code locally, Seer will make a new branch for you.

You can prevent Seer from creating PRs for your organization by disabling [code generation](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/#enableSeerCoding).

**Note:** Disabling the setting removes the **Create PR** button from the Autofix flow and prevents anyone from enabling **Allow Root Cause Analysis to create PRs by Default**. Sentry will not create PRs or push code to your codebase. This setting does not impact AI chat sessions, where you can potentially prompt our AI chat to emit code snippets and examples, and does not affect workflows involving your own coding agent.

## [Autofix in Slack \[Beta\]](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#autofix-in-slack-beta)

This feature is currently in **beta**. Beta features are still a work in progress and may have bugs. We recognize the irony.

If you have the [Slack integration](https://docs.sentry.io/organization/integrations/notification-incidents/slack.md) enabled, you can trigger Autofix from a Slack message.

1. Invite Sentry to your Slack channel (@Sentry)
2. Make sure you have [Issue Alerts](https://docs.sentry.io/organization/integrations/notification-incidents/slack.md#issue-alerts) configured to send alerts to the Slack channel
3. When a new issue is shown on the channel, it will include an option to *Fix with Seer*

Clicking *Fix with Seer* will trigger Autofix for the issue. You can wait to see the result posted in the issue thread, or go to Sentry to see the process. Seer will prompt you to take next steps once it has finished running, including planning a solution, generating code, and pushing it to your codebase.

## [What Autofix Uses](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#what-autofix-uses)

Seer handles access to a wide variety of data sources and tools. While debugging issues, it may examine:

* **Issue details**: Error messages, stack traces, and event metadata from your [Issues](https://docs.sentry.io/product/issues.md)
* **Tracing data**: Distributed [traces](https://docs.sentry.io/concepts/key-terms/tracing.md#whats-a-trace) and span information
* **Logs**: Structured [Logs](https://docs.sentry.io/product/explore/logs.md) from your application (beta)
* **Your codebases**: Relevant code from linked GitHub repositories, with support for multiple repos for distributed services
* **Performance data**: Profiles and performance metrics
* **Interactive feedback**: Your input and guidance during the process

This context is crucial to Seer's capabilities, and it allows it to do things like investigate a backend service that may be the true root cause for a frontend bug you are trying to troubleshoot.

## [Settings](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#settings)

Autofix's default behavior can be customized in several ways:

1. You can manually customize the repositories it has access to
2. You can set an override for the default branch in each repository
3. You can prevent Seer from creating PRs, or pushing them to your codebase for your organization (under **Advanced Settings** in [Seer settings - Enable Code Generation](https://sentry.io/orgredirect/organizations/:orgslug/settings/seer/#enableSeerCoding))

Seer already automatically parses rules files from [Cursor](https://docs.cursor.com/context/rules), [Windsurf](https://windsurf.com/editor/directory), [Cline](https://docs.cline.bot/features/cline-rules), and [Claude Code](https://docs.anthropic.com/en/docs/claude-code/tutorials#create-an-effective-claude-md-file)

## [Best Practices](https://docs.sentry.io/product/ai-in-sentry/seer/autofix.md#best-practices)

* The more Sentry context you have, the better equipped Seer will be to help: consider instrumenting your application to collect traces, profiles and logs, and send them to Sentry.
* For JavaScript / TypeScript projects that are minified in production, upload [source maps](https://docs.sentry.io/platforms/javascript/sourcemaps.md) to Sentry for the best results.

Currently, the cloud version of GitHub is the only SCM supported by Seer.
