Start Free
Latest | AI capabilities | AI-generated fix suggestions

Using AI-generated fix suggestions in your SonarQube instance

On this page

Enabling AI-generated fix suggestions

AI CodeFix is available in Early Access for all commercial editions of SonarQube Server.

AI CodeFix uses Open AI’s GPT-4 to suggest fixes for a select set of rules in Java, JavaScript, TypeScript, Python, C#, and C++.

As an instance administrator, you can enable or disable AI-generated fix suggestions on your projects. SonarQube Server uses OpenAI’s GPT-4 to generate the suggestions.

To enable AI-CodeFix, go to Administration > Configuration > General Settings > AI CodeFix > Enable AI-generated fix suggestions and select Enable AI CodeFix. Once AI CodeFix is enabled, select either All projects or choose projects individually from the list to activate the feature.

Note that if you choose Enable AI CodeFix on selected projects only, new projects will not be automatically enabled.

Once enabled, developers can get AI-generated fix suggestions from the Issues page in their projects. See Fixing issues for more details.

Disabling AI CodeFix

To disable AI CodeFix completely in SonarQube Server and hide the feature from all users, including Instance Admins, please send an email to with the subject “Disabling AI CodeFix” or contact Sonar Support via your usual communication channel.

Getting AI-generated fix suggestions

AI-generated fix suggestions are available for a select set of rules in Java, JavaScript, TypeScript, Python, C#, and C++.

When an Instance Admin enables AI CodeFix for your project, you can get an AI-generated fix suggestion for eligible issues. The suggestions are generated using OpenAI's GPT-4. 

To generate a fix suggestion: 

  • Retrieve the issue and open its detail view. If an AI CodeFix is an option for that particular issue, you will see the Generate AI Fix button.
  • From either the Where is the Issue? or the AI CodeFix tabs, select Generate Fix.
If an AI CodeFix is available for your issue, SonarQube Server will offer a Generate AI Fix button to select.

An AI CodeFix will be generated, and you’ll see a diff view in the AI CodeFix tab. If you're using SonarLint and have Connected mode set up, select View fix in IDE to streamline the process and see the diff view in your IDE. Then, simply copy and paste the generated fix into your IDE. 

  • If you are running SonarQube for Visual Studio, selecting View fix in IDE will directly paste the fix suggestion into your IDE.

An AI Code Assurance badge is available to mark your AI projects as reviewed by SonarQube Server. Any user with project access can use the badge. For more detailed instructions, see the Marking a project as containing AI-generated code article on the Project settings page.

AI Code Assurance

SonarQube Server recognizes that AI-generated code should be monitored with additional quality standards and offers administrators a series of tools described on the Standards for AI-generated code page.

It's possible to view ratings for projects with AI Code Assurance in your portfolios beginning in the Enterprise edition. There, you will see a breakdown of projects, applications, and nested portfolios that include the standards you've set for AI-generated code. See the Portfolio breakdown article for more information.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License