I tried executing a mitigation plan using resource change operations (agent actions) in DevOps Agent

I tried executing a mitigation plan using resource change operations (agent actions) in DevOps Agent

DevOps Agent has finally gained the ability to make changes. Let's try out the newly added Directed Actions feature, from how to configure action roles to actually verifying its behavior.
2026.08.28

This page has been translated by machine translation. View original

Hello. This is Takayama.

I've been following the IAM permission updates for DevOps Agent, and all of them have been enhancements to read permissions.

That same DevOps Agent finally gained write permissions with the update dated August 25, 2026.

CleanShot_2026-08-26_23-19-10@2x.png
What's new - AWS DevOps Agent

The documentation is here.

https://docs.aws.amazon.com/devopsagent/latest/userguide/working-with-devops-agent-working-with-directed-actions.html

Blog posts have also been published internally about enabling agent actions and trying them out.

https://dev.classmethod.jp/articles/devops-agent-directed-actions/

In this blog post, I'd like to try executing a mitigation plan generated during incident response using agent actions.

Summary First

  • Enabling it requires 2 steps: registering an action role and enabling agent actions
  • The role's permissions are a ceiling, and at execution time it operates with a session policy scoped to only the approved operations
  • All write operations require operator approval each time they are executed
  • Operations outside the list of supported actions are not executed (in testing, authorize_security_group_ingress was unsupported and blocked)
  • In the NAT Gateway route fix scenario, I was able to confirm the complete flow from the approval process (approval request via the use_aws tool → Approve → execution) through to completion of the mitigation plan

Trying It Out

Granting an Action Role

When you open the DevOps Agent console, a new item called "Action role status" has been added.

By default, it is unconfigured.

CleanShot_2026-08-26_22-45-59@2x.png

Opening the edit screen with the Edit button reveals a new configuration item called "DevOps agent action role."

This time, I'll specify the DevOps Agent action role that is created on the DevOps Agent side.

CleanShot_2026-08-26_23-24-11@2x.png

Once creation is complete, the status becomes "Active."

CleanShot_2026-08-26_23-26-58@2x.png

Checking the created role, you can see a policy called AIDevOpsAgentActionsPolicy has been attached.

CleanShot_2026-08-26_23-28-15@2x.png

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AIDevOpsElevatedAccess",
            "Effect": "Allow",
            "NotAction": [
                "account:*",
                "cognito-identity:*",
                "iam:*",
                "identitystore:*",
                "organizations:*",
                "ram:*",
                "rolesanywhere:*",
                "sso:*",
                "sts:*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "AIDevOpsElevatedCarveBacks",
            "Effect": "Allow",
            "Action": [
                "account:GetAccountInformation",
                "account:GetGovCloudAccountInformation",
                "account:GetPrimaryEmail",
                "account:ListRegions",
                "iam:ListRoles",
                "organizations:DescribeEffectivePolicy",
                "organizations:DescribeOrganization",
                "sts:DecodeAuthorizationMessage"
            ],
            "Resource": "*"
        }
    ]
}

It simply excludes identity and credential management services via NotAction, while all other actions and resources are permitted.

Compared to the previous approach of carefully controlling read permissions with guardrails, this feels like a rather broad grant of permissions.

However, this does not mean the agent always operates with these permissions. The documentation describes the permissions of this role as a "ceiling."

The role's permission policy is customer-managed. Scope it to the actions you want the agent to be able to take. The role defines the ceiling of what the agent can ever do in your account. It is not a standing grant. Every directed action additionally requires operator approval at execution time, and the agent's session is further scoped to the specific approved operation.

https://docs.aws.amazon.com/devopsagent/latest/userguide/working-with-devops-agent-working-with-directed-actions.html#registering-an-elevated-role-for-an-aws-account

At actual execution time, temporary credentials are issued with a session policy scoped to only the approved operations and resources.

A session policy is a temporary policy passed at AssumeRole time, and it is evaluated in AND with the role's own permission policy.

Only what both allow becomes the effective permissions, so no matter how broad the role's permissions are, any operation not permitted by the session policy cannot be executed.
If you approve a security group rule change, that session can only execute that operation.

Furthermore, the agent cannot compose a session policy from just anything.
There is a list of supported actions managed by AWS, and actions not on that list will not be included in the session policy.

The elevated role's permission policy defines the ceiling of what AWS DevOps Agent can ever do in your account through directed actions. The agent never operates at this ceiling. Every directed action requires operator approval. The credentials issued for an approved action carry a session policy. The session policy scopes them down to the specific operation and resources that the operator approved. The agent composes the session policy only from a curated list of supported AWS IAM actions that AWS DevOps Agent maintains. An action outside that list can never be part of a session policy.

https://docs.aws.amazon.com/devopsagent/latest/userguide/working-with-devops-agent-working-with-directed-actions.html#granting-permissions-to-the-elevated-role

You can check the session policy from the AWS console.

CleanShot_2026-08-28_18-52-45@2x.png
CleanShot_2026-08-28_18-53-08@2x.png

If you want to narrow down permissions, you would write your own customer-managed policy rather than using a managed policy.
In that case, operations not permitted by the role will fail at execution time even if approved.

Note that while the ceiling of AIDevOpsAgentActionsPolicy includes delete-type actions, the agent's own guardrails will deny the following operations.
Even if the role's policy permits them and the operator approves them, they will not be executed.

Denied Operation Example Reason
Resource deletion Deleting instances, buckets, tables, functions, stacks Deletion should be performed by the operator themselves using their own credentials
Modifying permissions boundaries 4 actions including iam:PutRolePermissionsBoundary, iam:DeleteRolePermissionsBoundary Boundaries are controls that constrain the agent, so the agent itself should not be allowed to modify them
Operations involving iam:PassRole Launching EC2 with an instance profile, creating Lambda with an execution role Passing a role could indirectly expand the scope of execution via a service

Independent of the permissions you grant, the agent enforces its own guardrails on the AWS SDK operations it invokes as directed actions. These guardrails apply even when the elevated role's policy allows the operation. Operator approval does not override them.

https://docs.aws.amazon.com/devopsagent/latest/userguide/working-with-devops-agent-working-with-directed-actions.html#operations-the-agent-will-not-perform

When instructed to perform these operations, the agent will reportedly decline execution, explain the reason, and where possible, provide guidance on how to handle it manually.

Enabling Agent Actions

Next, enable agent actions from the "Settings" tab.

CleanShot_2026-08-27_10-23-41@2x.png

Review the following content, and if you have no concerns, select "Enable agent actions."

The agent can make changes in the connected accounts using the per-account roles you configure, and can run only the actions we support. Every change needs your approval.This setting takes effect only for accounts where you configure an Agent Actions role on the Capabilities tab.

CleanShot_2026-08-27_10-24-50@2x.png

When the agent actions toggle is turned on, enabling is complete.

CleanShot_2026-08-28_17-50-26@2x.png

In the next section, I'll try executing a mitigation plan using agent actions.

Executing a Mitigation Plan with Agent Actions

I'll use the following demo scenario for verification.

https://github.com/aws-samples/sample-automated-aws-devops-agent-network-incident-response

Following the demo scenario, I'll delete the inbound rule of the RDS security group to cause connection failures.

CleanShot_2026-08-26_23-58-59.png
CleanShot_2026-08-27_00-24-36.png
CleanShot_2026-08-27_00-33-29@2x.png
CleanShot_2026-08-27_00-23-15.png

When the investigation is complete, the following result is generated.
The content includes a mitigation plan.

CleanShot_2026-08-27_00-27-56@2x.png

Now, let me ask the chat to execute this mitigation plan.

However, the authorize_security_group_ingress action included in this mitigation plan was blocked because it is not supported by agent actions.

CleanShot_2026-08-28_18-41-32@2x.png

The authorize_security_group_ingress action is permitted by the "AIDevOpsAgentActionsPolicy" mentioned above, but it appears it is not supported by the agent session policy in practice.

Indeed, checking the targets of the session policy, it doesn't seem to be included.

CleanShot_2026-08-28_19-09-06@2x.png

So, let me run the other scenario: the NAT Gateway connectivity error.

CleanShot_2026-08-28_19-25-23@2x.png
CleanShot_2026-08-28_19-26-17@2x.png

When the investigation is complete here as well, the following result is generated.

CleanShot_2026-08-28_20-43-12@2x.png

This time, the CreateRoute action is included in the execution content, and you can confirm that it is included in the agent session policy.

CleanShot_2026-08-28_20-45-14@2x.png

Now, let me instruct the agent to execute the mitigation plan based on this content.

When instructed, a flow begins where the use_aws tool is used to request approval from the user.

CleanShot_2026-08-28_20-18-48@2x.png

Pressing the Approve button executes the mitigation plan, and it completed successfully.

CleanShot_2026-08-28_20-21-45@2x.png

You can also confirm in the console that the route has actually been added.

CleanShot_2026-08-28_20-23-19@2x.png

You can also confirm that the Application Status has been successfully restored.

CleanShot_2026-08-28_20-24-12@2x.png

Closing

This time, I enabled Directed Actions (agent actions) for DevOps Agent and tried having the agent execute a mitigation plan from a demo scenario.

In the security group scenario, authorize_security_group_ingress was blocked as it was outside the supported actions, but in the NAT Gateway route fix scenario, I was able to confirm the entire flow from the approval request via the use_aws tool, through Approve, and all the way to execution completion.

No matter how broad the role's permissions are, they are only a ceiling, and the design ensures that execution is scoped down by the session policy and operator approval. With support now added for write operations in addition to read permissions, there are likely to be more situations where DevOps Agent can handle everything end-to-end from investigation through to remediation.

That's all from Takayama (@nyan_kotaroo).

Share this article