Start FreeLog in
SonarQube Cloud | Administering SonarQube Cloud | AI features | Enable AI CodeFix

Enabling AI CodeFix

On this page

AI features are only available in SonarQube Cloud Team and Enterprise plans.

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 an Early Access feature that generates AI-generated fix suggestions in SonarQube Cloud Team and Enterprise plans. It must be activated by an Organization Admin.

SonarQube Cloud's AI CodeFix is a feature that uses Open AI’s GPT-4o (recommended) or Anthropic's Claude 3.5 or 3.7 Sonnet to suggest fixes for some issues detected in your projects. See the Sonar AI CodeFix terms for details about the terms of access. 

As an Organization Admin, you can activate or deactivate AI-generated fix suggestions in your organization. This allows developers to get AI-based fix suggestions for the issues detected in their projects. To enable AI CodeFix:

  1. Go to Your Organization > Administration > Organization settings > AI CodeFix and select Enable AI CodeFix
  2. Select your provider:
    • OpenAI GPT-4o (Recommended)
    • Anthropic Claude 3.5 Sonnet
    • Anthropic Claude 3.7 Sonnet
  3. Once AI CodeFix is enabled, select either All projects or Only selected projects to activate the feature.

Note that if you choose Only selected projects, new projects will not be automatically enabled.

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.

The easiest way to use AI CodeFix is by opening the issue directly in your IDE. Simply open your project in SonarQube for IntelliJ and set up connected mode with SonarQube Cloud. In your IDE, select an issue marked with the $ai-icon-sparkle icon, open the Rule description > $ai-icon-sparkleAI CodeFix tab, and select $ai-icon-sparkleGenerate Fix. A fix will be generated in the code editor and you'll have a chance to Apply or Decline the suggestion.

For complete details about using AI CodeFix to fix your issues in SonarQube Cloud, 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 Setting quality standards for AI Code Assurance 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