
Learn what AI agent security covers, why agents break controls built for software, and which of its four layers most programmes are still missing.
We measured 402,599 internet-reachable AI agent hosts across 36 services, 206,435 agent skills, and 13,145 code files that hand agents dangerous capabilities. AI agent security is the work of governing what those agents do once they are running. This guide maps the category: its attack surface, its boundaries, and its four layers.
AI agent security is the discipline that governs what an AI agent is allowed to do once it is running: which tools it may call, which data it may reach, and which of its decisions are allowed to leave the model and touch a system. Securing the model itself is a different job with a different boundary. The model is one input to the decision. The tool call is the decision.
The mechanism is what makes this a separate discipline. An agent reads content, forms an intent, selects a tool, and issues a call that executes with real credentials against a real system. Each of those steps happens after the last human review and before the first log line.
The gap is measurable. Across the 13,145 files in our dataset that grant agents dangerous capabilities, adoption of every runtime guardrail the industry formally agrees on, meaning cost controls, audit logging, and human approval for destructive actions, is effectively zero. We say effectively because the real number for several of them sits below 0.1%. Our State of AI Agent Security 2026 research put it in one line: between an LLM's decision and system-level execution, there is nothing.
Governance of the artifacts an agent installs is no better. Out of the 206,435 skills analyzed, only 44 passed all five baseline security checks. Forty-four out of two hundred thousand is not a compliance gap. It is an absent control plane.
Existing controls were built for software that executes a path a person wrote. An agent executes a path it assembles while running, out of content it did not author. Four differences follow, and each one lands on a control class most security teams already own.
Static analysis reads the code and misses the instruction. Authorization reads the identity and misses the intent. A sandbox holds until an agent finds the exit its designers left open. None of these controls are broken; each answers the question it was built to answer, which is whether the caller may make this call. An agent raises a different question, which is whether this call is the one the task needed.
The root cause is architectural. Agent platforms ship defaults tuned for adoption speed, and no vendor treated a decision-time control as a shipping requirement. The result is not one team's mistake. It is what happens when a dozen popular platforms each ship a slightly permissive baseline and enterprises install all of them.
Five elements carry the agent attack surface, and they are not the five an application security review looks at. Prompts, tools, memory, identity, actions. Ranked by likelihood they look different again, and that ranking belongs to a threat model rather than to a map.
Prompts are the instruction channel, and that channel includes everything the agent retrieves. Indirect prompt injection is the class where an attacker writes into a source the agent will read later and never speaks to the agent directly.
Our own disclosure shows the shape better than a definition does. In ShareLeak, a crafted payload in a SharePoint form field took the wheel of a Microsoft Copilot Studio agent, which then read a connected SharePoint List and mailed customer records to an outside address. Microsoft assigned it CVE-2026-21520 at CVSS 7.5, high severity, which is the durable part: a prompt-injection flaw carrying a vendor CVE.
Tools are the action channel. Every registered tool is a granted capability, and capabilities combine. Code execution plus credential access plus outbound network is a complete exfiltration chain that needs no attacker to activate it.
Memory is where a bad instruction outlives the session that delivered it. Poisoned context written to a vector store or a persistent scratchpad comes back on a later, unrelated task, and the second task has no idea where the instruction came from.
Identity is the credential the agent carries, and the reason blast radius is a design decision rather than an accident. An agent holding a service account inherits everything that account can reach.
Actions are the only element that touches a system. Everything before them is preparation.
The enterprise SaaS copilot is where all five meet. A connector-and-document agent reads content authored by people outside the tenant, holds a token scoped to a whole workspace, and calls tools that write. It was approved as a productivity feature. It was never scoped as an execution surface.
Vendor copy uses the three terms interchangeably. They describe three different scopes, and the difference decides which control you are actually buying.
Read the table down the middle column and the boundary becomes concrete. A filter that inspects a completion has already done its job by the time the agent turns that completion into a call, and a data-layer control never sees the call at all.
In practice, agentic ai security and ai agent security name the same work, and treating them as two categories creates a purchasing problem rather than a security one. The distinction worth holding is between securing what the model says and securing what the system does about it.
The security challenges in AI agent deployment repeat across organisations, and each one sits with a different owner, which is why programmes stall between the audit and the control.
The OWASP Agentic Security Initiative published the numbered catalogue this list compresses, in Agentic AI: Threats and Mitigations, the first guide in its agentic series, released on 17 February 2025.
Its value is not theoretical. Use it as an audit instrument. For each threat class in the catalogue, write down which of your agents it applies to, which tool it would reach through, and which control would stop the action. Most programmes fill the first column. Some fill the second. The third column is where this category actually lives, and an empty third column is the finding.
A complete programme covers four layers: discovery, posture, runtime and response. The layers are sequential in dependency, not in importance. You cannot score a configuration for an agent you have not found, and you cannot enforce on a tool call you cannot see.
The first two layers are the ones a programme tends to reach first, because both have direct ancestors. Discovery inherits from asset management, and posture inherits from CSPM and configuration review. Both work on artifacts that sit still long enough to be scanned.
The runtime layer is where the coverage ends, and it is the layer that decides outcomes. What runtime means as a control location deserves its own definition and gets one elsewhere. Here it is a position: after the decision, before the effect. We catalogued five disclosures inside sixteen days in When Agents Go Rogue, and the summary is that none of them needed an external attacker and the safeguards in place did not catch them before execution.
Vendors sell across these four layers in roughly four categories, posture, identity, guardrails and runtime enforcement, and comparing them is a separate exercise with its own criteria. The map matters first: buying a second posture tool does not close a runtime gap.
Nothing in this sequence requires a purchase. It requires a decision about who owns the agent estate and about four weeks of unglamorous inventory work.
Phase 1, weeks 1 to 4. Find the agents. Pull OAuth grants from the identity provider, egress records to model endpoints from the network, and plugin telemetry from managed IDEs. Reconcile the three lists. The agents that appear in one source and not the others are the ones your policy has never covered.
Phase 2, weeks 4 to 8. Bound what they can reach. Give each agent its own identity rather than a borrowed one. Scope the token to the task rather than to the requester. Remove standing write access to production data stores, and pin the versions of the tools and skills each agent loads so an update cannot change behaviour silently.
Phase 3, weeks 8 to 12. Enforce at the call. Most agent frameworks already ship a hook that fires before a tool call executes, and we measured barely one percent of dangerous-tool files using it. Turn it on, write deny rules for the destructive verbs your agents have no business issuing, and make the control fail closed rather than open.
Phase 4, continuous. Keep the record. Log tool calls with their arguments and outcomes, not just the conversation. Then run one drill: pick a single agent, and ask who approved its credential and what it called last Tuesday. If the answer takes more than an hour, the response layer is a plan rather than a capability.
Phases 1, 2 and 4 close with work you can schedule. Phase 3 is where teams discover the layer has no default owner.
The map above cuts a hole, and enforcement at the moment of the call is the shape of it. That is the gap Capsule Security closes: a runtime security platform for AI agents that discovers the agents running across your organization, maps what each one can reach, watches their behavior live, and interrupts unsafe actions mid-execution, with no changes to your code, agents, or architecture.
The limit is worth stating plainly, because it is the hard part of this whole category. Enforcement at the tool call does not make an agent correct. An agent under it still forms wrong plans and still selects wrong tools; what changes is that the call can be read and refused before it reaches the system.
The real cost is accuracy. A control that refuses the wrong action teaches engineers to route around it, and a control people route around is worse than no control at all. Discovery and posture tell you what could happen. Only the runtime layer decides what does.
Want to see which agents are running in your environment right now, what each one can reach, and what a refusal at the tool call would have stopped? Get a demo.
It sits with application security in most organisations and fails there quietly, because AppSec tooling and staffing are built around code review cycles. The work is continuous and identity-adjacent. Teams that succeed give one named owner the agent inventory and the enforcement decision, whichever function they report into.
Partially, and in a way that reads as coverage on a dashboard. Those controls inspect traffic and files against policy, and they do see some agent egress. What they cannot evaluate is whether an authorised identity making an authorised request is doing so for the reason the task required, which is the question an agent's actions raise.
Non-human identity work gives each agent its own credential, its own lifecycle and its own scope, which is Phase 2 of any serious programme and a prerequisite for the rest. It answers who the agent is. It does not answer what this particular call is about to do, so the two programmes are complementary rather than alternative.
No, though it belongs in the stack. Filtering raises the cost of the most common entry technique and catches known patterns. It operates on text before a decision exists, so a filtered-clean instruction that produces a destructive tool call passes through untouched. Treat it as one control among several rather than the control.
The first two phases cost staff time rather than licences, usually one engineer for four to eight weeks in a mid-sized estate. Honestly, the harder number to predict is the political cost of the inventory, because it usually surfaces agents that were deployed without review by teams who liked it that way.
You find them first, which is why discovery is the base layer. Undeclared agents show up in OAuth grants, in outbound traffic to model endpoints and in IDE plugin inventories rather than in an approved-tools register. Once found, treat them the same as sanctioned agents: scoped identity, pinned tools, enforcement at the call.
Three numbers work better than a threat list: how many agents are running, how many hold standing write access to production systems, and how long reconstructing one agent's last week of actions takes today. Those answers map to discovery, posture and response, and the gaps between them make the case without any adjectives.
See how Capsule secures AI agents at runtime.
Get a demoTalk to our team about runtime protection for agentic workflows.
Book a demo.png)
On this page
Section heading