Autofix

Learn about Sentry's AI-powered Autofix and how it helps you debug and fix issues faster.

Autofix uses Sentry's context (issue details, tracing data, and profiles), your codebase (integrated through GitHub), and its interactions with you to identify and reason through problems in your code. Autofix can identify the root cause and suggest a code change for fixing the issue and/or add unit tests for it. You can find it in the Solutions Hub section of the issue details page after clicking on any error from the Issues page.

Autofix is powered by Seer, which is Sentry's AI agent.

Before you can use Autofix, you need to enable the features that leverage generative AI for your Sentry organization. From the Organization Settings page, make sure that Hide AI Features is off:

Screnshot of the Organization Settings page, showing how "Hide AI Features" is disabled

When you start an Autofix run, you'll see the following screen, with an option to share any additional context:

Screenshot of the start screen of Autofix, showing an initial summary of the issue

Autofix will then analyze the issue and relevant code to help identify the root cause and a solution. You'll see a live stream of Autofix's thought process in real time as it works through the problem. Autofix will share key insights as they come up and you'll have the option to expand each. You'll see the event data and code that support Autofix conclusions, building a clear chain of reasoning back to the root cause.

While Autofix is reasoning through your problem, you can step in at any time to add context or feedback; collaboration tends to lead to the best results. If Autofix encounters gaps in its understanding, it will ask for your input.

The output will be a clearly defined root cause of the Sentry issue, and a detailed solution for how to resolve it:

Screenshot of Autofix showing a root cause and potential solution for the issue

You are free to edit or adjust this solution based on your own requirements and preferences. Once you are ready to proceed, you can select "Code It Up" to generate code resolving the bug. You have three options:

  • Write a fix
  • Write a unit test reproducing the issue
  • Write both

Screenshot of the Autofix drop-down asking whether Autofix should write a fix, a unit test, or both

Once the coding step is complete, you can either create a Pull Request (PR) in GitHub directly from Autofix, or create a branch and checkout the code locally if you would like to iterate further.

Screenshot of the code changes proposed by Autofix, showing buttons to check out the created branch or open a Pull Request

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").