View a markdown version of this page

Mitigation plans - AWS Ops Agent (formerly DevOps Agent)

Mitigation plans

When an investigation finds a root cause, AWS Ops Agent decides whether a change is needed now. If it is, the agent creates a mitigation plan. The plan lists the changes that mitigate the incident, grouped into stages. Each stage contains changes, pre-validation checks that confirm your environment is ready for the changes, and verification checks that confirm the changes had the intended effect. The plan also has goals that tell you when the incident is mitigated.

You review the plan on the Mitigation plan tab of the investigation. Optionally, you can ask the agent to run the plan in chat in the Ops Agent web app. The agent runs one stage at a time and asks for your approval before each stage. In each stage, the agent runs the pre-validation and verification checks. If you turned on directed actions for the Agent Space, the agent also makes the AWS changes that it supports and that your elevated role allows. The agent marks every other change as a manual step that you make yourself. When the last stage runs its verification checks, the agent checks whether the plan's goals are met. For more information, see Working with directed actions.

How AWS Ops Agent creates mitigation plans

When an investigation establishes the root cause, AWS Ops Agent starts building the mitigation plan in the background. The plan can appear after the investigation completes. When the plan is ready, the Mitigation plan tab appears on the investigation.

If no change is needed now, for example because the incident already recovered or the change was deliberate, the tab explains why instead of showing stages. It can include an Agent-ready spec for the long-term fix.

For some incidents, the tab first shows a preliminary plan. When the investigation finds the first cause that it can act on, the agent writes a short text plan. This plan is labeled Preliminary, and you can't run it. While the agent builds the final plan, the tab shows Final plan in progress. The final plan replaces the preliminary plan when it's ready. Only the final plan can be run. To see the preliminary plan again, choose it in the Plan list.

Before you see a plan, AWS Ops Agent verifies that it meets the following rules:

  • Each pre-validation check and verification check only reads data.

  • Each change has a rollback step, or a reason why it can't be undone.

  • Each change that the agent can't make automatically is marked as a manual step.

For more information about which changes the agent can make, see Which changes the agent can make.

Each investigation has one final mitigation plan. You can't edit the plan's stages or steps.

If the investigation completes and the Mitigation plan tab doesn't appear, choose Generate mitigation plan on the Root cause tab. Generating a plan can take a few minutes. To stop it, choose Cancel.

You can generate a mitigation plan only for an investigation that completed. A linked investigation doesn't have its own plan. It uses the plan of its primary investigation. To see that plan, open the linked investigation, and then choose View investigation. For more information about linked investigations, see Viewing triage decisions.

Parts of a mitigation plan

The Mitigation plan tab shows the following parts, from top to bottom:

  1. Plan title – The name of the plan and the times that the plan started and ended.

  2. At a glance – The root cause that the plan mitigates and a summary of what the plan does. To open the full analysis of the root cause, choose See root cause.

  3. Goals – The conditions that tell you the incident is mitigated. The plan is done when all goals are met. Each goal shows Met, Not met, or Not checked yet. The agent checks the goals when it runs the verification checks. If a goal isn't met yet, the agent waits and checks again for up to 30 minutes, and then asks you what to do. When the plan includes metric charts, each chart shows On target or Off target. A chart that compares a metric with its value when the run started shows Not started until you run the plan.

  4. Stages – The stages of the plan, in the order that they run.

  5. Next steps – Long-term changes to make after the incident is resolved, when the plan includes them.

Stages

For each stage, you can view its number, a description, and its status. Expand a stage to see its steps, grouped into the following phases:

Phase What it does
Pre-validation Checks that your resources are in an expected state before any change.
Apply Makes the changes.
Verification Checks that the changes had the effect you expected.
Rollback Lists the step that undoes each change. You need to run each rollback step manually.

Expand a step to see the tool and parameters that it uses, and its result after it runs. A check also lists the conditions that it must meet to pass.

In the Apply phase, a change that the agent can't make automatically is marked as a manual step. The step shows the message "The agent can't run this:" and the reason. For an AWS change, the step also shows the AWS CLI command to run and the account to run it in. To copy the command, choose the copy icon.

A change that can't be undone shows the message "Can't be rolled back:" and the reason.

Next steps

Some plans include an Agent-ready spec. It describes the long-term changes to make in your source code and infrastructure definitions after the incident is resolved. To copy it, choose Copy spec. You can then give the spec to your coding agent to create the code changes and a pull request.

Which changes the agent can make

The agent can make only supported AWS changes that your elevated role allows. Any other change in the plan is marked as a manual step that you make yourself. A plan's checks can read AWS, and your connected Datadog, Grafana, New Relic, and Dynatrace integrations. Tools from MCP servers that you add yourself can't be part of a plan.

Changes that the agent makes

The agent makes only AWS operations that are in the list of supported actions, such as starting or stopping an Amazon EC2 instance, or updating the capacity of an Amazon DynamoDB table. The agent makes these changes after you approve the stage. To see the list of supported actions, open the Configuration page in the AWS Ops Agent console. Then choose View Supported Actions in the Agent Actions section.

Changes that you make yourself

Change Example
An AWS operation that isn't in the list of supported actions Change an Amazon S3 bucket policy, or change an IAM resource
Any AWS operation, when directed actions are turned off for the Agent Space Any change in the plan
Any AWS operation, when the Agent Space gets its AWS accounts from AWS Organizations Any change in the plan
A change in a connected third-party system Roll back a deployment in GitHub or GitLab, or change an alert rule in Datadog or Grafana

Each of these changes is a manual step. The plan shows the reason that the agent can't make the change. For an AWS operation, it also shows the AWS Command Line Interface (AWS CLI) command to run. For a change in a third-party system, the plan can show that system's command, or it tells you to make the change in that system. Some AWS operations are never made by the agent, even when your elevated role allows them. For the list, see Operations the agent will not perform.

For more information, see the following topics: