> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/ai-features/enable-ai-codefix.md).

# AI CodeFix

Sonar’s AI CodeFix uses a large language model (LLM) to automatically generate AI-driven code fixes for the issues discovered by SonarQube Cloud AI CodeFix must be enabled by an Instance Admin and is defined for **All projects** or for **Only selected projects**.

See the [Enable AI CodeFix](/sonarqube-cloud/administering-sonarcloud/ai-features/enable-ai-codefix.md) page for the full details.

## Getting AI-generated fix suggestions <a href="#getting-ai-generated-fix-suggestions" id="getting-ai-generated-fix-suggestions"></a>

SonarQube Cloud’s AI CodeFix is a feature that uses <code class="expression">space.vars.SQC\_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, check the list of [Rules for AI CodeFix](/sonarqube-cloud/standards/managing-rules/rules-for-ai-codefix.md#ai-codefix-rules).

When an Instance Admin enables AI CodeFix for your project, you can get an AI-generated fix suggestion for eligible issues. See the [Sonar AI CodeFix terms](https://www.sonarsource.com/legal/ai-codefix-terms/) for details about the terms of access.

If you’re using connected mode with SonarQube for VS Code or SonarQube for IntelliJ, it's possible to get AI-generated fix suggestions directly in your IDE. See the relevant SonarQube for IDE pages to see how it works:

* In SonarQube for VS Code: [AI CodeFix](/sonarqube-for-vs-code/ai-capabilities/ai-codefix.md#ai-codefix)
* In SonarQube for IntelliJ: [AI CodeFix](/sonarqube-for-intellij/ai-capabilities/ai-codefix.md#ai-codefix)

If you're not using connected mode with SonarQube for IDE, see the [Fixing issues](/sonarqube-cloud/managing-your-projects/issues/fixing.md#getting-ai-generated-fix-suggestions) article for alternative instructions. Then use the [Fixing issues](/sonarqube-cloud/managing-your-projects/issues/fixing.md#opening-issues-in-your-ide) feature to apply the fix.

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

* Administering your [AI features](/sonarqube-cloud/administering-sonarcloud/ai-features.md) as an Organization Admin
* [Set up AI Code Assurance](/sonarqube-cloud/managing-your-projects/administering-your-projects/ai-features/set-up-ai-code-assurance.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/administering-your-projects/ai-features/enable-ai-codefix.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
