Back to Blog

Security Architecture & Strategy

How to Secure AI Agents in the Cloud: The Architecture Controls Every Agentic Deployment Needs

No headings found on page

AI agents are already running in production with real cloud credentials. Engineering teams are shipping agents with AWS IAM roles, Azure managed identities, and GCP service accounts, and they're doing it fast because the business pressure to move is real.

The security conversation that usually follows focuses on the model: prompt injection, hallucinations, jailbreaks. Those risks are real, but they're not the ones that will take down a production database or expose regulated data to the internet. The risks that do that live at a different layer: the cloud itself.

This piece is about that layer. What architecture controls AI agents actually need, why application-level guardrails aren't enough on their own, and how to make the dangerous actions unavailable rather than just undesirable.

The Real Problem Isn't the Model

Most teams treat AI agent security as an AI problem, which is understandable given that the agent is the new thing. But in a cloud environment, an agent is just another identity with permissions. It calls APIs, reads and writes data, and can delete records if its IAM role allows it.

The PocketOS incident and the Cursor agent incident made this concrete. Neither was a model failure in the traditional sense. Both were permissions failures. The agents had access they shouldn't have had, and there was nothing at the cloud architecture layer to stop them from using it.

"An AI agent cannot delete production data." That's not a prompt instruction. It's a cloud architecture control. And it has to be enforced at the cloud layer, not stated in a system prompt.

A model that's been told not to delete data can still delete data if its IAM role allows it, because instruction and enforcement aren't the same thing.

Why Application-Level Guardrails Aren't Enough

Rate limits, output validation, content filters, and careful prompt design all reduce risk, and they're worth doing. But they sit above the cloud layer. If the agent's execution role has broad permissions, no application-level guardrail prevents those permissions from being used.

A system prompt that says "don't delete production databases" is advisory. An AWS SCP that removes delete permissions from the agent's account is architectural. One can be ignored or bypassed by a misbehaving pipeline. The other can't.

The answer is that you need both, but the one teams are most likely to skip is the architectural layer, because it requires cloud security expertise and coordination across teams. That's where the real exposure tends to live.

The Architecture Controls Every Agentic Deployment Needs

These aren't advanced practices or things to get to eventually. They're the baseline that should be in place before an AI agent touches production infrastructure.

1. Scope permissions to what the agent actually needs

Least privilege here means an enforced boundary, not just a design intention. If an agent handles read queries, it doesn't have delete permissions. If it deploys models, it stays within the scope of the model registry. Those limits are set in the agent's IAM role and enforced by the cloud, not stated in a prompt.

AWS SCPs, Azure Policy, and GCP Organization Policies let you enforce this at the account or project level. The agent can't exceed what the architecture allows, regardless of what the pipeline tells it to do.

2. Enforce data perimeters the agent can't cross

Define where regulated data lives and who can reach it, then enforce that boundary architecturally. "No path from the public internet to regulated data" applies to agents just as it applies to any other workload. The agent's execution context shouldn't have a route to PII or regulated records it doesn't need to process.

VPC service controls on GCP, AWS resource-based policies, and Azure network perimeters are the primitives. The guardrail defines the boundary. The cloud enforces it.

3. Make destructive actions require approval or be unavailable

"Backup deletion requires two-person approval." "An AI agent cannot delete production data." These need to be architecture controls, not guidelines. For high-consequence actions, the cloud should require conditions that an automated agent can't satisfy on its own, such as a separate approver identity or a time-bound access grant.

This is the distinction between unavailable and blocked. Blocked implies something to detect first. Unavailable means the action was never an option, regardless of who or what is trying to take it.

4. Isolate the agent's runtime from production where possible

Environment segmentation applies to AI agents the same way it applies to developers and services. An agent running in a staging or evaluation environment shouldn't be able to read production secrets, and if it can, the segmentation is in name only.

"Non-prod cannot read prod secrets" is an enforced boundary, not a naming convention. AWS Organizations, Azure Management Groups, and GCP folder structures let you put structural separation between environments. Use them for agent workloads.

5. Run agents under the same controls you'd run human operators

"Model deployments stay inside the same controls human deployments run under." If a developer can't delete a database without an approval workflow, the agent can't either. If a human needs time-bound access to run a sensitive operation, the agent's service account should too.

Agents are fast and automated, which means they can do more damage faster than a human who'd hesitate before confirming. That's an argument for stricter controls on agents, not more permissive ones.

MCP Servers Expand the Surface Area

Model Context Protocol (MCP) servers are changing what agents can reach. An MCP server connects an agent to an external tool, database, or cloud service. Each connection is a potential permissions boundary that may or may not be enforced.

Before you deploy a stack that includes MCP servers, map what each server can access. That means understanding the cloud permissions the MCP server runs under, what data it can read or write, and whether those boundaries are enforced at the cloud layer or just assumed based on the server's stated purpose.

The same architecture controls apply. Data perimeters, scoped permissions, and destructive-action restrictions all need to cover the MCP server's execution context, not just the agent's primary role.

How Cloud Architecture Guardrails Enforce This in Practice

Writing these controls individually into every agent deployment doesn't scale, and it creates drift. When the first deployment gets the controls and the second doesn't, coverage becomes a function of which team got around to it rather than a reliable security posture.

Cloud Architecture Guardrails define what AI agents are and aren't allowed to do in the cloud, once, and enforce that across every environment. The guardrail expresses the intent: an agent cannot delete production data. The cloud enforces it: the IAM role and SCPs in the production account make the action architecturally impossible.

Native enforces cloud security at the architecture layer, using the cloud's own primitives: AWS SCPs, Azure Policy, GCP Organization Policies, and OCI tenancy controls. An agent running in an environment with active guardrails can't exceed what the architecture allows, regardless of how the pipeline is configured or what the model is instructed to do.

"Certain actions should not trigger alerts. They should be unavailable." That's the shift from visibility to enforcement. For AI agents running with cloud credentials, it's not optional.

Frequently Asked Questions

What's the difference between AI agent security and AI safety?

AI safety focuses on model behavior: hallucination, bias, prompt injection, and output quality. AI agent security in the cloud focuses on what the agent can do with its cloud credentials. Both matter. They operate at different layers. Application-level safety controls and cloud architecture controls aren't alternatives. They're complements. One addresses the model. The other addresses the infrastructure it runs on.

What cloud controls do AI agents need before they touch production?

At minimum:

  • Scoped IAM permissions with no broad wildcard grants

  • A data perimeter preventing the agent from reaching regulated data outside its scope

  • Enforced restrictions on destructive actions like deletion and modification of production records or backups

  • Environment segmentation isolating the agent's runtime from production secrets

  • Logging and auditability on all cloud API calls the agent makes

Those five aren't the full picture of AI agent security, but they're where you have to start.

How do you prevent an AI agent from deleting cloud data?

Enforce it at the architecture layer. AWS SCPs can deny delete operations on specific resource types across an entire account, regardless of which identity makes the request. Azure Policy can do the same. The enforcement lives at the cloud layer, so the agent can't bypass it regardless of what the pipeline instructs.

The agent's IAM role shouldn't include delete permissions in production unless the agent's job explicitly requires it. If it does require it, that action should require conditions an automated system can't satisfy alone, such as a human approver.

Do CSPM and CNAPP platforms handle AI agent security?

Not at the enforcement layer. CSPM and CNAPP tools detect misconfigurations and generate findings. They don't enforce architecture boundaries. An agent with overpermissioned credentials may show up as a finding in a CSPM dashboard, but the CSPM doesn't prevent the agent from using those permissions while the finding sits in a ticket queue.

AI agent security requires enforcement: controls that make the dangerous action architecturally impossible rather than controls that surface it after the fact. That's a different layer from what CSPM and CNAPP tools operate at.

How do MCP servers affect cloud security for AI agents?

MCP servers expand what agents can reach. Each MCP connection introduces a new execution context with its own cloud permissions. Before deploying agents with MCP integrations, map what each server can access and ensure data perimeters, scoped permissions, and destructive-action restrictions apply to the MCP server's context, not just the agent's primary role. Treat each MCP server as a separate principal that needs its own security controls.

The Question Every Team Has Already Answered

The question isn't whether to deploy AI agents in the cloud. That decision's been made. Agents with cloud credentials are already in production at most organizations that are serious about AI.

The question is whether the architecture those agents run in enforces what they're allowed to do, or just assumes it. Assumptions don't hold under pressure. They don't hold when a pipeline misbehaves, when a model is prompted unexpectedly, or when an MCP server connects to something it shouldn't.

Cloud Architecture Guardrails turn built-in cloud controls into active, operational defenses. For AI agents, that means the dangerous actions aren't something you catch after the fact. They're removed from the possible outcomes entirely. That's the architecture every agentic deployment needs.



About Native Team

Native turns built-in cloud security controls into active, operational defenses across AWS, Azure, Google Cloud, and OCI.

The Future of Cloud Security is Native

© 2026 Native Security Ltd. All rights reserved.

The Future of Cloud Security is Native

© 2026 Native Security Ltd.
All rights reserved.

The Future of Cloud Security is Native

© 2026 Native Security Ltd. All rights reserved.