AWS Builder Center
Zero Trust for AI Agents: Securing Identity, Permissions, and Tool Access on AWS

Zero Trust for AI Agents: Securing Identity, Permissions, and Tool Access on AWS

As AI agents interact with enterprise applications, files, APIs, and cloud services, traditional application-level permissions may expose more data than an agent requires. Learn how Zero Trust principles, least-privilege IAM policies, controlled tool execution, and security monitoring can help organizations adopt AI agents more safely.

System Integrator
AI agents are evolving beyond conversational assistants. They can invoke tools, query databases, execute workflows, access files, and interact with enterprise applications. These capabilities create opportunities for automation, but they also introduce new security challenges.
An agent may have permission to perform a legitimate task while accessing information or executing actions outside the intended scope. For example, an AI agent asked to summarize a spreadsheet should not automatically gain unrestricted access to every file that the spreadsheet application can open.
This is where Zero Trust for AI agents becomes important.
Zero Trust is based on the principle of explicitly verifying access, enforcing least privilege, and continuously evaluating risk. When applied to AI agents, these principles should govern not only which agent is permitted to operate, but also which resources it can access, which tools it can invoke, and which actions it can perform.

1. Why AI Agents Need a Different Security Approach

Traditional application security often focuses on users, applications, network boundaries, and service identities. AI agents introduce an additional layer: software that can dynamically select tools and initiate actions based on instructions and context.
Consider this scenario:
An employee asks an AI agent to analyze a financial spreadsheet. The agent uses an approved desktop application to process the file. However, that application may also be able to access confidential reports, customer records, or other documents.
Allowing the application to run does not mean every action initiated through it should be authorized.
Security teams must distinguish between:
  • The permissions assigned to the employee.
  • The permissions available to the application.
  • The permissions granted to the AI agent.
  • The specific action and resource involved in each request.
The objective is to prevent an AI agent from inheriting excessive access merely because it operates through a trusted application or service.

2. Apply Zero Trust Principles to AI Agents

Identity and accountability

Assign each agent or workload a distinct, attributable identity where the platform supports it. Avoid shared credentials and unnecessary long-lived secrets.
On AWS, IAM roles and temporary credentials can help establish controlled access for agent workloads. The design should preserve attribution between the initiating user, the agent, the tool, and the resulting action.

Least-privilege access

Grant only the permissions required for a specific task.
For example, an agent that summarizes approved documents may need read access to a designated Amazon S3 prefix, but not permission to enumerate every bucket, retrieve unrelated files, or delete data.
IAM policies, resource policies, permission boundaries, and other applicable controls should be designed around the workload's actual requirements.

Independent policy enforcement

Do not rely solely on an AI model's instructions to prevent unauthorized behavior.
System prompts and guardrails can guide model behavior, but they are not substitutes for authorization controls. Enforce permissions through trusted execution layers, APIs, identity providers, operating-system controls, and resource policies.
Where multiple applications or tools are involved, ensure the authorization decision remains effective across those execution paths. An agent's restrictions must not disappear simply because it changes tools.

Continuous monitoring and validation

Record relevant security events, investigate unusual access patterns, and verify that controls remain effective as agents and workflows change.
Monitoring should cover both successful and denied actions, especially when an agent accesses sensitive resources or invokes tools with significant privileges.

3. AWS Architecture for Controlled AI Agent Access

A practical architecture can combine several AWS services, with each component serving a distinct security purpose.
Amazon Bedrock
Provides access to foundation models and supports the development of generative AI applications and agents. Model access and agent behavior should be governed by appropriate application and identity controls.
AWS IAM
Controls access to AWS services and resources. Use narrowly scoped permissions and temporary credentials where appropriate. Do not assume that IAM alone controls every action performed inside a desktop application or external SaaS platform.
AWS Lambda
Can provide a controlled execution layer for agent tools. Validate inputs, verify authorization, enforce business rules, and restrict each function to the permissions it requires.
Amazon API Gateway
Can expose approved APIs with authentication, authorization, request validation, and other appropriate controls.
AWS Step Functions
Can orchestrate multi-step workflows. Use explicit state transitions and authorization checks for sensitive operations, such as payments, record deletion, or changes to production systems.
Amazon CloudTrail and Amazon CloudWatch
CloudTrail records supported AWS API activity, while CloudWatch supports logs, metrics, and monitoring. Together, they can help security teams investigate activity across the AWS environment. Application-level logging is also needed for agent decisions, tool calls, user context, and business actions that AWS service logs may not capture.
The architecture should use these services according to the actual deployment requirements rather than assuming one service provides complete agent security.

4. Practical SOC Use Case: An AI Agent Attempts Unauthorized File Access

Imagine an AI agent is authorized to analyze files in an approved project folder. During execution, it attempts to retrieve a confidential file outside that folder.
A security investigation should establish what happened before reaching a conclusion.

Step 1: Detect

An access-denied event, an unusual API request, or an endpoint security alert identifies an attempt to access a restricted resource.

Step 2: Triage

Determine the affected identity, resource, timestamp, application, and potential business impact. Establish whether the request was blocked or whether data was successfully accessed.

Step 3: Investigate

Correlate available records, such as:
  • Application and agent tool-call logs.
  • IAM authorization events and relevant CloudTrail records.
  • API Gateway access logs.
  • Lambda execution logs.
  • Endpoint telemetry, if the agent operates on an endpoint.
  • Relevant identity-provider sign-in and audit events.
Confirm which records are available in the actual environment. Not every service captures the full context of an AI agent's activity.

Step 4: Hunt

Search for related attempts involving other resources, identities, tools, or endpoints. Examine whether the activity is isolated, repeated, or associated with additional suspicious behavior.

Step 5: Respond

If unauthorized activity is confirmed or presents sufficient risk, apply the organization's response procedures. Actions may include restricting the agent's permissions, disabling a tool integration, revoking credentials, or isolating an affected endpoint.

Step 6: Validate

Confirm that the restriction is enforced, investigate any successful access that occurred before the control took effect, and document the evidence, limitations, and remediation.
Important distinction: An access-denied event demonstrates that a request was rejected by a control. It does not, by itself, prove malicious intent or a successful compromise.

5. Threat Hunting Questions for AI Workloads

SOC analysts can develop focused hunting hypotheses around agent activity.
Examples include:
  • Are agents requesting resources outside their approved scope?
  • Are tool calls occurring under unexpected identities?
  • Are there repeated authorization failures followed by successful access?
  • Are agents invoking tools that are not approved for their assigned tasks?
  • Are sensitive actions occurring without the required human approval?
  • Are unusual data transfers or unexpected outbound connections associated with agent execution?
  • Are audit records sufficient to connect the initiating user, agent identity, tool call, and resulting action?
These hypotheses should be tested against collected telemetry. Unusual behavior is an investigative lead, not automatic proof of malicious activity.

6. Governance and Human Oversight

Technical enforcement must be supported by governance.
Organizations should define which AI agents are approved, which data classifications they may access, what actions they can perform, and when human approval is required.
High-impact operations should use explicit authorization and separation of duties where appropriate. Policies should also address retention, privacy, sensitive data handling, incident escalation, and periodic access reviews.
MSPs and security teams can help customers inventory AI use, assess integrations, define permissions, monitor activity, and validate controls before expanding adoption.

Conclusion

AI agents require more than trusted models and approved applications. They need enforceable identities, narrowly scoped permissions, controlled tool execution, and monitoring that supports investigation and accountability.
AWS services such as IAM, Lambda, API Gateway, Step Functions, CloudTrail, and CloudWatch can contribute to a defense-in-depth design when configured appropriately. Additional controls may be necessary for desktop agents, external SaaS applications, and actions that occur outside AWS.
The central principle is straightforward:
Authorize the identity. Restrict the action. Protect the resource. Verify the evidence.
Zero Trust for AI agents is not about assuming every agent is malicious. It is about ensuring that every meaningful action is permitted by policy, observable where feasible, and accountable to the appropriate identity.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article