# Enable AI CodeFix

*AI CodeFix is only available in SonarQube Server* [*Enterprise and Data Center editions*](https://www.sonarsource.com/plans-and-pricing/sonarqube/) to provide AI-generated 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 <code class="expression">space.vars.SQS\_20251\_Supported\_LLM\_version</code> to suggest fixes for a select set of rules in Java, JavaScript, TypeScript, Python, HTML, CSS, C#, and C++. To learn more about which rules are eligible for AI CodeFix, please see the list of [#ai-codefix-rules](https://docs.sonarsource.com/sonarqube-server/2025.1/user-guide/rules/rules-for-ai-codefix#ai-codefix-rules "mention").

## Sharing your code with Sonar <a href="#sharing-your-code-with-sonar" id="sharing-your-code-with-sonar"></a>

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](https://www.sonarsource.com/legal/ai-codefix-terms/) in our [Legal Documentation](https://www.sonarsource.com/legal/).

## Enabling AI-generated fix suggestions <a href="#enabling-ai-generated-fix-suggestions" id="enabling-ai-generated-fix-suggestions"></a>

AI CodeFix is available in SonarQube Server, [Enterprise and Data Center editions](https://www.sonarsource.com/plans-and-pricing/sonarqube/) and uses <code class="expression">space.vars.SQS\_20251\_Supported\_LLM\_version</code> to suggest fixes for your issues.

AI-generated fix suggestions are available for a select set of rules in Java, JavaScript, TypeScript, Python, HTML, CSS, C#, and C++. To learn more about which rules are eligible for AI CodeFix, please see the list of [#ai-codefix-rules](https://docs.sonarsource.com/sonarqube-server/2025.1/user-guide/rules/rules-for-ai-codefix#ai-codefix-rules "mention").

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.

{% hint style="info" %}
You’ll need a connection to the internet to access SonarQube Server’s AI CodeFix service.

The service is provided via api.sonarqube.io and has these static IP addresses:

* 99.83.135.55 (CIDR: 99.83.135.55/32)
* 15.197.164.24 (CIDR: 15.197.164.24/32)
  {% endhint %}

Once enabled, developers can get AI-generated fix suggestions from the **Issues** page in their projects. See the [fixing](https://docs.sonarsource.com/sonarqube-server/2025.1/user-guide/issues/fixing "mention") page for more details.

### Disabling AI CodeFix <a href="#disabling-ai-codefix" id="disabling-ai-codefix"></a>

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 <a href="#getting-ai-generated-fix-suggestions" id="getting-ai-generated-fix-suggestions"></a>

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](https://docs.sonarsource.com/sonarqube-server/2025.1/user-guide/connected-mode "mention").

For complete details about using AI CodeFix to fix your issues in SonarQube Server, see the article on [#getting-ai-generated-fix-suggestions](https://docs.sonarsource.com/sonarqube-server/2025.1/user-guide/issues/fixing#getting-ai-generated-fix-suggestions "mention").

## Usage limits <a href="#limits" id="limits"></a>

Limits are placed on the AI CodeFix feature to manage abuse. Developers will be notified directly when the monthly allocation is reached for your organization. If the instance is blocked due to reaching the allowance, users attempting to generate a fix will see an error message. Usage quotas are reset on the first day of each month.

## Marking a project as containing AI-generated code <a href="#marking-a-project-as-containing-ai-generated-code" id="marking-a-project-as-containing-ai-generated-code"></a>

Sonar 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 [ai-standards](https://docs.sonarsource.com/sonarqube-server/2025.1/ai-capabilities/ai-standards "mention") page.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [overview](https://docs.sonarsource.com/sonarqube-server/2025.1/ai-capabilities/overview "mention") of AI capabilities
* [autodetect-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.1/ai-capabilities/autodetect-ai-code "mention")
* Learn about [ai-standards](https://docs.sonarsource.com/sonarqube-server/2025.1/ai-capabilities/ai-standards "mention")
* See also[enable-ai-codefix](https://docs.sonarsource.com/sonarqube-server/2025.1/instance-administration/ai-features/enable-ai-codefix "mention") to get AI-generated fix suggestions
