Agentic AI security (agentic security, for short) limits what an AI agent can do once its model has been talked into something. OWASP’s incident tracker lists a case from May 2025 in which text in a public GitHub issue steered a coding agent into leaking the contents of private repositories, with no stolen credential involved: the agent already had the access. OWASP’s explanation is that agents and the underlying model “cannot reliably distinguish instructions from related content”, so the limits have to live outside the model.
What is agentic AI security?
Agentic AI security is the set of controls that keep an AI agent, software that chooses its next step and acts through tools, inside the access its owner meant to give it. It treats the model’s decisions as untrusted and puts the limits where the model can’t move them: the identity the agent runs as, the tools and data it may use, and each request it sends.
What makes a system agentic is that nobody approves each step. The model plans, calls a tool, reads the result and decides again. Tools give it reach (a shell, an API, an MCP server, a browser), memory carries what it learned into the next session, and an identity decides what all of that can touch. If you can only fix one of those first, fix the identity. A model with no tools can only say the wrong thing; the same model holding a GitHub token and a database role can do it. Coding and cloud agents do nearly all of this over the network, talking to LLM providers, code hosts, databases and SaaS APIs, which is why AI agent security for them usually starts at egress: every action shows up as a request that can be read and checked before it lands.
Agentic AI security vs LLM security
Prompt-inject a chatbot and you get a bad answer on someone’s screen. Prompt-inject an agent holding a database role and you may get a DELETE that already ran. LLM security mostly covers the first case, what goes into one model call and what comes out; agentic AI security starts where the output becomes an action, whether that’s a SQL query, a git push, an MCP tool call or an email to a customer.
Who writes the input changes as well. A chatbot reads what its user types. An agent reads whatever its task touches, so anyone who can write to a web page, a support ticket, a tool result or an MCP tool description can leave instructions for it. That’s indirect prompt injection, and memory stretches it out: a poisoned note can steer a session that starts days later.
OWASP draws the line in the same place. Its Top 10 says the tool misuse entry “builds on the mitigations of LLM06:2025 (Excessive Agency)” and extends them to multi-step workflows, and it adds a principle it calls Least-Agency: “deploying agentic behavior where it is not needed expands the attack surface without adding value.” Prompt filters and model alignment still lower the odds of a bad decision. They can’t be the boundary. Treat the agent as an untrusted user with a very fast keyboard, and put access control where you would for that user.
What are the biggest agentic AI security risks?
Ranked by the OWASP Gen AI Security Project, the biggest agentic AI security risks are agent goal hijack, tool misuse and identity and privilege abuse. Supply chain compromise, unexpected code execution, memory poisoning and failures between agents come next. OWASP publishes the ranking as a Top 10 for practitioners and keeps a longer list of 17 threats underneath it.
The OWASP Agentic AI Top 10 (2026)
The OWASP Top 10 for Agentic Applications for 2026 came out on December 9, 2025:
- ASI01 Agent Goal Hijack. Something the agent reads (a ticket, a web page, a retrieved document) replaces its objective, and it pursues the new one with its own permissions.
- ASI02 Tool Misuse and Exploitation. A tool the agent is allowed to use gets turned against you. One of OWASP’s examples is a coding agent whose auto-approved ping tool is called again and again to leak data through DNS queries.
- ASI03 Identity and Privilege Abuse. The agent reaches past its task through a delegated session, a cached key, or a more privileged agent that handed down its whole access context.
- ASI04 Agentic Supply Chain Vulnerabilities. A tool, MCP server, prompt template or plugin loaded at runtime was tampered with upstream.
- ASI05 Unexpected Code Execution (RCE). Code the agent writes or is handed runs on the host: a shell command, an
eval, a poisoned dependency. - ASI06 Memory & Context Poisoning. Bad data written into memory, a RAG store or shared context steers the sessions that come after it.
- ASI07 Insecure Inter-Agent Communication. Messages between agents get spoofed, replayed or altered on the way.
- ASI08 Cascading Failures. A single fault travels through planners, executors and peer agents before anyone can step in.
- ASI09 Human-Agent Trust Exploitation. The agent talks a person into approving or carrying out the harmful step, so the log shows a human doing it.
- ASI10 Rogue Agents. The agent drifts from its goal with no attacker involved, for instance by gaming its objective.
Where each risk can be contained
Read the middle column as our summary of OWASP’s mitigations for each entry: the control point outside the agent that does most of the work.
| OWASP risk | Where to contain it (our reading of the OWASP mitigations) | OWASP mitigations it draws on |
|---|---|---|
| ASI01 Agent Goal Hijack | Tool scope and human approval: a hijacked goal still acts through the agent’s permissions | Least privilege for agent tools; human approval for high-impact actions |
| ASI02 Tool Misuse and Exploitation | Network path and a policy point: outbound allowlists, checks on each call, short-lived credentials | Execution Sandboxes and Egress Controls; Policy Enforcement Middleware |
| ASI03 Identity and Privilege Abuse | Identity: a distinct, short-lived identity per agent session, checked again on each privileged step | Task-scoped, time-bound permissions; per-action authorization |
| ASI04 Agentic Supply Chain Vulnerabilities | Tool approval: an allowlist of MCP servers, tools and skills, with pinned versions | Dependency gatekeeping; pinning |
| ASI05 Unexpected Code Execution (RCE) | A host sandbox plus the network path: code may run, but what it reaches stays limited | Execution environment security; access control and approvals |
| ASI06 Memory & Context Poisoning | Mostly inside the agent’s own stack: validate, segment and expire memory. A network control can’t judge whether stored content is true | Content validation; memory segmentation; expiry of unverified memory |
| ASI07 Insecure Inter-Agent Communication | Transport and identity: mutual authentication and signed messages between agents | Secure agent channels; message integrity |
| ASI08 Cascading Failures | A policy point outside the planner, plus rate limits that pause runaway loops | Independent policy enforcement; rate limiting and monitoring |
| ASI09 Human-Agent Trust Exploitation | Mostly the human interface: confirmations, previews without side effects, and logs of what the agent suggested | Explicit confirmations; separate preview from effect; immutable logs |
| ASI10 Rogue Agents | Containment: a per-agent identity you can revoke, a kill switch, signed audit logs | Containment and response; governance and logging |
Eight rows end up on identity, tool scope, the network path, approvals or logs, none of which needs to read the prompt. The two that don’t are worth being honest about. A proxy, ours included, can’t tell whether a fact an agent wrote to its memory is true (ASI06), and it can’t stop a person from trusting a persuasive agent (ASI09). Those two need work inside the agent’s stack and on the screen where people approve things.
The OWASP agentic AI threat model (T1 to T17)
Underneath the Top 10 sits Agentic AI - Threats and Mitigations, the first guide from the OWASP Agentic Security Initiative, published February 17, 2025 and updated to version 1.1 in December 2025. Each Top 10 entry points back to it (ASI01 to T6 and T7, ASI02 to T2, ASI03 one-to-one to T3). Its 17 agentic AI threats, grouped here by what they target:
- The agent’s reasoning and memory: T1 Memory Poisoning, T5 Cascading Hallucination Attacks, T6 Intent Breaking & Goal Manipulation, T7 Misaligned & Deceptive Behaviors.
- Tools, code and resources: T2 Tool Misuse, T4 Resource Overload, T11 Unexpected RCE and Code Attacks.
- Identity and accountability: T3 Privilege Compromise, T8 Repudiation & Untraceability, T9 Identity Spoofing & Impersonation / Agent Identity Compromise.
- The humans in the loop: T10 Overwhelming Human in the Loop, T15 Human Manipulation.
- Multi-agent systems and protocols: T12 Agent Communication Poisoning, T13 Rogue Agents in Multi-Agent Systems, T14 Human Attacks on Multi-Agent Systems, T16 Insecure Inter-Agent Protocol Abuse.
- Supply chain: T17 Supply Chain Compromise.
We’d use the Top 10 to decide what to fix first and the 17 to check that no category was skipped. A team running one coding agent per laptop can park the four multi-agent threats until its agents start talking to each other.
What is an agentic AI security framework?
Ask two engineers which risks their coding agent carries and you’ll get two different lists. An agentic AI security framework settles that: it’s a structured set of threats and controls you check every agent against, so coverage doesn’t hinge on memory. The most specific one comes from the OWASP Agentic Security Initiative, which besides the two documents above publishes a threat modelling guide, guidance on securing agentic applications and a report on agentic AI security and governance.
NIST works at a broader level. Its AI Risk Management Framework (January 2023, now under revision) is voluntary and applies to any AI system, agentic or not. For agents in particular, NIST’s Center for AI Standards and Innovation (CAISI) published a request for information about securing AI agent systems on January 12, 2026. One of its topics is “methods to constrain and monitor the extent of agent access in the deployment environment”, which is exactly the layer the controls below work at.
Putting a framework to use starts with an inventory: every agent, who launches it, where it runs (a laptop, a cloud VM, a Kubernetes pod), and the identity, tools and data it has. Then map each agent to the risks that actually apply. A read-only reporting agent gets a short list. A coding agent with a shell and a GitHub token gets most of the ten. Give each row a control point from the table above and a named owner, run the periodic red-team tests for goal override that OWASP recommends under ASI01, and redo the map whenever an agent picks up a tool, a data source or a workflow, since that’s when the old one goes stale.
Securing agentic AI: controls outside the model
Assume the bad day has already happened: the agent read the poisoned ticket and is now doing what it says. None of these agentic AI security best practices asks the model to behave. They act on the agent’s identity, its grants, its credentials, its traffic, the approvals it needs and the record of what it did.
Give each agent its own short-lived identity, tied to a person
Picture the audit log of a team whose agents share one service account. Every action belongs to the same name. You can see that something dropped a table, but not whose agent did it or which session to kill.
Cloud agent platforms already supply the missing piece. They mint a short-lived OIDC token for each agent session, signed by the platform, and the token says who started it: Cursor’s carries the owner’s email in owner_email, Devin’s carries the requester’s in requesting_user_email. Exchange that token at the enforcement point and every request carries two names, the agent session and the person behind it, with no long-lived secret left in the agent’s environment. We wrote up how we use OIDC for our own cloud agents.
OWASP’s description of the alternative is precise: “Without a distinct, governed identity of its own, an agent operates in an attribution gap that makes enforcing true least privilege impossible.” AI agent identity covers how the agent’s identity and the person’s fit together.
Grant least privilege, just in time
It’s tempting to let the agent inherit the engineer’s access, since it’s already on the machine. The agent can then do anything the engineer can, at machine speed, on instructions from whatever it read last.
Start agents with zero standing privileges on anything sensitive instead. When a task needs a production database or a cloud role, the agent asks for it with a reason and a duration, a person approves, and the grant ends with the session. That’s just-in-time access as engineers already use it, with one rule added: the agent can request but never approve. In our own setup, a cloud agent asks its owner over Slack for one database, says why and for how long, and once approved the grant covers only that session and that one database.
Tools need the same treatment. OWASP’s tool misuse guidance spells out per-tool profiles, for example “read-only queries for databases, no send/delete rights for email summarizers”. Without them, an agent that chains tools escalates through whichever one has the widest grant.
Keep credentials out of the agent
Anything in the agent’s environment, a .env file, a shell profile, a CLI config, is something a hijacked agent can read and send elsewhere. Credential injection takes the key out of reach. The agent sends its request with no key, and a proxy on the path checks who’s calling and what’s allowed, then adds the real credential on the way upstream.
The Stripe API key guide shows the whole pattern for one API. The client calls api.stripe.com with no key, the proxy sets the Authorization header (replacing any header the client sent), and a policy lets one group make GET requests to balances, charges and customers while a POST /v1/refunds comes back blocked. The same move gets secrets off build machines in CI/CD secrets management.
Control egress at the request level
OWASP’s tool misuse mitigations include “Execution Sandboxes and Egress Controls”: run tools in isolation and deny every destination not on an approved list. Egress filtering covers how to build that floor. With agents it runs out fast. The hosts an agent needs are the same hosts it can do damage on, so a coding agent allowed to reach github.com to clone can reach it to push.
Telling the two apart takes an egress proxy that terminates TLS on the flows you pick (TLS inspection covers how), reads the protocol inside and decides per request. Git is a good test of whether it really does. To the network, a clone and a push of the same repository differ only in the pack service they call, git-upload-pack or git-receive-pack, and git can reach GitHub three ways: HTTPS, SSH on port 22, and SSH on port 443 through ssh.github.com. Block pushes on one of the three and the agent is a changed remote URL away from the other two.
Check each request against policy
A check at connect time assumes the session stays what it was when it opened. Agent sessions don’t: the connection that carried ten reads can carry a write on the eleventh call. So the policy decision point has to see every request at the trust boundary, with who is asking (the agent and its human), the resource, the action and the arguments, and answer allow, deny or ask a person.
Arguments matter more than they look. Merging a pull request on GitHub can be a REST call, PUT /repos/{owner}/{repo}/pulls/{number}/merge, or a GraphQL mutation such as mergePullRequest or enablePullRequestAutoMerge inside a POST /graphql. A policy that reads only the URL sees the same POST /graphql for a harmless query and for the merge. It has to parse the body. On databases and servers, the same per-query check is the inner layer of privileged access management.
Keep a human on irreversible actions
OWASP asks for “human confirmation for high-impact or destructive actions (delete, transfer, publish)”. Keep that list short: merging to a protected branch, deleting data, moving money, changing permissions. Approvals on every step create their own threat, T10 Overwhelming Human in the Loop, because people who see a prompt every minute stop reading it.
What the approver sees matters as much as when. An agent asking for approval will describe its action in the most reasonable terms available, which is how ASI09 Human-Agent Trust Exploitation works. Show the raw action instead (the diff, the SQL, the target branch), make sure the approver is the person accountable for the agent, and never let an agent approve its own request.
Log every action against a person
After an incident, someone will ask which agent did it and on whose behalf. OWASP files the failure to answer under T8 Repudiation & Untraceability.
Write the record at the enforcement point: the agent session, the person behind it, the request and the policy decision. The agent’s own transcript doesn’t count, since a hijacked agent can write anything into it. Kept at that level, the same logs show the pattern OWASP tells you to watch for, an agent doing a “DB read followed by external transfer”, while it’s still happening.
Approve tools and MCP servers before agents use them
OWASP’s tool misuse examples include a malicious tool named report that gets resolved before the real report_finance. The data goes to the wrong tool. Agentic supply chain risk (ASI04) usually starts like that, with a tool nobody reviewed, so keep a list of approved MCP servers, skills and AI tools, pin their versions, decide who may use each one, and look for the ones outside the list. Skills and MCP servers reach agents through different supply chains, compared in skills vs MCP. Tools in use outside that list are shadow AI, and shadow AI detection covers how teams find the servers and AI clients already in use.
Agentic security for coding agents
A coding agent runs in the engineer’s terminal and starts with everything that terminal has: GitHub tokens, SSH keys, a logged-in cloud CLI. The first instinct is to allowlist commands, and it rarely holds, because approving a few developer tools can amount to approving any command. npm test runs whatever the repository’s scripts say. Agentic security for coding agents holds up better at the sandbox and network layer, which is how the Claude Code integration works: it limits where the agent connects, keeps API keys off the machine and logs each request per developer. AI coding agent security covers both setups, the engineer’s laptop and the cloud VM.
Agentic security for MCP servers and tools
In September 2025, a package on npm that posed as an email service’s MCP server was found secretly BCC’ing the emails it sent to its author. OWASP’s tracker records it as the first malicious MCP server reported in the wild. The Model Context Protocol (MCP) gives agents one standard way to call tools, and attackers one standard place to aim: OWASP names MCP under T16 Insecure Inter-Agent Protocol Abuse, and tool descriptions arriving from a server are input the model will act on. Agentic security for MCP comes down to approved servers, permissions per tool and per user, and a log of every tool call. An MCP gateway enforces that in one place, and the permission pitfall of MCP explains why a server’s own permissions aren’t enough.
How does Formal approach agentic AI security?
We put these controls on the network path, outside the agent. Formal Endpoint runs on macOS and Linux laptops and on cloud agent VMs. In Transparent Mode it intercepts the traffic you select, with no client changes, terminates TLS with a Formal local CA, and applies logging and policy. Which traffic is selected comes from network rules written in CEL, which match on process, hostname, user, group and protocol.
The git example from our docs shows the rule and the policy side by side. On macOS, the rule’s first stage matches any process with a known agent in its ancestry, recognized by code signature, so the git and ssh processes that Claude Code spawns are caught while the same command typed by the engineer isn’t. The second stage matches github.com and ssh.github.com, the third keeps HTTP and SSH. The policy then blocks git-receive-pack for the listed repositories over either transport, or swaps the block for an MFA prompt that pauses the push until the engineer confirms on their device.
When a request needs a secret, a Formal Connector holds it and a Native User injects it, so the laptop or agent sandbox never sees it. Cursor and Devin cloud agents exchange their per-session OIDC tokens for a Formal machine session, so each action maps to the human who ran the agent. Our documented cloud agent setup runs Transparent Mode fail-closed, with a policy that parses GitHub’s GraphQL to stop those agents from enabling auto-merge.
The same platform covers AI agent governance for the AI tools themselves. The Catalog records which MCP servers and skills are approved and for whom, Shadow AI lists the ones people use outside it, Guardrails decide what happens to those, and Access Requests handle exceptions. LLM requests go through the AI gateway, which logs prompts, responses and tool calls against a person.
At Cursor, Formal sits between the ML environments agents work in and the sensitive data they need:
“Without Formal, we couldn’t have agents with access to sensitive data. With Formal, because we are able to inspect all traffic and enforce controls, we are able to provide a safe environment for the agents to get the job done.”
— Travis McPeak, Head of Security @ Cursor
Formal doesn’t detect or prevent prompt injection inside the model. We assume it will happen and work on what comes after: what the agent can reach, which keys it never holds, and the record it leaves. If you want to see that on your own agents, request a walkthrough.