DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • AWS Bedrock vs Vertex AI vs Azure Foundry: Stop Comparing Benchmarks, Start Asking This Instead
  • Coordinating AI Agents With AWS SQS: A Practical Queue-Based Architecture
  • Compliance Automated Standard Solution (COMPASS), Part 11: Compliance as Code, the OSCAL MCP Server Way
  • The Agent Protocol Stack: MCP vs. A2A vs. AG-UI

Trending

  • Prompt Caching: Overriding Tokenization for Faster and More Cost-Effective AI
  • Building Multi-Rail Payment Failover to Stop Latency Spikes and Double Debits
  • Building Enterprise Authentication With Angular, Spring Boot, SSO, and MFA
  • Designing for Hot Keys: When Distributed Systems Stop Distributing

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Should an AI Agent Have Write Access to Your AWS Account?

Should an AI Agent Have Write Access to Your AWS Account?

AI agents can have AWS write access, but only with least privilege, specialized roles, and human approval for high-risk actions.

By 
Artur Yolchyan
·
Nov. 27, 26 · Analysis
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
2 Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

The thought of granting AI agent permissions to work on your AWS setup might seem scary and dangerous to some and very alluring to others. Traditionally, scripts or predefined sets of actions were used in specific scenarios. Now AI has “reasoning”; whether good or bad, its scope of action might go way beyond scripted limits. It is called AI blast: the number of decisions the agent can make before someone stops it. 

What Can Go Wrong?

There are several things that can go wrong. Let's take a look at some of the critical things that can go wrong.

Misdiagnosing the Problem

The agent sees CPU utilization at 95% and decides to increase the instance size. But the real problem is a memory leak. The change may temporarily reduce the symptoms while increasing cost and leaving the underlying failure untouched.

Cascading Changes

One seemingly harmless change can trigger a chain reaction. An agent modifies a security group, which affects connectivity, which causes a deployment to fail, which then triggers another automated remediation. Each action may look reasonable, but the combined result is anything but. 

Wrong Cleanup of Volumes 

The agent identifies old EBS volumes, snapshots, or other resources as unused and deletes them. It cannot easily know that a volume may be intentionally detached, required for disaster recovery, or part of an undocumented operational procedure.

Security Regression 

An agent trying to restore availability might weaken a security control to make a service work, for example, opening a port, broadening an IAM policy, or changing a network rule. The immediate incident gets resolved, but the environment is left in a less secure state.

Prompt Injection

One of the biggest threats for agentic systems. It’s the attack where malicious content in the agent’s environment, a document the agent is asked to process, a webpage it visits, or a tool result it receives, contains text designed to override the agent’s instructions and cause it to take unauthorized actions. In the context of identity and access management, the most dangerous variant targets credentials: a malicious prompt instructs the agent to exfiltrate credentials available in its execution environment.

Let's consider a scenario where an agent notices an EC2 instance running at 95% CPU. It decides to scale the instance, modifies an Auto Scaling policy, changes a security group, and deletes an “unused” EBS volume. Some of these actions are reasonable except one. Deleting an EBS volume that is considered “unused” might cause an outage if the volume is actually attached or required by the instance or other services. Sometimes volumes appear unused but are critical for data or system operation. 

Now, a reasonable question: why would an agent that only needs to scale EC2 need permission to drop EBS? So, based on this, one might conclude that granting agents least-privilege access is the correct choice. What does least-privilege access mean for agents? 

Impersonation vs. Delegation

First, let's distinguish between two ways agents can work in your setup. First is impersonation; in this case, the agent performs tasks on the user's behalf, presenting itself as the user. Well, this is also an option, but not the right choice. Maintaining clear attribution and continuously monitoring activity is particularly important in environments subject to frameworks such as SOC 2. Auditing will fail; logs won’t allow us to figure out which actions were performed by the user and which by the agent. In this case, it would be impossible to tailor permissions at the agent level. The other option is delegation, and it is best practice because, in this case, we can give agents a scope of permissions beyond which they won’t act.

Now, how do we decide on the right scope of permissions for agents? All permissions need to be carefully classified. Having one agent in your setup with a full assistant role won’t be the right choice. It would require giving all permissions at once, which contradicts the least-privilege principle. At this stage, agents need to be subdivided into sub-agents.

Some agents need to read only; others diagnose and recommend. Other agents need to restart instances; some create or delete resources; some change policies or modify networking; some can execute (and here we need to be careful; there is a difference between prod and dev environments); and, most importantly, choose which agents can delete resources and modify policies. Each permission is tailored to perform the exact task the agent must complete.

On top of these small, specialized agents sits the orchestration agent, which controls the workflow for the user. It will not have permissions exceeding the user's permissions and additional limitations based on its role and workflows.

The orchestrator role needs permission to run Lambda functions, start Step Functions, manage workflow data in DynamoDB, and send approval messages through SNS. It does not need permissions for EKS, ECR, or AWS CloudFormation; those are for the deployment agent’s role. The deployment agent needs permissions for EKS and ECR but doesn’t need the wide Lambda permissions that the orchestrator requires.

On top of this will be users who will act as the base and initiators of all the models. In a mature system, users will also be involved in the agentic system workflow, not step aside and leave all the work for agents. When agent changes are low risk, they might auto-execute. When risks are higher, you might need to add user approval before execution.

Approval gates

Approval gates

Final Thoughts

Overall, the answer is not to deny agents from taking actions, but to ensure every action is within the right scope of permissions. The ultimate question is how many permissions should be granted to agentic systems and under what conditions. Delegation, least privilege, task-specific permissions, and human approval gates are the right way to achieve systems that will not damage your AWS environment. The more tasks we delegate to AI agents, the more carefully we should design the boundaries within which they need to operate. 

AI AWS

Opinions expressed by DZone contributors are their own.

Related

  • AWS Bedrock vs Vertex AI vs Azure Foundry: Stop Comparing Benchmarks, Start Asking This Instead
  • Coordinating AI Agents With AWS SQS: A Practical Queue-Based Architecture
  • Compliance Automated Standard Solution (COMPASS), Part 11: Compliance as Code, the OSCAL MCP Server Way
  • The Agent Protocol Stack: MCP vs. A2A vs. AG-UI

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook