Start Free
2025.1 | Instance administration | AI features | Enabling AI CodeFix

Enabling AI CodeFix for your SonarQube Server instance

On this page

AI CodeFix is available in SonarQube Server, Enterprise and Data Center editions and uses Open AI’s GPT-4o to suggest fixes for your issues. 

Sonar AI CodeFix uses a large language model (LLM) to automatically generate AI-driven code fixes for the issues discovered by SonarQube Server. The process is simple. When you request a fix, the affected code and issue description are sent to an LLM. AI CodeFix then proposes an edit that resolves the problem without changing the code’s functionality.

AI CodeFix currently uses Open AI’s GPT-4o to suggest fixes for a select set of rules in Java, JavaScript, TypeScript, Python, C#, and C++. To learn more about which rules are eligible for AI CodeFix, please see the list of Rules covered with AI CodeFix.

Sharing your code with Sonar

If you use Sonar's AI CodeFix LLM, the affected code snippet will be sent by the AI CodeFix service to the selected LLM. Service agreements with Sonar’s LLMs prevent your code from being used to train those models. 

For details about terms and conditions, please refer to the AI CodeFix terms in our Legal Documentation.

Enabling AI-generated fix suggestions

AI CodeFix is available in SonarQube Server, Enterprise and Data Center editions and uses Open AI’s GPT-4o to suggest fixes for your issues. 

AI-generated fix suggestions are available for a select set of rules in Java, JavaScript, TypeScript, Python, C#, and C++. To learn more about which rules are eligible for AI CodeFix, please see the list of Rules covered with AI CodeFix.

As an Instance Admin, you can enable or disable AI CodeFix at the instance or project level.

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, set sonar.ai.codefix.hidden=true in your sonar.properties file.

Getting AI-generated fix suggestions

Once AI CodeFix is enabled, users will be able to select Generate AI Fix on eligible issues and copy/paste the fix into their IDE with the Open in IDE feature when using connected mode.

For complete details about using AI CodeFix to fix your issues in SonarQube Server, see the article on Getting AI-generated fix suggestions.

Marking a project as containing AI-generated code

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


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