AI agent security is not mainly a prompt-writing problem. Once an agent can call tools, use credentials, browse the web, edit files, send messages or trigger business actions, the security boundary moves from the model to the system around it.
That is why a secure agent should be designed under a simple assumption: the model can be manipulated. The goal is not to prove prompt injection can never happen. The goal is to make sure a manipulated agent still cannot turn untrusted instructions into unacceptable damage.
OWASP’s 2026 Agentic Top 10 describes the major failure classes. Its new Agent Control Standard goes a step further by focusing on runtime control and observability. OpenAI’s 2026 prompt-injection guidance reaches a similar architectural conclusion: input filtering alone is not enough; systems also need to constrain the impact of manipulation if it gets through.
Methodology note: this is a research-based security guide using current OWASP agentic security resources, the OWASP AI Agent and MCP security cheat sheets, and OpenAI’s 2026 prompt-injection guidance. It is not presented as a penetration test or product security certification.
The AI-XBlog Agent Security Control Stack
We use four control layers when evaluating agent risk. Each layer answers a different question.
| Layer | Security question | Typical controls |
|---|---|---|
| 1. Instruction boundary | What information is allowed to influence the agent’s reasoning? | Trusted/untrusted content separation, prompt-injection defenses, structured extraction, tool-output validation |
| 2. Capability boundary | What is the agent actually allowed to read or do? | Least privilege, scoped credentials, per-tool authorization, read/write separation, resource allowlists |
| 3. Execution boundary | Where can agent-triggered code or tools run? | Sandboxing, filesystem isolation, egress controls, container limits, secrets isolation |
| 4. Runtime control plane | How do we observe, approve, stop or override the agent while it acts? | Policy hooks, approvals, telemetry, audit logs, spend limits, rate limits, kill switches and anomaly detection |
The important point is that these layers overlap. A strong system does not ask one control to solve every problem.
Why prompt injection is an agent problem, not just an LLM problem
A chatbot that follows a malicious instruction might produce a bad answer. An agent with tools can convert the same manipulation into an external action.
OpenAI describes modern prompt injection as closer to social engineering than a simple string-matching problem: external content tries to persuade the model to act against the user’s intent. Web pages, emails, documents, tool results and retrieved context can all become instruction-bearing surfaces.
The security question therefore changes from “Can we detect every malicious instruction?” to “What happens if the model believes one?”
That is the foundation of blast-radius engineering.
Blast radius matters more than model confidence
Agents should be evaluated by what a compromised decision can affect.
We use four practical blast-radius dimensions:
- Data radius: how much sensitive information can the agent read?
- Action radius: what can it modify, delete, send, publish, purchase or execute?
- Network radius: where can it send data or reach external systems?
- Economic radius: how much API, compute, transaction or cloud cost can it consume before controls stop it?
An agent does not become safe because it asks for confirmation occasionally. If its credentials expose an entire tenant, its shell runs with developer privileges and its network egress is unrestricted, one bad approval can still have an enormous blast radius.
OWASP’s 2026 Agentic Top 10: the risks builders should understand
The OWASP Top 10 for Agentic Applications 2026 names ten classes of risk:
| ID | Risk | Control emphasis |
|---|---|---|
| ASI01 | Agent Goal Hijack | Instruction trust, policy enforcement, bounded actions |
| ASI02 | Tool Misuse & Exploitation | Per-tool authorization, input validation, approvals |
| ASI03 | Identity & Privilege Abuse | Scoped credentials, workload identity, least privilege |
| ASI04 | Agentic Supply Chain Vulnerabilities | Dependency, MCP, skill and plugin provenance |
| ASI05 | Unexpected Code Execution | Sandboxing, command restrictions, filesystem/network controls |
| ASI06 | Memory & Context Poisoning | Memory provenance, isolation, validation, reset paths |
| ASI07 | Insecure Inter-Agent Communication | Agent identity, authentication, message validation, trust boundaries |
| ASI08 | Cascading Failures | Rate limits, isolation, circuit breakers, bounded delegation |
| ASI09 | Human-Agent Trust Exploitation | Explainable approvals, independent validation, trustworthy UI |
| ASI10 | Rogue Agents | Runtime control, stop conditions, anomaly detection, revocation |
Where each OWASP risk should be controlled
| Primary control layer | OWASP risks that concentrate here | What should enforce the control |
|---|---|---|
| Instruction boundary | ASI01 Goal Hijack, ASI06 Memory & Context Poisoning | Trust separation, provenance, structured extraction and memory validation |
| Capability boundary | ASI02 Tool Misuse, ASI03 Identity & Privilege Abuse, ASI04 Supply Chain | Scoped identity, per-tool authorization, allowlists and dependency governance |
| Execution boundary | ASI05 Unexpected Code Execution, parts of ASI04 | Sandboxing, egress policy, filesystem/process limits and secrets isolation |
| Runtime control plane | ASI07 Insecure Inter-Agent Communication, ASI08 Cascading Failures, ASI09 Human-Agent Trust Exploitation, ASI10 Rogue Agents | Policy hooks, approvals, telemetry, rate/spend limits, circuit breakers and kill switches |
This mapping is not exclusive—most incidents cross layers. Its purpose is to stop teams from trying to solve every agentic risk in the prompt layer.
A checklist is useful, but only if every risk maps to an enforceable control. “Tell the agent not to do that” is not an authorization system.
Least privilege should exist below the model
OWASP’s AI Agent Security Cheat Sheet recommends minimum tool access, per-tool permission scoping, separate tool sets for different trust levels and explicit authorization for sensitive operations.
The key phrase is below the model. A model should not be the final authority deciding whether its own proposed action is permitted.
Examples:
- An email agent that only needs triage access should not receive permission to send or delete mail.
- A reporting agent should get database read access to approved views, not administrator credentials.
- A file-processing agent should operate inside a task-specific directory rather than the user’s entire home folder.
- A billing agent should not be able to both create and approve a payment without an independent control.
When possible, encode those limits in credentials, APIs and infrastructure rather than natural-language instructions.
Read and write capabilities should be separated
One of the simplest agent security upgrades is to split observation from action.
A read-only tool can still leak information, but it cannot directly delete a customer record or send a payment. A write-capable tool can create much larger consequences. Treat those as different risk classes.
Useful patterns include:
- read-only by default;
- temporary elevation for one explicit action;
- separate credentials for read and write;
- per-resource allowlists;
- human approval before high-impact writes;
- staged or reversible operations where possible.
Human approval is a control—but it is not a complete security model
Approvals are valuable for destructive, financial, externally visible or privacy-sensitive actions. But approval design matters. For a business-level framework for deciding which workflows should be automated first—and which should remain review-gated—see our AI Automation for Small Business scorecard.
A weak prompt such as “Allow this action?” trains users to click through. A stronger approval shows the actual tool, target, normalized parameters, data being shared and expected effect.
Approval should also happen as close as possible to the real action. If the model summarizes one action but a downstream tool executes something broader, the user is approving the wrong object.
For high-risk workflows, deterministic policy should be able to reject an action even when the user or model tries to approve it.
Agent sandboxes should control files, code and network access
OWASP explicitly recommends sandboxing agent runtimes and MCP servers. That means isolating more than CPU and memory.
A useful sandbox policy considers:
- filesystem: which directories exist and which are writable;
- network: which domains, IP ranges or services can be reached;
- process execution: which binaries or commands are available;
- secrets: which credentials are injected and for how long;
- time: maximum runtime and idle lifetime;
- resources: CPU, memory, disk and concurrency limits.
If an agent does not need outbound internet access, disabling egress is stronger than telling the model not to upload data. Managed runtimes do not remove this design choice: our OpenAI Agents API explainer shows how the agent harness and execution environment can remain separate layers, including hosted or bring-your-own sandboxes.
MCP expands the tool supply chain
MCP is useful because it makes tools reusable. That same interoperability increases supply-chain exposure.
OWASP’s MCP Security Cheat Sheet calls out risks including tool poisoning, tool-definition rug pulls, cross-server shadowing, over-scoped OAuth tokens, confused-deputy behavior, data exfiltration through legitimate tool channels and sandbox escape.
Practical MCP controls include:
- approve servers from known publishers;
- review tool descriptions and schemas as security-relevant input;
- pin or monitor tool definitions for unexpected changes;
- use separate scoped credentials per server;
- validate tool arguments independently of the model;
- treat tool results as untrusted data when they return to model context;
- isolate sensitive MCP servers from general-purpose tool catalogs;
- log cross-server data flows and privilege boundaries.
The broader rule is simple: a new MCP server is not “just another integration.” It is a new execution and trust boundary.
Tool outputs can attack the next step
Security reviews often inspect user input but trust tool output. Agents make that assumption dangerous.
A web-search result, CRM note, document body or MCP response can contain instructions that the model interprets during the next reasoning step. That means an apparently successful tool call can become the injection vector for the next tool call.
Structured extraction helps: return the fields the next step needs instead of raw HTML or arbitrary text whenever possible. Validate types, lengths, domains and identifiers before allowing tool output to drive a privileged action.
Memory is a persistence boundary
ASI06 exists because memory changes the time horizon of an attack. A malicious instruction that reaches persistent memory can influence sessions long after the original input disappears.
Memory systems should therefore record provenance, support deletion and reset, isolate users and tenants, and distinguish verified facts from untrusted retrieved content.
Do not let every model observation become long-term memory by default.
Multi-agent systems need trust boundaries between agents
An agent should not automatically trust another agent because both are inside the same application.
For multi-agent systems, treat each independently operated agent as a separate principal. Authenticate it, constrain what it can request, validate messages, limit delegation depth and prevent one agent from silently transferring privileges to another.
This is especially important when A2A or another interoperability layer crosses team, vendor or organization boundaries.
Runtime observability is part of security
The new OWASP Agent Control Standard focuses on a problem checklists alone do not solve: controls have to be enforceable while the agent is running.
A production agent should make it possible to answer:
- Which agent identity initiated this action?
- Which model and policy version were active?
- What tool was called?
- What parameters and target were used?
- Which data sources influenced the decision?
- Was approval required and who approved it?
- What did the tool return?
- What downstream actions followed?
- Can the action chain be stopped or revoked?
If those questions cannot be answered after an incident, the agent is difficult to govern even if the model itself behaved correctly most of the time.
Control spend and loops as a security boundary
Agents can fail economically without exfiltrating data. Unbounded loops, runaway subagents and repeated tool calls can turn a logic error or adversarial input into a large bill.
Set limits on:
- model tokens per task;
- tool calls per task;
- subagent count and delegation depth;
- wall-clock runtime;
- concurrent tasks;
- paid API usage;
- cloud compute and container lifetime.
A cost ceiling is both reliability engineering and security engineering.
A practical risk tier for agent actions
| Tier | Example actions | Minimum controls |
|---|---|---|
| Tier 0: observe | Read public data, summarize local non-sensitive content | Input validation, logging, rate limits |
| Tier 1: private read | Read email, CRM or internal docs | Scoped identity, tenant isolation, data-loss controls |
| Tier 2: reversible write | Create draft, update staging record, open a pull request | Per-tool authorization, audit trail, rollback |
| Tier 3: external or sensitive write | Send email, publish content, modify production data | Explicit approval, policy validation, target/parameter display |
| Tier 4: high-impact / irreversible | Transfer money, delete data, change permissions, execute admin commands | Independent deterministic control, strong identity, constrained environment, multi-party or out-of-band approval where appropriate |
This risk tier should influence the autonomy level you allow. Our AI Agents in 2026 guide uses an autonomy ladder for the same reason: more autonomy is only justified when the task value exceeds the additional control burden.
Security checklist before an agent gets production credentials
- List every tool, data source, secret and external service the agent can access.
- Separate read from write permissions wherever possible.
- Replace broad credentials with resource-scoped credentials.
- Define which actions require deterministic blocking versus human approval.
- Sandbox code execution and restrict filesystem and network access.
- Treat retrieved content and tool results as untrusted input.
- Define memory provenance, retention and deletion rules.
- Set limits for runtime, model tokens, tool calls, subagents and paid APIs.
- Log the full action chain with identity and policy context.
- Add a tested stop/revocation path that does not depend on the agent cooperating.
- Red-team indirect prompt injection against the tools with the largest blast radius.
- Review MCP servers, plugins and skills as supply-chain dependencies.
What “secure by prompt” gets wrong
System prompts are useful for shaping behavior. They are not a substitute for permissions, sandboxing or policy enforcement.
If a prompt says “never delete files” but the agent still holds an unrestricted delete tool, the security boundary is probabilistic. If the API credential physically cannot delete files, the boundary is deterministic.
Use model-level guardrails to reduce bad decisions. Use system-level controls to bound what bad decisions can do.
AI-XBlog assessment
The strongest 2026 shift in agent security is from guardrails around the model to control around the action path.
Prompt injection remains important, but it is only the first step in an attack chain. Damage requires a sink: a credential, tool, network path, memory store, downstream agent or human approval flow that converts manipulated reasoning into impact.
Security teams should therefore measure more than “injection success rate.” Measure containment: when the agent makes a bad decision, does policy stop it before it reaches a sensitive action?
Primary sources
- OWASP GenAI Security Project — Top 10 for Agentic Applications 2026
- OWASP GenAI Security Project — Agent Control Standard
- OWASP Cheat Sheet Series — AI Agent Security
- OWASP Cheat Sheet Series — MCP Security
- OpenAI — Designing AI agents to resist prompt injection
- OpenAI — Understanding prompt injections
Source check: September 16, 2026. Security guidance evolves quickly; this page is intended to be maintained as living content.
