

Agentic AI Security: How to Secure the AI Agents Your Company Deploys

Agentic AI security is the practice of limiting what AI agents can access and do, recording what they actually did, and containing them when they act outside their scope. It applies to agents that take actions: coding agents that run shell commands and open pull requests, workflow agents that send email or update CRM records, and assistants connected to internal systems through MCP servers.
A coding agent that reads the repo, runs shell commands, and now needs an MCP server and OAuth scopes for the internal ticketing system is a typical case. The security questions are whose identity it runs under at 2am, and what it would do if a ticket told it to export secrets.
This guide covers agents your company has sanctioned, procured, and put into production, and it favors controls that keep working when the model misbehaves. Unsanctioned employee use needs a different approach, starting with shadow AI monitoring.
TL;DR:
- Identity is the foundation control. Each agent needs its own governed identity, a human sponsor, and short-lived credentials bound to one audience, or least privilege and attribution both break down.
- Plan for prompt injection to succeed eventually. Filters lower the attack rate, and architecture and permissions limit what a successful injection can reach.
- MCP servers belong in your software supply chain program. The authorization spec handles tokens but doesn’t address poisoned or swapped tool descriptions, so pinning, allowlisting, and sandboxing fall to you.
- Agent monitoring should reconstruct each action and tie it to an agent identity and the person who started the session, so a misbehaving agent gets investigated like a misused service account.
What Changes When an LLM App Becomes an Agent
The difference between an LLM application and an agent is the ability to act. OWASP’s agentic initiative describes agents as adding planning, tool usage, reflection, dynamic adaptation, and memory, and says these features “extend the scope of excessive agency.” Bad reasoning in an agent produces actions: a sent email, a merged pull request, exported CRM records.
Memory and delegation widen the attack surface further. Persistent memory lets a poisoned instruction shape behavior long after the session that planted it. Johann Rehberger showed this against Windsurf in 2025, when its memory tool stored injected instructions without user approval. Delegation spreads trust. Researcher Syed Anas Mohiuddin showed text injected into an MCP tool’s output reaching a subagent as an ordinary delegated task, which the subagent ran because it trusted the orchestrator that handed it over.
The OWASP Top 10 for Agentic Applications Is the Baseline
The reference list is the OWASP agentic Top 10, published December 9, 2025, by OWASP’s GenAI Security Project with more than 100 contributors. It names ten risks:
| ID | Risk | What it covers |
|---|---|---|
| ASI01 | Agent Goal Hijack | Manipulated inputs redirect the agent’s goals and multi-step behavior |
| ASI02 | Tool Misuse and Exploitation | Legitimate tools used unsafely through prompt injection, misalignment, unsafe delegation, or ambiguous instructions |
| ASI03 | Identity and Privilege Abuse | Inherited credentials or trust exploited to escalate access |
| ASI04 | Agentic Supply Chain Vulnerabilities | Third-party agents, tools, or prompt templates that are malicious or tampered with |
| ASI05 | Unexpected Code Execution (RCE) | Agent-generated code or commands that give an attacker execution |
| ASI06 | Memory & Context Poisoning | Persistent corruption of stored context or long-term memory |
| ASI07 | Insecure Inter-Agent Communication | Spoofed or manipulated messages between agents |
| ASI08 | Cascading Failures | A defect that propagates across agents, sessions, or workflows |
| ASI09 | Human-Agent Trust Exploitation | Over-reliance that leads people to approve harmful actions |
| ASI10 | Rogue Agents | Loss of behavioral integrity once an agent drifts from scope |
OWASP’s scoping notes decide which entry an incident falls under. Poisoned MCP tool descriptors belong under ASI02, and ASI04 applies only when the tool is compromised at the source. ASI08 applies only when a defect fans out with measurable systemic impact. The SANS Agentic AI Threat Map classes eight of the ten as identity and authorization failures, which is why identity comes first in the controls below.
Give Every Agent Its Own Identity, Owner, and Expiry
OWASP’s ASI03 entry warns that an agent without a distinct, governed identity operates in an “attribution gap” that makes true least privilege impossible. Many agents still run on shared API keys or credentials inherited from a person, and most organizations have no rules for issuing or retiring agent identities. In a January 2026 CSA and Oasis Security survey, 78% of respondents had no formal policy for creating or removing them.
Issue Per-Agent Identities
Microsoft advises against giving an agent a regular Entra user account, because user accounts are designed for human sign-in patterns. Entra Agent ID requires a human sponsor for every agent identity, and Microsoft recommends a quarterly review to catch orphaned agents whose sponsors have gone. Google’s Agent Identity can’t be impersonated and doesn’t allow long-lived service account keys. Both treat the agent as its own principal type. Govern it with the same ownership and least-privilege expectations as other privileged accounts.
Pick the Delegation Pattern on Purpose
Microsoft’s Agent ID guidance recommends the on-behalf-of flow for interactive agents, so the user’s access policies and consent still apply, and client credentials for autonomous agents with no user present. For production agents, it prefers managed identities or certificates over client secrets, and it tells teams to avoid app permissions wherever delegated permissions would do.
Handing an agent the user’s own session token is the pattern to avoid. The agent inherits all of that user’s access, the audit trail can’t separate its actions from the user’s, and a leaked token gives an attacker persistent, broad access.
Keep Credentials Short-Lived and Audience-Bound
No standard sets a single lifetime for agent tokens, so the available numbers come from platforms and vendors. Okta’s minimum access token lifetime is five minutes system-wide, and GitGuardian suggests five to 15 minutes for user-facing agents.
Standards bodies are still drafting agent identity guidance, including a NIST NCCoE concept paper and an IETF AI Identity Management System draft.
Whatever the lifetime, bind each token to the one resource it is meant for. For irreversible operations, OWASP adds short-lived authorization artifacts with replay protection.
Audit Permissions for Drift
Permissions attached to an Entra agent blueprint flow to every agent instance built from it, so Microsoft recommends auditing consented permissions periodically to catch privilege creep. Agents tend to pick up authorizations as their task chains grow, which weakens separation of duties over time.
Treat MCP Servers as Part of Your Software Supply Chain
MCP authorization has improved, but it solves a different problem from tool poisoning. In the current MCP specification, authorization is optional. Remote servers over HTTP are expected to use it, while local servers take credentials from the environment. When it is on, clients must name the server each token is for, and servers must reject tokens issued for anything else and never pass them along.
None of this governs what a tool description tells the model. The Cloud Security Alliance points out that the protocol has no native defenses against tool poisoning, rug pulls, or cross-server tool shadowing, and the incident record bears that out. Most of the specific flaws below have since been patched or pulled, but the patterns recur:
- Invariant Labs disclosed tool poisoning on April 1, 2025, showing that a malicious server could exfiltrate data and override instructions from trusted servers.
- Koi Security found that the unofficial postmark-mcp npm package built trust over 15 versions, then shipped version 1.0.16 in September 2025, which began copying every outgoing email to an external server.
- CVE-2025-6514 in mcp-remote let a malicious server’s authorization endpoint reach the system shell in versions through 0.1.15, until a later release fixed it.
- In Cursor, Check Point Research found that an approved MCP entry’s command could be swapped later without a new prompt (CVE-2025-54136), until Cursor 1.3 began requiring re-approval for any configuration change.
The controls follow from these incidents and match how teams handle any other software supply chain dependency. Keep an allowlist of approved servers by package name and version, snapshot tool definitions at approval, and require re-approval when they change. Trail of Bits’ mcp-context-protector blocks tool calls after a server’s definitions change until the user approves the new version.
Sandbox local servers, because the MCP docs warn that a local server inherits the user account’s environment variables, SSH keys, and cloud credentials. Once you run more than a few servers, a gateway gives you one place for allowlists, credential handling, and tool-call logging. A single server on one client may need only client-side pinning and an admin allowlist.
Design for Prompt Injection Succeeding
The 2026 edition of OWASP’s LLM Top 10 keeps prompt injection at LLM01 and warns that no reliable prevention mechanism exists today. The exploit record supports that position.
EchoLeak (CVE-2025-32711), which Aim Security disclosed in June 2025, exfiltrated Microsoft 365 Copilot context from a single email with no click. It slipped past Microsoft’s prompt injection classifier, link redaction, and Content-Security-Policy, and Microsoft fixed it server-side before disclosure.
Noma’s ForcedLeak chain against Salesforce Agentforce entered through Web-to-Lead form submissions and relied on a lapsed allowlisted domain that the researchers bought for $5. Salesforce had enforced trusted URLs for Agentforce before Noma disclosed the chain in September 2025. In Invariant’s GitHub MCP case, a malicious public issue led an agent to copy private repository data into a public pull request.
Detection-layer defenses help, but adaptive attackers get around them. In a 2025 study by researchers from OpenAI, Anthropic, and Google DeepMind, among others, a defense that held static attacks to as little as 1% success let adaptive attacks through more than 95% of the time.
Assuming some attacks will get through puts the weight on architecture. Simon Willison’s lethal trifecta (private data, untrusted content, external communication) names the dangerous combination. Meta’s Agents Rule of Two turns it into a rule: within a session, an agent running without supervision should satisfy no more than two of three properties, namely processing untrusted input, accessing sensitive data, and changing state or communicating externally.
Human approval is a weaker gate than it appears: Anthropic found that users approve 93% of Claude Code permission prompts. In GitHub Copilot’s CVE-2025-53773, an injection edited VS Code settings to auto-approve tool calls, which removed the gate entirely until Microsoft patched it in August 2025.
Prompt for any action not explicitly classified as low risk, and keep high-impact and irreversible actions out of that class. Enforce the gate outside the agent’s own configuration, and bind each approval to the exact actor, tool, target, and parameters, as the OWASP cheat sheet recommends.
Monitor What Agents Did and Who Asked Them To
Agent logs need to show which agent acted and on whose behalf. CSA recommends logging each agent invocation with the initiating human principal, the agent identifier, the tools or APIs invoked, the data accessed or modified, and the session context. It treats agent actions blending into a human’s audit record as a high-priority fix.
The OpenTelemetry GenAI conventions model each agent run as a parent span with child spans for model calls and tool executions, and they leave prompt and tool-result content out by default. Product implementations vary: Claude Code exports metrics and events over OpenTelemetry under its own event names, with trace support in beta.
Useful signals include first-seen tools, MCP tool definition changes, unusually frequent tool calls, repeated attempts to bypass approvals, and the cascading fan-out OWASP files under ASI08. The hard case is a hijacked agent working through legitimate credentials and APIs, because its activity looks like ordinary work until someone correlates it with identity and business context.
Containment has to work without the agent’s cooperation. Revoke its credentials and tool permissions at the identity provider or gateway, since a compromised agent’s own configuration can’t be trusted to enforce a restriction. Microsoft treats disabling an agent blueprint as a kill switch that blocks every agent identity built from it. Then close the agent’s open connections to its MCP servers, remove the agent from any registry other agents use to find delegates, and preserve tool-call and permission logs before remediation changes the evidence.
How to Match Agentic AI Security Controls to Each Agent
The right setting for most of these controls depends on what an agent can reach. Set them by what each agent does:
- Agents that run LLM-generated or user-supplied code: prefer virtualization that separates the sandbox kernel from the host, such as microVMs, full VMs, or Kata containers. NVIDIA describes gVisor as offering potentially weaker guarantees, so weigh it against your threat model.
- Agents that read untrusted content and reach sensitive data: remove their ability to change state or communicate externally, require approval enforced outside the agent, or split the workflow with explicit trust boundaries and restricted handoffs.
- Payments, permission changes, and anything crossing a trust boundary: require bound human approval. When deciding what counts as low risk, weigh the data involved, the destination, the privilege level, and the scale, since a read-only action against sensitive data can still leak it.
- Read-only RAG assistants: these may need fewer execution controls, but still need retrieval authorization, sensitive-data protections, prompt injection testing, and output controls.
- Autonomous workflow agents with write access: pair inline runtime controls with identity-level monitoring.
An agent’s reach changes as teams add tools and scopes. Revisit these settings whenever its permissions change.
Why Agent Security Becomes an Investigation Problem
The controls above reduce risk, but on their own they rarely answer what an agent actually did at 2am or whether it was authorized. Identity platforms record the grant and gateways record the call, while runtime tools flag the prompt. Someone still has to correlate those signals with who triggered the session, what is normal for that user, and which data was touched, and then act.
Continuous correlation is security operations work, and it moves agent activity out of one-time governance approval and into the SOC. Some teams run it in-house, and others hand it to a managed AI security provider.
Daylight is a MASS company, meaning it offers managed agentic security services for Security Operations. Its MDR service investigates AI agent activity, starting with Claude Enterprise, alongside related identity, SaaS, and cloud signals.
Frequently Asked Questions About Agentic AI Security
Can an Identity Provider Control Which MCP Servers Employees Use?
Yes, where the identity provider, MCP client, and MCP server all support MCP’s Enterprise-Managed Authorization extension, stable since June 2026. It lets the identity provider decide which supported servers each employee can reach. It doesn’t cover clients or servers that lack the extension, including most locally installed servers. It also governs access at the server level, so tool-level and data-level authorization stay with the server and your own controls. Test how removing access affects tokens already issued before relying on it for containment.
How Do You Trace an Action Back Through a Chain of Agents?
Use delegated tokens that record each hop. The act (actor) claim defined in RFC 8693 identifies the current actor, and nested act claims can record earlier actors, as in Okta’s agent-to-agent flow. Keep that history in your logs for investigations. Access decisions should rest on the token’s top-level claims and current actor, because the RFC treats earlier actors as informational and excludes them from access control decisions.
Does the OWASP Top 10 for LLM Applications Still Apply to Agents?
Yes. The agentic list builds on the LLM list without replacing it, and teams running multi-step agents should apply both. The current LLM list is the 2026 edition, published in August 2026, which ranks excessive agency third, the risk OWASP says agent features extend.
Is a Guardrail Model Enough to Filter Injected Instructions?
No. The OWASP prompt injection guidance notes that a guardrail LLM is itself susceptible to prompt injection and should be one layer among several. It prefers a purpose-trained classifier, which has a different attack surface, over a general chat model from the same family as the primary agent.
Does the EU AI Act Impose Obligations on Agent Deployments?
Yes, where an agent deployment qualifies as a high-risk AI system under the Act. Article 14 requires that people can effectively oversee high-risk systems while they are in use, and Article 26 requires deployers to assign that oversight to people with the competence and authority to exercise it. Under the Digital Omnibus amendment, in force since July 27, 2026, the main requirements for Annex III high-risk systems apply from December 2, 2027, and those for high-risk systems built into regulated products apply from August 2, 2028. The Annex III date gives teams a fixed point to have oversight and logging in place, and other obligations under the Act follow separate timelines.
Subscribe to newsletter
Subscribe to receive the latest blog posts to your inbox every week.
.avif)




Related posts
.avif)

For expert judgment, scaled to your world, head for Daylight



