AWS and Cloudanix team co-authored this blog: Real-Time Threat and Anomaly Detection for Workloads on AWS

Cloudanix – Your Partner in Cloud Security Excellence

How to Secure Autonomous AI Agents: Identity, Sandboxing, and Tool-Call Logging

  • Purusottam Mupunu Purusottam Mupunu
  • Monday, Nov 23, 2026

Securing a GenAI feature that answers prompts is one thing. Evaluating an autonomous agent that can plan and take actions on its own, before anyone trusts it, is another.

On a recent episode of Scale To Zero, I asked Dhivya Chandramouleeswaran how her assessment changes when the system can act, not just answer. Dhivya is an engineering manager at AWS, where she leads defensive and offensive engineers who secure AI products, and an AI safety research fellow at Heron AI Security. Her answer starts with a reassuring idea: the fundamentals still hold.

Autonomous Is Not Unbounded

“The autonomous agent, it’s not completely unbounded. It’s going to have a finite set of capabilities and it’s going to have a finite set of access to tools, a finite set of access to assets and context.”

That matters because it turns an open-ended worry into a list you can work through. The catch is time. Mapping everything an agent could do takes a long time, and most teams are on a compressed timeline.

So Dhivya works backwards. What is the most powerful capability here? If it is not guardrailed properly, what is the impact? Which of your most important assets does the agent touch, and do you have traces for what it does with them?

A Worked Example: The Home Assistant

Dhivya used an example most of us can picture. A personal AI assistant is often hooked into your email, your calendar, note tools like Notion or Obsidian, anything that gives it context about who you are. Some people even connect a brokerage account. That is a lot of personal and financial data behind one agent, and to the person securing it, the assistant itself is largely a black box.

Her core tenet for that system:

  • Data access stays between you and the agent.
  • The agent must not act as a “confused deputy,” which is when a trusted program with legitimate access gets tricked into using that access on someone else’s behalf.

From there, she builds security in three layers.

Layer 1: Identity and Permissions, Before It Runs

The first layer is the part you can predict before the agent goes live.

Give the Agent a Clear Identity

Dhivya starts with: what is my agent’s identity, and what policies and permissions are attached to that particular agent version or instance? Without a distinct identity, you cannot apply or audit policies for it. Our posts on why AI coding agents become an identity and credential risk and governing non-human identities with JIT go deeper on this.

Ask What It Does With the Data

Is it sharing the data with someone else? Storing it somewhere else? Modifying it? If the agent has write access, it can write back, and as Dhivya put it, “I don’t want my bank balance to be suddenly zero.”

Defang the Permissions

“Can I defang it? Is a star permission absolutely necessary?”

A “star” or wildcard permission grants every action on a resource. Removing those, and granting only what the agent’s job requires, is the cheapest risk reduction you have. The AWS Bedrock AgentCore flaw shows how far one over-broad agent role can reach, and 24,000 secrets found in MCP config files shows why standing credentials are a poor fit for agents.

Layer 2: Runtime Containment

The second layer is about how the agent behaves while it runs. Here Dhivya pointed to sandboxing, network controls, and other layered controls. She noted an AI component might even sit in firmware and act on a different port entirely, so you have to look at what can go in and what can go out.

For data exfiltration in particular, which means data leaving your control without authorization, she asks what at runtime is stopping the agent from reaching out, and what is stopping anything harmful from coming in. In her words, this is putting the agent “in a hard shell case during runtime.” An exposed agent server with reachable cloud credentials is the failure case, as in Greeter: how an abandoned AI agent server becomes a door to your cloud credentials.

Layer 3: Auditability and Observability

The third layer assumes the first two can fail.

“We have seen agents escape. I think every day we are seeing on Twitter there is a new escape happening.”

When that happens, you need to trace back. Dhivya wants to know “every tool call that an agent made, every action that an agent took, all the resources that it was interacting with.” A tool call is any time the agent invokes an external function, API, or connector. Logging those at a granular level is what makes incident response possible.

“That makes up the whole sandwich.”

The goal is not perfection. As Dhivya said, you may not have completely defanged the agent, “but we have managed to secure what is important enough to secure.” Something like lateral movement may fall lower in priority, as long as the agent cannot escape containment.

Testing the Behavior You Can’t Predict

Next I asked how teams make room to test agent behavior that is hard to predict in a release cycle.

Automate the Predictable Checks

Dhivya separated two kinds of testing. Permissions, IAM policies, log collection, resource access, and even MCP tool calls are predictable. You can cover them with API testing and existing tools.

Spend Human Time on Exploratory Testing

The harder part is exploratory testing, and that is where she still values human creativity. Agents can enumerate exploit paths, but humans are good at the “wonky thinking” of chaining a medium-severity issue A with a medium-severity issue B into a high or critical one.

Set a Budget and a Bar

How much exploratory testing is enough depends on your time, your resources, and, as Dhivya added, your token budget. She gave an illustration: a team might run exploratory testing for five days and cover 20 to 30 creative test cases, drawing on recent attacks and published exploit payloads, then call it sufficient within budget.

Balance Security and Usability

“If you provide a completely secure autonomous agent, customers can’t use it.”

So you prioritize: protect the assets, let the agent “run loose a little bit,” and keep the guardrails. And testing does not stop at launch. Dhivya noted that many organizations run continuous security testing after a product ships.

Quick Reference: Securing an Autonomous Agent

  • List its capabilities, tools, assets, and context. Autonomous does not mean unbounded.
  • Work backwards from your most important assets. Start with the most powerful capability that touches them.
  • Give each agent version or instance its own identity. Attach policies and permissions to it.
  • Remove wildcard permissions. Grant only what the task needs, and scrutinize write access.
  • Contain it at runtime. Sandbox it and control network traffic in and out, with exfiltration in mind.
  • Log every tool call, action, and resource touched. Assume escape is possible and plan to trace back.
  • Automate predictable checks; reserve humans for exploratory testing. Look for chained issues.
  • Keep testing after launch.

Our addition: the OWASP GenAI Security Project’s entry on Excessive Agency is a useful companion read. It describes the same root problem, an LLM-based system with more functionality, permissions, or autonomy than it needs.

Closing Takeaway

You will rarely make an autonomous agent perfectly safe. Dhivya’s three layers, identity up front, containment at runtime, and logging underneath, let you secure what matters most and still trace what happened when something slips.

Much of this comes down to identity and least privilege, which is an area we think about a lot at Cloudanix.

Listen to the Full Episode

This post covers one segment of my conversation with Dhivya. We also discussed guardrails for coding agents, when to keep a human in the loop, threat modeling AI systems, and purple teaming with AI agents.

Give it a listen, and share it with whoever on your team is wiring agents into production.

People Also Read

What Our Users Are Saying

Customer Reviews

Cloudanix is trusted by security leaders worldwide to deliver proactive, reliable, and cutting-edge cloud security.

One day, I changed the password of a root account, and my CTO called me within less than a minute to confirm if I did so. I was not expecting a reaction this quick. He told me Cloudanix alerted him of this password change and that he wanted to confirm as it was a critical security notification. I couldn't believe it!

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Compliance is one way of staying secure, but what I want is the ability to go deeper and attain 'true security.' Cloudanix provides us the capability to do so.

Vishal Madan
Vishal Madan
Head of Engineering, iMocha

Cloudanix is building for the future of the cloud, which makes the product all the more desirable.

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Cloudanix gave us the visibility we were missing. Being able to move from permanent access to a robust Just-In-Time (JIT) workflow has fundamentally changed our security posture without slowing down our engineering velocity.

Pavan Kumar Lekkala
Pavan Kumar Lekkala
SRE Lead, HugoHub

We are excited to leverage Cloudanix's comprehensive multi-cloud DevSecOps solution to secure our production workloads on AWS. Cloudanix has demonstrated that it can solve many challenges that DevSecOps teams face while continually adding new features such as SOC2 compliance and drift detection.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Managing third-party partner access was once a major concern for our security posture. With Cloudanix JIT Cloud, we've effectively achieved zero third-party risk. We can now grant access confidently, knowing that it is temporary, audited, and automatically revoked, resulting in a 100% reduction in our privileged access exposure.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

The snooze feature and responsible alerts have helped us save time and prioritize what to tackle first.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Implementing Cloudanix JIT internally allowed us to practice what we preach. By eliminating permanent access to our own clouds and databases, we've neutralized the risk of standing privileges, ensuring our own 'keys to the kingdom' are never left exposed.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

The problem with permissions is a lot of times, the gaps are left open due to oversights from inside the organization itself. With Cloudanix's CIEM, we get a complete view of user permissions and access. This enables us to update the permissions, reducing the attack surface.

Nilesh Pethani
Nilesh Pethani
Application Architect, iMocha

In the world of Fintech, trust is our currency. Cloudanix provided the frictionless visibility we needed to secure our EKS workloads across AWS, ensuring we stay audit-ready for SOC2 and GDPR without slowing down our engineering velocity.

Amol Naik
Amol Naik
Head of Security & Infrastructure, HugoHub

Cloudanix delivered value within 5 minutes of onboarding. Continuous monitoring, timely detection, and excellent documentation helped us attain a great cloud security posture.

Divyanshu Shukla
Senior DevSecOps, Meesho

Technology strategies and business strategies are in a state of constant change which includes centralization and decentralization of responsibilities. Regardless of strategic shift, we still have intellectual property to protect. Cloudanix are critical partners for us in our public cloud security posture across our three cloud providers.

Jerry Locke
Jerry Locke
Senior Director Global Solutions Engineering, Eversana

Cloudanix has been amazing. They opened up a common Slack channel with us — and it feels like we are talking to our own team and getting things done with Cloud security. The support team is always available, friendly, helpful, and ready to go out of their way.

Satish Mohan
Satish Mohan
CTO, Airgap Networks

Beyond just access management, Cloudanix CSPM has given us a unified view of our AWS environment. The real-time alerting and anomaly detection allow us to prevent any untoward activity before it happens, which is critical for a marketplace connecting 50+ financial institutions.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

For a Fintech company, data is our most valuable — and most sensitive — asset. Cloudanix DAM hasn't just improved our visibility; it has given us control. The ability to mask data and prevent unauthorized queries in real-time is a game-changer for our compliance and customer trust.

Jiten Gala
Jiten Gala
President Engineering and Product, Kapittx

Our clients, especially in the Middle East financial sector, demand absolute accountability. Cloudanix JIT Cloud has been a competitive differentiator for us, allowing us to provide secure, governed access to customer accounts that meet their strictest audit and compliance requirements.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

Cloudanix is always on my team's lips because of its exceptional support. Be it a small or big query, Cloudanix has gone above and beyond to resolve them. This one's a keeper for us.

Sujit Karpe
Sujit Karpe
CTO, iMocha

For a long-lasting partnership, great support goes a long way. Cloudanix has delivered exceptional support whenever required. Their edge is their team is always ready to go beyond to solve any issues that we have. This speaks volumes about the culture at Cloudanix.

Akash Maheshwari
Akash Maheshwari
Co-founder, MoveInSync

Beyond the technology, Cloudanix feels like an extension of our own team. Their willingness to stand up a dedicated Middle East tenant for us and provide exceptional support at a sensible price makes them a long-term partner for Hugosave.

Surya Tamada
Surya Tamada
CTO, HugoHub

The real-time notifications that Cloudanix provides are a real lifesaver. Their adaptive notifications ensure that my team stays productive and doesn't get interrupted all the time.

Digvijay Singh
Staff Security Engineer, Meesho

The whole point in technological evolution is to help improve the world we live in. We must protect that and to do so requires an effective and efficient security strategy. The Cloudanix team helped make our public cloud security posture management strategy a reality. The symbiotic relationship we have allows for a continuous feedback loop which is how business should operate.

Larry Wheat
Larry Wheat
Staff Solutions Engineer, Eversana

Ready to see your graph?

Connect a cloud account in under 30 minutes. See every finding rooted in identity, asset, and blast radius — with a fix path attached.

Book a Demo