AI agents represent one of the most important shifts in modern application security. A traditional chatbot receives a request and generates a response. An AI agent can go further: it can retrieve information, select tools, call APIs, modify records, interact with files, trigger external services and continue executing multiple steps without requiring a new instruction from the user.
That additional capability creates additional risk.
The core security problem is not simply that an agent can make mistakes. The deeper problem is that an attacker may influence the agent’s reasoning and then use the agent’s existing permissions to reach systems, information or actions that the attacker could not access directly.
OWASP’s Agentic Security Initiative now treats autonomous and agentic AI as a dedicated security domain, and its Top 10 for Agentic Applications 2026 focuses specifically on risks affecting systems that can plan, act and make decisions across complex workflows. NIST has also made agent identity and authorization a specific area of work, highlighting questions around identification, authorization, auditing and control of AI agents.
For companies building AI-powered products, this creates a straightforward security requirement:
The agent should never have more authority than the task actually requires.
What Is AI Agent Security?
AI agent security is the practice of protecting autonomous or semi-autonomous AI systems from manipulation, excessive permissions, unauthorized actions, data exposure and unsafe interaction with connected tools.
The security boundary does not stop at the model.
A typical agent may include an LLM, application logic, memory, retrieval systems, an orchestration layer, multiple tools, APIs and external services. The agent may also maintain state across several actions rather than processing every request as an isolated event.
That architecture changes the threat model considerably.
With a normal web application, a user generally invokes a specific function directly. With an agent, the user may describe an objective and allow the system to decide which functions are required.
This means the agent becomes an intermediary between user intent and application capability.
Security therefore depends on whether that intermediary remains constrained.
Why AI Agents Create a Larger Attack Surface
An ordinary LLM application may expose information through its responses, but an agent can potentially convert a manipulated response into an action.
Consider an internal AI assistant that can read company documents. Its main confidentiality risk is unauthorized information retrieval.
Now add the ability to send emails.
The same system can potentially disclose information externally.
Add access to CRM records, cloud administration, ticketing systems or financial APIs and the security implications expand again.
The model itself may not have changed.
The attack surface changed because the capabilities surrounding the model changed.
Anthropic describes this fundamental tension in its work on trustworthy agents: useful agents need enough autonomy to accomplish tasks, while secure systems still need humans to retain meaningful control over what those agents can do.
That balance between capability and control sits at the center of agent security.
From Chatbot to Autonomous Application
The easiest way to understand AI agent risk is to stop thinking about the system as a chatbot.
A modern agent behaves more like a software operator.
It may receive a high-level objective such as reviewing customer requests, collecting information, preparing an answer and updating a business system. To complete that task, the agent may decide which data to retrieve and which tools to use.
That creates several points where security can fail.
The agent may misunderstand the user’s intention.
Untrusted external content may influence the agent.
The model may select the wrong tool.
The tool may have excessive permissions.
A backend may trust the agent instead of checking the original user.
The agent may perform several individually valid actions that together create an unsafe result.
The important point is that agent security is a workflow problem.
Looking only at individual prompts or individual APIs can miss the attack path that connects them.
The Main Security Boundaries of an AI Agent
A secure agent architecture depends on several boundaries working together.
Some belong to traditional application security. Others become more important because an AI system is now making decisions between them.
User Identity
The agent needs to know who initiated the task.
This sounds basic, but identity often becomes blurred once requests move through several AI components.
A user authenticates to the application. The application sends instructions to an agent. The agent calls a backend tool using a shared service credential.
At that point, the downstream system may no longer know whether the original request came from an administrator, an ordinary employee or an external customer.
If the backend simply trusts the agent’s service identity, the AI layer may accidentally become a privilege-escalation mechanism.
NIST’s 2026 work on AI agent identity and authorization specifically highlights identification, authorization and auditing as central questions for secure agent adoption.
The security architecture should therefore preserve the relationship between the agent’s action and the user or process on whose behalf the action is being performed.
Agent Context
An AI agent makes decisions based on context.
That context may include the user’s request, system instructions, conversation history, retrieved files, emails, webpages, database records and tool responses.
Not all of those sources deserve the same level of trust.
An internal developer instruction may be trusted.
A public webpage should not be.
A customer-uploaded document should not be treated as equivalent to application policy.
An external tool response may contain attacker-controlled text.
This matters because natural-language content can influence model reasoning even when the surrounding application considers that content to be passive data.
OWASP’s agentic threat guidance explicitly treats the expansion of autonomous systems and their interaction with broader environments as a new security surface requiring threat-model-based controls.
Tool Permissions
Tools determine what the agent can actually do.
An agent with no tools can generate content.
An agent with read-only tools can inspect information.
An agent with write access can change application state.
An agent with administrative tools can change the security posture of the environment itself.
This creates one of the most important rules in AI agent security:
Tool permission should be designed according to impact, not convenience.
Anthropic has described granular tool permissions as a way to reduce the blast radius of agent compromise, noting the significant difference between read-only access and tools capable of modifying production systems.
That is traditional least privilege applied to AI.
It remains one of the strongest defenses available.
Action Validation
The final boundary exists between the agent requesting an action and the application actually performing it.
This is where many agent architectures become unsafe.
Developers may assume that because the AI application decided to perform an operation, that operation must be legitimate.
But model reasoning is not authorization.
If the agent requests access to a customer record, the backend should still verify whether the original user is permitted to access it.
If the agent tries to change an account, the same access controls that apply to a normal application request should remain active.
If the agent requests a dangerous tool operation, the application should evaluate that operation before execution.
The model can decide what it wants to do.
The security architecture decides what it is allowed to do.
How Attackers Can Manipulate Agent Behavior
AI agents introduce several pathways through which attacker-controlled information may alter application behavior.
The most obvious is direct instruction manipulation.
A malicious user interacts with the agent and attempts to influence it toward an unintended objective.
More complex scenarios involve indirect influence.
An agent may be instructed to review a document, browse a website, read an email or retrieve a knowledge-base entry. Adversarial content inside those resources can potentially affect subsequent model reasoning.
This creates an important difference between AI agents and conventional software.
The user who initiates an AI workflow is not necessarily the only person capable of influencing it.
Anyone who controls information the agent later consumes may become part of the threat model.
Anthropic’s security work has highlighted this problem specifically in relation to external content reaching agent context through MCP servers, plugins, web search and other connectors.
For security teams, the practical implication is clear.
External content should be treated as untrusted input, even when it arrives through a legitimate integration.
Why Excessive Agent Permissions Are Dangerous
A prompt injection vulnerability does not determine its own severity.
Permissions do.
Imagine two agents exposed to the same manipulation.
The first can search a public documentation database.
The second can modify production records.
The initial model weakness may look similar, but the potential impact is completely different.
This is why agent security should begin with authority rather than with prompts.
The security team should understand every meaningful capability available to the agent.
Does it only read data?
Can it write?
Can it delete?
Can it send external communications?
Can it create users?
Can it change permissions?
Can it execute code?
Can it trigger transactions?
Can it access production infrastructure?
Every added capability expands the consequences of model manipulation.
The safest design is therefore not to give the agent everything it might theoretically need. It is to give the agent the smallest capability set required for the defined workflow.
Designing Least-Privilege AI Agents
Least privilege is a mature cybersecurity concept, but agentic AI makes it unusually important.
Traditional applications generally expose functions developers explicitly connect to user actions.
Agents can choose capabilities dynamically.
If an agent has access to fifteen tools but requires only three for the current task, the remaining twelve still contribute to the attack surface.
A better architecture narrows capability according to context.
A document-analysis agent may receive read-only document access.
A customer-support agent may receive access only to records belonging to the active customer account.
A financial assistant may be permitted to retrieve transaction information while requiring human approval before initiating any operation that moves funds.
This model makes security independent of the agent’s ability to make perfect decisions.
Even if the model is manipulated, the available capabilities remain limited.
Anthropic’s current implementation guidance illustrates this idea with configurable permission levels for agent actions and safe-tool allowlists for operations that cannot modify state.
The specific implementation can differ across products, but the principle is broadly useful:
Separate low-risk capabilities from high-impact capabilities and require stronger controls as potential impact increases.
Read Access and Write Access Should Not Be Treated Equally
One of the simplest improvements engineering teams can make is separating read operations from state-changing operations.
Many AI workflows require large amounts of information but very little authority to change the environment.
An agent may need to inspect project data to answer a question.
That does not mean it should be able to modify the project.
An agent may need to inspect repository files to explain code.
That does not automatically justify permission to deploy that code.
An assistant may need to read a customer profile.
That does not mean it should be allowed to change account security settings.
This distinction substantially limits blast radius.
It also makes security monitoring easier because write operations can receive stronger validation than ordinary retrieval.
Human Approval Should Be Based on Impact
Human-in-the-loop controls are frequently proposed as a universal solution to AI agent security.
They are useful, but only when applied intelligently.
If every harmless read operation requires manual approval, users quickly learn to approve requests without meaningful review.
That creates approval fatigue.
A stronger design reserves intervention for operations where mistakes carry meaningful consequences.
For example, reading a public document may require no additional confirmation.
Changing a customer’s access rights probably should.
Sending an external message containing sensitive information may deserve review.
Initiating a financial transaction may require even stronger authorization.
The purpose of human approval is not simply to place a button between the agent and the tool.
The purpose is to create a meaningful security boundary before high-impact actions occur.
The Agent Should Not Become the Authorization System
A dangerous design pattern appears when business permissions are expressed primarily through prompts.
An application might tell an agent:
“Only administrators should perform this operation.”
That can help guide normal model behavior.
It is not a sufficient access-control mechanism.
The actual tool or backend API should independently verify administrator status.
Otherwise security depends on whether the model interprets and follows the instruction correctly under every possible context.
Agent behavior is probabilistic.
Authorization should be deterministic.
This principle applies throughout the system.
Do not ask the LLM to decide whether the current user may access a confidential record.
Do not ask it to determine whether a payment is permitted.
Do not rely on model instructions to prevent privilege escalation.
Use normal application security controls.
The agent should operate within them.
AI Agent Identity Requires Its Own Security Model
As agentic systems become more capable, organizations need to distinguish between several identities.
There is the human user.
There may be an application identity.
There may also be an agent identity.
Each plays a different security role.
The human identity determines who initiated the workflow.
The agent identity can provide traceability around which autonomous process performed the action.
The application identity may be required for infrastructure-level access.
Problems emerge when those identities collapse into one overprivileged service account.
NIST’s AI Agent Standards Initiative, launched in February 2026, explicitly includes secure agent operation and interoperability among its goals, while NIST’s related identity and authorization work is examining how agents should be identified, authorized and audited.
For product teams, this should reinforce a familiar security lesson:
Identity should remain visible throughout the action chain.
Tool Credentials Need to Be Scoped
AI tools frequently access downstream systems using API credentials.
These credentials should be scoped as narrowly as practical.
If a tool only needs to read one dataset, giving it unrestricted administrative access creates unnecessary exposure.
If an agent works on behalf of multiple users, a single global credential may also create authorization complexity because the backend can no longer naturally distinguish one user’s rights from another’s.
Security teams should therefore examine how tool credentials are issued, stored and mapped to users.
The safest architecture depends on the system, but broad privileged credentials should be treated as a significant agentic attack surface.
An attacker does not necessarily need to steal the credential directly.
Manipulating an agent that already possesses the credential may be enough to abuse the associated authority.
Agent Memory Creates Persistent Security Risk
Agents increasingly maintain memory across interactions.
Memory can improve usefulness by preserving user preferences, project context or information discovered during previous tasks.
It also creates another security boundary.
If attacker-controlled instructions become persistent, they may affect future actions even after the original interaction ends.
If memory is shared incorrectly, one user’s context may influence another user’s workflow.
If sensitive information is stored unnecessarily, memory can become another source of data exposure.
Agent memory should therefore be treated as application state.
It needs ownership, access control, retention rules and mechanisms for modification or deletion.
The system should also distinguish between trustworthy application state and untrusted content that happened to appear during an earlier AI interaction.
Multi-Agent Systems Expand Trust Relationships Again
Some applications use several specialized agents rather than a single one.
One agent may research information.
Another may evaluate it.
A third may perform an action.
This architecture can provide useful separation of responsibilities, but it also creates additional trust relationships.
When one agent sends information to another, the receiving agent needs to understand whether that information represents a trusted instruction, an observation or untrusted external content.
Otherwise an attacker may influence one low-privilege component and allow the resulting content to propagate into a more privileged one.
Multi-agent architectures therefore benefit from explicit role boundaries.
An agent responsible for research should not automatically inherit the authority of an execution agent.
Communication between agents should not bypass the same trust principles applied to communication between ordinary software services.
AI Agent Security and MCP
The growth of the Model Context Protocol and similar tool-integration architectures makes agent permissions increasingly important.
MCP can make it easier for models to interact with tools and external data sources, but convenience does not eliminate security boundaries.
An agent may connect to file systems, databases, development tools or external business platforms through MCP servers.
Each connection introduces new data and new capability.
Anthropic’s containment research explicitly identifies MCP servers, third-party plugins and web tools as potential sources of external content entering the agent context.
That means MCP integrations should be evaluated from both directions.
What information can the integration give to the model?
And what authority can the model exercise through the integration?
We will examine this area separately in the dedicated article on MCP Security later in this series.
Logging Autonomous Actions Matters
Agentic systems need enough observability to reconstruct how important actions occurred.
A conventional audit log might record that an API request was made.
For an AI agent, incident response may need additional context.
Which user initiated the task?
Which agent performed the operation?
Which tool was used?
What authorization decision was made?
Was the action automatic or manually approved?
What external content influenced the workflow?
NIST’s current work around AI agent authorization explicitly includes auditing and non-repudiation among the questions being examined for software and AI agents.
That does not mean organizations should indiscriminately record every token sent to a model.
AI logs can themselves contain sensitive information.
The goal is to create enough traceability to understand security-sensitive behavior without creating an uncontrolled secondary repository of confidential data.
Testing AI Agents Before Production
AI agent penetration testing should start by understanding capabilities rather than by immediately sending adversarial prompts.
Researchers should first map the relationship between user identity, agent context, tools, data and downstream systems.
The key question is:
What could this agent do if its reasoning became hostile or incorrect?
From there, testers can evaluate whether untrusted input can influence agent behavior and whether deterministic controls limit the resulting impact.
A security assessment may examine direct prompt manipulation, indirect instructions embedded in external content, cross-user data access, tool authorization, excessive privileges, agent memory and approval controls.
For an agent capable of high-impact actions, testing should also examine whether combinations of individually permitted operations can create a dangerous workflow.
This attack-path approach fits directly into ShabuShabu’s AI and LLM security testing methodology.
Test the Capability Boundary, Not Only the Prompt
The strongest agent test is not one that produces the most surprising model response.
It is one that determines whether the agent can exceed its intended authority.
Imagine a prompt manipulation successfully causes an agent to request an administrative operation.
If the backend denies the operation because the user lacks permission, the system has demonstrated an important security property.
The model was manipulated.
The application remained secure.
Now imagine that the same request succeeds because the tool runs under a global administrative credential.
The model behavior may look nearly identical.
The security outcome is completely different.
This is why AI agent security testing must follow actions all the way through the application.
Security Testing Should Examine Chained Actions
Agents often perform multiple steps.
Attackers may exploit the combination rather than any single operation.
An agent might be authorized to read a file.
It may also be authorized to send an email.
Those capabilities appear individually reasonable.
But if an attacker can influence the agent to read confidential information and then send it externally, the combined workflow creates a serious data-exfiltration path.
Testing needs to examine these combinations.
The same principle applies to search plus modification, retrieval plus messaging, code generation plus execution, or account lookup plus permission changes.
The attack surface is the graph of possible actions, not simply the list of available tools.
Stop Conditions Matter in Agent Testing
Testing autonomous systems requires controlled boundaries.
A security assessment should not create unnecessary production impact merely to demonstrate that an agent has excessive authority.
If a safe test object can show that an unauthorized modification is possible, there is usually no need to affect real customer data.
If an agent appears capable of causing resource-intensive loops, the tester does not need to create a denial-of-service condition to establish the weakness.
ShabuShabu’s Security Testing Terms use the same principle across penetration-testing engagements: establish impact with proportionate validation and remain inside the agreed authorization boundary.
Agent testing should be realistic without becoming reckless.
Designing Safer Autonomous Workflows
The strongest agent security architecture assumes the model can make a bad decision.
This assumption changes design priorities.
Instead of asking how to make the agent perfectly obedient, teams ask how much damage an incorrect decision can cause.
Tools become narrower.
Credentials become scoped.
High-impact operations require additional authorization.
External content is treated as untrusted.
User identity is preserved.
Memory is isolated.
Agent activity becomes auditable.
Each control reduces the blast radius independently.
This is defense in depth applied to autonomous AI.
A system with multiple independent controls can remain secure even when one component behaves unexpectedly.
AI Agent Security Is Ultimately About Control
AI agents are becoming more useful because they can do more without constant human instruction.
That same property makes security more difficult.
An application that simply produces text has a limited set of consequences.
An application capable of acting on the world needs stronger boundaries.
Security therefore depends less on whether the model is intelligent enough to recognize every malicious instruction and more on whether the architecture limits what happens when recognition fails.
Give agents only the tools they require.
Keep permissions narrow.
Preserve user identity.
Treat external context as untrusted.
Separate reasoning from authorization.
Require meaningful approval for high-impact operations.
Log important actions.
Test complete attack paths before production.
These are not uniquely AI security concepts.
They are mature cybersecurity principles applied to a new class of autonomous software.
That is what makes them effective.
Frequently Asked Questions About AI Agent Security
What is AI agent security?
AI agent security focuses on protecting autonomous or semi-autonomous AI systems from manipulation, excessive permissions, unauthorized tool use, sensitive-data exposure and unsafe actions. It covers the model as well as agent identity, memory, tools, APIs, authorization and external integrations.
Why are AI agents more dangerous than ordinary chatbots?
A chatbot primarily generates responses. An agent may be able to retrieve information, call tools and change application state. This means successful manipulation can potentially move from an incorrect response to a real-world action.
What is the most important AI agent security control?
There is no single control, but least privilege is fundamental. The agent should receive only the data, tools and permissions required for its task. Sensitive operations should also remain subject to deterministic authorization outside the model.
Should an AI agent be allowed to make authorization decisions?
The model may help interpret user intent, but critical access-control decisions should be enforced by deterministic application or backend systems. Model reasoning should not replace normal authentication and authorization.
How should AI tool permissions be secured?
Tools should be scoped by capability and user context. Read and write permissions should be separated where possible, high-impact operations should receive stronger controls, and downstream systems should independently verify authorization rather than trusting the agent automatically.
Can prompt injection compromise an AI agent?
Prompt injection can influence agent reasoning, including through external content that the agent processes. The practical impact depends heavily on the tools, information and permissions available to the agent.
When should an AI agent require human approval?
Human approval is most useful before actions with meaningful financial, privacy, security or operational impact. Requiring approval for every harmless action can create approval fatigue, while reserving it for sensitive operations makes the control more meaningful.
How should companies security test AI agents?
Testing should map the complete agent workflow and evaluate user identity, context, prompt manipulation, external content, retrieval, tool permissions, backend authorization, memory, chained actions and approval controls. The goal should be to determine whether the agent can cross a real security boundary rather than merely produce an unusual response.

Evie Roybal is 32 years old and the founder of an open-source crypto platform. She is a self-starter who has always been interested in new technologies, and she has a strong belief in the power of blockchain technology to change the world for the better. Evie is originally from Colorado, but she has spent most of her adult life living in various parts of Asia. She is currently based in Hong Kong.

