# Remediation Agent

## The SonarQube Remediation Agent

{% hint style="success" %}
The SonarQube Remediation Agent is a [Beta](https://docs.sonarsource.com/sonarqube-cloud/appendices/product-release-lifecycle#beta) feature available with the Team (annual) and Enterprise plan accounts. It is free during the beta phase and will be a paid feature when it moves to [General Availability](https://docs.sonarsource.com/sonarqube-cloud/appendices/product-release-lifecycle#general-availability). To learn more about the terms & conditions, please see our legal page about features in [Early Access](https://www.sonarsource.com/legal/early-access/).
{% endhint %}

The SonarQube Remediation Agent runs an independent review and analysis to help you fix reliability and maintainability issues found in your latest code. It focuses on issues in your backlog, discovered in your main branch analysis, and on issues found in your latest GitHub pull request (PR).

The agent uses <code class="expression">space.vars.SQC\_Remediation\_agent\_LLM</code> to generate fix suggestions in the background and checks that the new code does not introduce new issues before offering the suggestion.

Once issues found during your analysis are assigned, the agent proposes fixes and creates new PRs so that you can review the changes. Users maintain full control of the agent at all times, from enabling it on a per-project basis, to reviewing and approving code suggestions for each issue.

It works with your most common languages (Java, JavaScript/TypeScript, and Python) by providing feedback on maintainability, reliability, and select security issues. In addition, it also offers fix suggestions for [Secrets](/sonarqube-cloud/analyzing-source-code/languages/secrets.md). See the [Remediation Agent](/sonarqube-cloud/administering-sonarcloud/ai-features/sonarqube-remediation-agent.md#requirements-and-limitations) article for complete details.

The agent can fix issues in three ways: in pull requests when a quality gate fails, from your backlog when you use the **Assign to Agent** button, or automatically on a configured schedule. See the [Remediation Agent](/sonarqube-cloud/administering-sonarcloud/ai-features/sonarqube-remediation-agent.md#agent-behavior) article for a full overview.

To enable and install the agent, check out the [Remediation Agent](/sonarqube-cloud/administering-sonarcloud/ai-features/sonarqube-remediation-agent.md) page. To understand the agent's behavior and learn how to engage with the agent in your pull request, have a look at the [Agents in your GitHub pull request](/sonarqube-cloud/managing-your-projects/issues/with-ai-features/agents-in-your-github-pull-request.md) and [Agent backlog fixes](/sonarqube-cloud/managing-your-projects/issues/with-ai-features/agent-backlog-fixes.md) pages.

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

If you use the SonarQube Remediation Agent, the affected code snippet will be sent by the agent to an LLM to generate a fix suggestion. These suggestions are verified by Sonar before being offered as an issue fix. Service agreements with Sonar’s LLMs prevent your code from being used to train those models and it is not stored by the LLM provider nor by any third party.

For details about terms and conditions, please refer to the [Early Access terms](https://www.sonarsource.com/legal/early-access/) in our [Legal Documentation](https://www.sonarsource.com/legal/).


---

# Agent Instructions: 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:

```
GET https://docs.sonarsource.com/sonarqube-cloud/ai-capabilities/sonarqube-remediation-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
