> 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/issues/with-ai-features/backlog-fix-suggestions.md).

# Backlog fix suggestions

Let the SonarQube Remediation Agent fix issues in your main branch, on a schedule or for the issues you assign to it.

The SonarQube Remediation Agent works on the backlog of issues in your main branch, either automatically on a schedule or for the issues you assign to it. In both cases, it opens a pull request in your repository for you to review. To learn how the agent works, see [Remediation Agent](/agent-centric-development-cycle/in-your-long-living-branches-the-code-maintenance-loop/remediation-agent.md) in the Agent Centric Development Cycle documentation.

The Remediation Agent requires a separate subscription to your SonarQube Cloud Team (annual) or Enterprise plan.

## Prerequisites

An organization admin must enable the SonarQube Remediation Agent and add an LLM provider key for your organization before the agent can run. See [Enable your agent](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#enable-your-agent) and [Configure your LLM provider key](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#configure-your-llm-provider-key).

## Automated backlog remediation

The SonarQube Remediation Agent can run on a schedule, automatically proposing fixes for eligible issues in your main branch without manual assignment. When triggered, the agent opens pull requests in your repository on your configured schedule, grouped by rule key and file type, the same way it does for issues you assign manually. Each scheduled run opens one pull request for up to five issues in every selected repository.

An organization admin enables scheduled runs by selecting **Automated backlog remediation** when enabling the Remediation Agent on the **AI capabilities** page. For step-by-step instructions, see [Enable your agent](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#enable-your-agent). Once enabled, set the frequency (daily or weekly), the time, and the time zone at which the agent runs. To cap how many open pull requests the agent keeps active, set a limit under **Pause when open PRs reach**, or select **Don't pause**. These organization-level settings apply to all projects where the agent is enabled.

![The Automated backlog remediation settings: a project selection, a run schedule with frequency, time, and time zone, and a limit for the number of open pull requests.](https://2223713658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB4UT2GNiZKjtxFtcFAL7%2Fuploads%2Fgit-blob-6df5e298d0b0308ac9229f1d44b5d002d436953a%2Fsonarqube-cloud-automated-backlog-remediation.png?alt=media)

Project admins have the same controls and can override or disable scheduled runs for individual projects. Navigate to *Your Organization* > *Your Project* > **AI capabilities** to manage project-level settings. Project settings take precedence over the organization settings.

After the next scheduled time, open **Agent activity** to check that a run appears. If the agent produces fixes, open the resulting pull request to review them. If no run appears, check that the selected projects have eligible issues, then check the schedule's time zone, project-level overrides, and **Pause when open PRs reach** limit.

## Assigning issues to the agent

Reduce technical debt by selecting issues from your main branch and letting the SonarQube Remediation Agent propose fixes in new pull requests (PRs). The **Fix with Agent** button on the **Issues** page lets you send selected issues to the agent so it can generate a fix proposal for you to review.

Manual backlog remediation runs *only on the main branch*. An organization admin must enable **Manual backlog remediation** on the **AI capabilities** page before you can assign issues. For setup instructions, see [Enable your agent](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#enable-your-agent).

Only eligible issues in your main branch can be assigned to the agent. If you select a mix of eligible and non-eligible issues, a warning appears and you are reminded that only eligible issues will be sent to the service. The **Fix with Agent** button stays greyed out until at least one eligible issue is selected, and you can't assign more than 20 issues at one time. For a list of unsupported rules, see [Unsupported rules](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#unsupported-rules).

The agent groups fix suggestions for static analysis issues by rule key and file type. It processes each Hunter Agent finding separately, with its own pull or merge request, if a fix is available. Follow progress on your project's **Agent activity** page.

1. Navigate to your project's **Issues** page.
2. Select your main branch.
3. Use **Fixable by Agent** to find eligible issues, including Hunter Agent findings, then select the issues you want to fix.
4. Select **Fix with Agent** to send eligible issues to the SonarQube Remediation Agent.
5. Open **Agent activity** to follow the run. When a fix is available, open the linked pull request and review the proposed changes before merging.

![Select one or more issues to fix using the SonarQube Remediation Agent to fix issues in your backlog.](https://docs.sonarsource.com/~gitbook/image?url=https%3A%2F%2F2223713658-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FB4UT2GNiZKjtxFtcFAL7%252Fuploads%252Fc35RXVsNgqGeykXVTvu1%252Fsonarqube-cloud-assign-to-agent-steps.png%3Falt%3Dmedia%26token%3D702ab688-35d6-4a54-8971-5bcbee7bbeb2\&width=768\&dpr=3\&quality=100\&sign=23509ec6\&sv=2)

Backlog fixes are only available when addressing issues in your main branch. See the [Main branch analysis](/sonarqube-cloud/analyzing-source-code/branch-analysis/main-branch-analysis.md) page for information about the main branch **Summary** page.

## Fixing Hunter Agent findings

Assign eligible [Hunter Agent findings](/sonarqube-cloud/managing-your-projects/issues/with-ai-features/hunter-agent-findings.md) from your main branch to the Remediation Agent with **Fix with Agent**. Use the **Fixable by Agent** filter on the **Issues** page to find eligible findings. Findings must have an **Open**, **Confirmed**, or **Accepted** status.

Your project must be private and bound to GitHub, GitLab.com, or Azure DevOps. For platform requirements and restrictions, see [Supported DevOps platforms, languages, and issues](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#supported-devops-platforms-languages-and-issues).

To generate findings, your organization needs a separate Hunter Agent subscription on its Enterprise plan. To request fixes, your organization also needs a Remediation Agent subscription. An organization admin must enable **Manual backlog remediation** and configure an LLM provider key. See [Administer the Remediation Agent](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md).

## Reviewing agent fixes

The PR summary includes issue information in the same format you expect to see in an issue's rule description from any SonarQube product. The agent's fix proposal is delivered in a unique commit for each issue, ready for an engineer to review.

The SonarQube Remediation Agent's PR comment will have a list of **Fixed Issues** with information that includes the issue's rule description and the accompanying information as found with every SonarQube rule.

{% hint style="info" %}
Azure DevOps limits pull request descriptions to 4,000 characters. When the agent fixes several issues in one pull request and the full description would exceed that limit, it shortens the description: each issue keeps its rule, title, and a **View issue** link, while the detailed explanation is dropped to conserve characters. An indicator marks that more issues were fixed than the description lists in full.
{% endhint %}

If CI fails on the agent's PR, the agent automatically reads the build logs and pushes a new commit to fix the failures. This applies to PRs created by both manual and automated backlog remediation. The agent retries up to three times and tracks progress in the PR description. For details on how CI/CD failure recovery works, see [CI/CD failure recovery](/sonarqube-cloud/managing-your-projects/issues/with-ai-features/pull-request-fix-suggestions.md#cicd-failure-recovery).

{% hint style="info" %}
CI/CD failure recovery works only for GitHub Actions workflows. If your CI uses another provider, SonarQube Cloud detects the failure but can't retrieve the logs needed to generate a fix.
{% endhint %}

## Reviewing agent activity <a href="#agent-activity" id="agent-activity"></a>

Scheduled runs and the issues you assign both show up on your project's **Agent activity** page, alongside the agent's pull request runs. See [Agent activity](/sonarqube-cloud/managing-your-projects/issues/with-ai-features.md#agent-activity) for details.

## Agents in your pull request

The agent also works on the new issues found in your pull requests, for C#, Java, JavaScript/TypeScript, PHP, and Python projects, when the quality gate fails with new issues introduced. See [Pull request fix suggestions](/sonarqube-cloud/managing-your-projects/issues/with-ai-features/pull-request-fix-suggestions.md) for the full details.

## Related products

For AI-powered pull request review automation, see [Gitar](https://docs.gitar.ai), a separate Sonar product.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cloud/managing-your-projects/issues/with-ai-features/backlog-fix-suggestions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
