---
title: Bits Remediation
description: >-
  Learn how Bits provides actionable remediation next steps for root cause
  investigations.
breadcrumbs: Docs > Bits AI > Bits Remediation
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Bits Remediation

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com

{% callout %}
##### Join the Preview!

Bits Remediation includes capabilities in Preview. Click **Request Access** to join the Preview program.

[Request Access](https://www.datadoghq.com/product-preview/bits-remediation/)
{% /callout %}

{% /callout %}

## Overview of Bits Remediation{% #overview-of-bits-remediation %}

Bits Remediation helps on-call engineers, SREs, and platform teams act on the root cause that [Bits Investigation](https://docs.datadoghq.com/bits_ai/bits_investigation.md) finds. From an investigation, Bits can generate code fixes, run triage actions, and take action on your infrastructure. Admins govern which actions Bits can take and who must approve them. After you approve and apply the changes, Bits verifies that the issue is resolved.

For example, Bits might trace rising error rates to a faulty Kubernetes deployment. From the investigation, you can use Bits to open an incident, roll back the deployment, and generate a pull request that fixes the underlying error. Afterward, Bits can verify that error rates returned to normal.

This image shows a Bits Investigation remediation plan with suggested next steps:

{% image
   source="https://docs.dd-static.net/images/bits_ai/bits_remediation/remediation_plan.15beeb0cafb2f55df6a0ce29e1704867.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/bits_remediation/remediation_plan.15beeb0cafb2f55df6a0ce29e1704867.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A Bits Investigation remediation plan with five suggested next steps: declare an incident, update a Kubernetes deployment, create a Jira issue, fix the code, and verify resolution, which is marked complete. Below it, the issue status shows Resolved after the monitor returned to OK." /%}

## Automatic code fixes{% #automatic-code-fixes %}

Bits integrates with [Bits Code](https://docs.datadoghq.com/bits_ai/bits_code.md) to generate code fixes as part of the remediation plan for an investigation. Bits Code connects to your source code provider to create, update, and iterate on production-ready pull requests, based on existing issues detected by Datadog. This allows you to resolve issues with code-related root causes directly from an investigation.

### Enable automatic code fixes{% #enable-automatic-code-fixes %}

To enable code fixes:

1. [Set up Bits Code](https://docs.datadoghq.com/bits_ai/bits_code/setup.md).

1. (Optional) To have Bits open pull requests for you, enable [auto-push](https://docs.datadoghq.com/bits_ai/bits_code/setup.md#enable-auto-push). By default, you create the pull request from the suggested fix.

After Bits determines a code-related root cause for an issue, Bits automatically generates a suggested code fix.

### Disable automatic code fixes{% #disable-automatic-code-fixes %}

By default, when Bits Code is configured, Bits automatically generates code fixes for investigations with code-related root causes.

To manually generate code fixes instead:

- Disable automatic code fix generation in [Settings](https://app.datadoghq.com/bits-ai/settings/source-code-integration).

### Review and approve code fixes{% #review-and-approve-code-fixes %}

To review and approve code fixes from an investigation:

1. Go to Bits AI > Investigations and open the target investigation.
1. In the investigation, under Next Steps, review the suggested code fix:
   {% image
      source="https://docs.dd-static.net/images/bits_ai/bits_remediation/code_fix.31ce9365ab75488862d226ec9a80e27c.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/bits_remediation/code_fix.31ce9365ab75488862d226ec9a80e27c.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="A suggested code fix in Next Steps with a summary of the changes, a diff of login_controller.rb, and buttons to create a pull request or view the session in Bits Code" /%}
1. (Optional) Chat with Bits within the code session to update the suggested code fix.
1. If [auto-push](https://docs.datadoghq.com/bits_ai/bits_code/setup.md#enable-auto-push) is disabled, create the pull request from the suggested fix.
1. Review and merge the pull request when ready.

## Triage actions{% #triage-actions %}

During an investigation, Bits pulls relevant context from the investigation and your connected integrations to prefill Slack messages, incident descriptions, and ticket metadata. This reduces manual effort, helps ensure consistency, and accelerates response time.

### Supported triage actions{% #supported-triage-actions %}

Supported triage actions include:

- Sending Slack messages
- Creating incidents in Datadog and PagerDuty
- Paging engineers using Datadog On-Call
- Creating work items in Datadog Work Management
- Opening Jira tickets

### Run triage actions{% #run-triage-actions %}

To run triage actions from an investigation:

1. Go to Bits AI > Investigations and open the target investigation.
1. In the investigation, under Next Steps, review and run the triage action.

## Infrastructure actions{% #infrastructure-actions %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com

{% callout %}
##### Join the Preview!

One-click actions are in Preview.Request Access
{% /callout %}

{% /callout %}

During an investigation, Bits can recommend remediation actions to take on your infrastructure, such as rolling back a Kubernetes deployment, rebooting an EC2 instance, or invoking an AWS Lambda function. An infrastructure action can resolve an infrastructure-related root cause, or reduce the impact of an issue while you work on a longer-term fix. For more information about the available actions, see the [Action Catalog](https://docs.datadoghq.com/actions/actions_catalog.md).

### Manual recommendations and one-click actions{% #manual-recommendations-and-one-click-actions %}

Bits supports the following options for infrastructure actions:

- **Manual recommendations**: From the Next Steps section of an investigation, copy the suggested command (for example, a `kubectl patch` command) and run it in your own CLI.

- **One-click actions (Preview)**: From the Next Steps section of an investigation, click Approve to let Bits execute the suggested remediation action directly from the investigation context. You can also configure Slack notifications to approve the remediation action from Slack. One-click actions are available for Kubernetes and AWS infrastructure. Bits can run an infrastructure action only when a [guardrail](https://docs.datadoghq.com/bits_ai/bits_remediation/guardrails.md) covers the action and the resource it targets. For information about how to enable one-click infrastructure actions, see [Infrastructure Actions](https://docs.datadoghq.com/bits_ai/bits_remediation/infrastructure_actions.md).

  {% image
     source="https://docs.dd-static.net/images/bits_ai/bits_remediation/kubernetes_action_approve.995c05135c6c2e07f428598b0759d1d7.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/bits_remediation/kubernetes_action_approve.995c05135c6c2e07f428598b0759d1d7.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="A suggested Kubernetes remediation step that patches the same deployment across four production clusters, with an Approve button for each patch" /%}

## Validate that issues are resolved{% #validate-that-issues-are-resolved %}

Bits can verify whether a remediation action was applied successfully, and whether the original issue was resolved:

{% image
   source="https://docs.dd-static.net/images/bits_ai/bits_remediation/verify_resolution.1e480577bc1f38991839e050201ef278.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/bits_remediation/verify_resolution.1e480577bc1f38991839e050201ef278.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A completed Verify resolution step with an issue status of Resolved, explaining that the monitor returned to OK and showing a graph of the error rate back at baseline levels" /%}

To verify that issues are resolved:

- In the target investigation, click Verify Resolution.

If you verify right after an action runs, the status might show **Not resolved yet** while pre-fix errors are still in that window. Wait for the related monitor to recover, then click Check Again.

## Review action history{% #review-action-history %}

[Action History](https://app.datadoghq.com/bits-ai/settings/action-history) in Bits Settings is an auditable record of every action Bits has taken, including triage actions and infrastructure actions. Filter the list by action, integration, or investigation, and click an action to see:

- **Execution details**: The status, start and end time, duration, and connection used.
- **Scope and policy**: The guardrail that covered the action and who initiated it.
- **Original investigation**: The root cause and impact that led to the action, with a link to the investigation.
