> 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 is part of Sonar Agent Essentials, a product that 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 timezone 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 timezone, 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.

Scheduled runs are visible on the **Agent activity** page.

## 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 (PR). The **Assign to 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.

The **Backlog fixes** feature runs *only on the main branch*. It must be enabled by selecting **Backlog fixes** from the **AI capabilities** page in SonarQube Cloud. For step-by-step instructions to enable the **Backlog fixes**, 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 **Assign to 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 [Requirements and limitations](/sonarqube-cloud/administering-sonarcloud/ai-features/administer-remediation-agent.md#requirements-and-limitations).

When you select **Assign to Agent**, the agent opens a new pull request in your repository, authored by the SonarQube Remediation Agent. Fix suggestions are grouped together in PRs, organized by rule key and file type; one PR will be opened for each rule key and/or file type. An estimated time to fix notification will pop up and the agent's activity will be visible on the **Agent activity** page when the PR is available.

1. Navigate to your project's **Issues** page.
2. Check that you are on the `main` branch.
3. Select issues from your backlog that you want the agent to fix.
4. Select **Assign to Agent** to send eligible issues to the SonarQube Remediation Agent.

![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.

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