Join our Newsletter — 33% off our NHI Course
Home› Guides› Agentic AI Security Guide: Threats and Controls Across…
Guide Agent Governance & Risk

Agentic AI Security Guide: Threats and Controls Across the Agent Stack

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 24 October 2026 17 min read
On this page

Agentic AI does not introduce one new risk. It connects familiar ones in a new way. An agent reads untrusted content, decides what to do, and acts with real credentials against real systems, often without a human reviewing each step. In an agent, prompt injection, over-privileged identities, insecure tools and poisoned memory combine into one path from a malicious sentence to a production change. This guide sets out a six-layer threat model for agentic AI, maps it to the OWASP Top 10 for Agentic Applications, MITRE ATLAS and the main control frameworks, and explains which controls matter at each layer. It is written for security architects, identity teams and the engineers who build and run agents.

Key takeaways

  • Six layers, one attack path: inputs, model, memory, tools, orchestration and identity. Most serious incidents cross several layers.
  • Assume the model can be manipulated: OWASP says it is unclear whether there are fool-proof methods of preventing prompt injection, so design so that a manipulated agent still cannot cause serious harm.
  • Identity and access set the blast radius: what an agent can do when it goes wrong is decided by its credentials and tool permissions, not by its instructions.
  • Least agency, not just least privilege: the OWASP Agentic Top 10 asks organisations to avoid unnecessary autonomy, because agentic behaviour where it is not needed expands the attack surface without adding value.
  • Use one shared vocabulary: map controls, detections and incidents to the OWASP Top 10 for Agentic Applications (ASI01 to ASI10) and to your existing NIST, ISO and CIS controls.

Why agentic AI needs its own security approach

Traditional code follows a fixed path; an agent's path is chosen at runtime by a model. The OWASP Top 10 for Agentic Applications puts the core problem plainly: agents and the underlying model "cannot reliably distinguish instructions from related content". Three properties follow:

  • The attack surface is the content. Anything the agent reads, including email, tickets, web pages, documents, calendar invites, tool descriptions and other agents' messages, can steer it.
  • Actions are real. Agents send messages, change records, run code and move money using legitimate credentials, so misuse often looks like normal activity in the logs.
  • Errors compound. A wrong decision early in a multi-step plan, or in one agent of many, propagates to later steps and other agents.

OWASP's LLM06:2025 Excessive Agency entry names the root causes agents magnify: excessive functionality, excessive permissions and excessive autonomy. The Agentic Top 10 adds least agency: only the autonomy the task requires, backed by observability of what the agent does, why, and with which tools.

Agents are also non-human identities holding API keys, OAuth tokens and delegated sessions, so OWASP NHI Top 10 risks such as long-lived secrets and overprivileged NHIs apply directly. See AI Agents vs Agentic AI.

A layered threat model

The six layers follow how an agent works: it takes in content, reasons, remembers, acts through tools, coordinates with other agents and authenticates to systems. The Cloud Security Alliance's MAESTRO framework uses a seven-layer reference architecture for the same purpose and stresses threats that span layers. Either works if every layer has an owner and controls. See the AI Agent Threat Modelling Guide for running the exercise.

LayerTypical threatsMITRE ATLAS techniquesControls that matter most
1. Inputs and contextDirect and indirect prompt injection; poisoned retrieval sourcesAML.T0051 LLM Prompt Injection (including .001 Indirect)Treat content as untrusted; label and separate it; permission-aware retrieval
2. Model and instructionsGoal hijack, jailbreaks, system prompt disclosure, drift after updatesAML.T0081 Modify AI Agent ConfigurationLocked, versioned system prompts; policy enforced outside the model
3. MemoryPersistent poisoning; cross-session leakage; over-retentionAML.T0080 AI Agent Context PoisoningPer-user and per-task isolation; validated writes; expiry and rollback
4. Tools and integrationsTool misuse, tool poisoning, malicious MCP servers, code executionAML.T0053 AI Agent Tool Invocation; AML.T0110 AI Agent Tool Poisoning; AML.T0086 Exfiltration via AI Agent Tool Invocation; AML.T0101 Data Destruction via AI Agent Tool InvocationTool allowlists; least privilege per tool; sandboxes; argument validation
5. OrchestrationSpoofed agents, tampered or replayed messages, cascading failuresCross-layer: AML.T0080 and AML.T0053 when a peer agent carries the poisoned context or triggers the callMutual authentication; signed messages; circuit breakers
6. Identity and credentialsShared or human credentials; long-lived, over-scoped tokens; secrets in contextAML.T0083 Credentials from AI Agent Configuration; AML.T0098 AI Agent Tool Credential HarvestingPer-agent identity; short-lived, task-scoped tokens; per-action authorisation

Layer 1: Inputs and context

Threats: direct prompt injection; indirect injection through retrieved documents, web pages, email, calendar invites and tool output; poisoned retrieval-augmented generation (RAG) indexes. The Gemini AI Calendar Prompt Injection 2026 is a clear example, described below.

Controls: treat all external content as untrusted; segregate and label it, as LLM01:2025 recommends; filter for known injection patterns (useful but not sufficient); restrict which sources an agent may read; and keep retrieval permission-aware. See the Prompt Injection Guide.

OWASP mapping: ASI01 Agent Goal Hijack.

Layer 2: The model and its instructions

Threats: goal hijack, jailbreaks, system prompt disclosure, hallucinated actions and drift after model updates.

Controls: never place secrets in system prompts; lock and version system prompts so goals and permitted actions are explicit and auditable, as ASI01 recommends; pin model versions and re-test before upgrading; and have the agent state its intended action in a structured form that a policy engine checks before execution. OWASP calls this check an "intent gate" that treats planner output as untrusted.

OWASP mapping: ASI01 Agent Goal Hijack, ASI09 Human-Agent Trust Exploitation.

Layer 3: Memory

Threats: poisoned long-term memory; cross-user or cross-session leakage; over-retention; an agent re-ingesting its own output as trusted fact.

Controls: isolate memory per user, session and task; scan writes before commit; require source attribution; expire unverified memory; block automatic re-ingestion of the agent's own outputs, which OWASP calls "bootstrap poisoning"; and keep snapshots for rollback. See the AI Agent Memory Security Guide.

OWASP mapping: ASI06 Memory and Context Poisoning.

Layer 4: Tools and integrations

Threats: over-permissioned tools; untrusted input passed to shells, databases or interpreters; malicious or typosquatted tools and MCP servers; hidden instructions in tool descriptions; runaway loops. The OWASP incident tracker maps the Amazon Q Developer Extension Compromise 2025, a destructive prompt placed in the extension, to ASI01, ASI02 and ASI04, and lists the postmark-mcp Malicious MCP Server 2025, which secretly copied emails to the attacker.

Controls: allowlist and pin tools and MCP servers; per-tool least-privilege profiles, such as read-only database queries and no send or delete rights for an email summariser; sandboxes that never run as root; argument validation; spend and rate budgets; and human approval for destructive operations. See the MCP Security Guide.

OWASP mapping: ASI02 Tool Misuse and Exploitation, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution.

Layer 5: Orchestration and inter-agent communication

Threats: spoofed or rogue agents; tampered or replayed messages; a planner passing its full privileges to workers; bad output cascading through other agents.

Controls: mutual authentication with per-agent credentials; signed agent cards and attested registries; signed messages with nonces and timestamps; protocol version pinning; an external policy engine between planning and execution; and circuit breakers. See the Multi-Agent and A2A Security Guide.

OWASP mapping: ASI07 Insecure Inter-Agent Communication, ASI08 Cascading Failures, ASI10 Rogue Agents.

Layer 6: Identity and credentials

Threats: agents on human or shared credentials; long-lived, over-scoped tokens; secrets in configuration, prompts or memory; delegation chains that pass full privileges; permissions checked once and never again. In the PocketOS Database Deletion 2026, a coding agent used an account-scoped Railway token it found in an unrelated file to delete a production volume and its volume-level backups.

Controls: a dedicated identity per agent; short-lived, audience-bound, task-scoped tokens; delegation that records both user and agent; per-action authorisation; and secrets kept out of the agent's context. OWASP's ASI03 entry warns that without a distinct, governed identity, an agent operates in an attribution gap that makes true least privilege impossible. See the Agentic AI Identity Guide and the AI Agent Authorisation Guide.

OWASP mapping: ASI03 Identity and Privilege Abuse, plus the OWASP NHI Top 10 risks for the underlying credentials.

How the layers combine in an attack

Most serious agent incidents follow the same chain:

  1. An attacker places instructions in content the agent will read (Layer 1).
  2. The model treats them as part of its task (Layer 2), sometimes saving them to memory for later (Layer 3).
  3. The agent calls a tool to act on them (Layer 4), or instructs another agent to (Layer 5).
  4. The action succeeds because the agent's credentials allow it (Layer 6).

The Gemini Calendar case, disclosed by Miggo Security, shows the chain end to end. The attacker only sent an invite. When the user later asked about their schedule, Gemini read the planted event, followed its instructions and used its own calendar tool, with the user's delegated access, to write a summary of private meetings into a new event. Miggo says this worked even though Google had deployed a separate model to detect malicious prompts. According to Miggo, in many enterprise calendar configurations that event was visible to the attacker. No access control was broken: a read of untrusted content and a write tool sat in the same session, and the write tool became the exfiltration channel.

PocketOS shows that step 1 is optional: no attacker was involved, only a wrong assumption and a broad token in reach. Controls at Layers 1 and 2 reduce how often an agent goes off course but cannot guarantee it never does. Controls at Layers 4 and 6 decide how bad the outcome is when it happens. That is why identity and tool permissions are where to invest first.

Mapping to the OWASP Top 10 for Agentic Applications

The OWASP Top 10 for Agentic Applications for 2026 was published by the OWASP GenAI Security Project on 9 December 2025. It builds on the OWASP Top 10 for LLM Applications: OWASP notes, for example, that ASI01 combines LLM01:2025 Prompt Injection with LLM06 Excessive Agency. Its Appendix C maps NHI Top 10 risks to ASI entries, for example NHI5 Overprivileged NHI to ASI02 and ASI03, so identity teams can reuse existing NHI controls.

OWASP riskPrimary layerKey identity and access controls
ASI01 Agent Goal HijackInputs, modelHuman approval for high-impact actions; least privilege
ASI02 Tool Misuse and ExploitationToolsPer-tool least-privilege profiles; just-in-time, ephemeral credentials; argument validation
ASI03 Identity and Privilege AbuseIdentityPer-agent identity; task-scoped, short-lived tokens; per-action authorisation
ASI04 Agentic Supply Chain VulnerabilitiesTools, ecosystemAllowlisted, signed and pinned components; vetted MCP servers; supply chain kill switch
ASI05 Unexpected Code Execution (RCE)ToolsSandboxes with no ambient credentials; never run as root; egress control
ASI06 Memory and Context PoisoningMemoryPer-user memory isolation; never store secrets in memory; expiry and rollback
ASI07 Insecure Inter-Agent CommunicationOrchestrationMutual authentication; signed agent metadata; message integrity and anti-replay
ASI08 Cascading FailuresOrchestrationScoped delegation so workers never inherit full privileges; circuit breakers
ASI09 Human-Agent Trust ExploitationModel, usersSeparate preview from effect; confirmation for sensitive actions
ASI10 Rogue AgentsAllBehavioural monitoring; kill switches; rapid credential revocation

Controls that span every layer

  • Inventory: record each agent's owner, purpose, tools, data sources and credentials, including agents with OAuth access to corporate SaaS. See the Shadow AI Discovery Guide.
  • Policy outside the model: OWASP's LLM06 entry recommends complete mediation, implementing authorisation in downstream systems rather than relying on the model to decide whether an action is allowed. Guardrails in a prompt are not an access control.
  • Human oversight in the right places: require approval for irreversible, high-value or externally visible actions, enforced by the platform, with a dry-run or diff shown first. Approving every step breeds rubber-stamping.
  • Token hygiene for MCP and APIs: the MCP authorisation specification requires tokens bound to the intended server (the RFC 8707 resource parameter) and validated by it; its security best practices warn that token passthrough creates a confused deputy.
  • Secrets out of reach: keep keys out of prompts, memory, configuration files and repositories the agent can read, See the Secrets Management Guide.
  • Zero trust: verify every request from every agent as if it might be compromised. See the Zero Trust for AI Agents Guide.

Detection and monitoring

OWASP asks for a behavioural baseline per agent and alerts on deviation, with tamper-evident logs bound to a cryptographic agent identity. Log the agent, delegating user, tool, arguments, policy decision and outcome for every action.

SignalWhat it may indicateRelated risk
Goal change or divergence from the approved workflowGoal hijack through injected contentASI01, ASI09
Novel tool combinations, or a read of untrusted content followed by a write or sendInjection being turned into exfiltrationASI01, ASI02
Agent requesting new scopes or using a token outside its original intentPrivilege escalation through delegationASI03
Hash or signature drift in tools, prompts or MCP server definitionsSupply chain tampering or tool poisoningASI04
Memory write spikes, or self-generated content entering trusted memoryMemory poisoningASI06
Fast-spreading commands or unusual volumes of destructive callsCascading failure or rogue agentASI08, ASI10

Be able to pause an agent, revoke its credentials and quarantine its memory in minutes, and include agents in the insider threat programme, as ASI01 suggests. See the AI Agent Observability and Incident Response Guide.

Common failure patterns

  • Trusting the detector: relying on a prompt-injection classifier as the main control. The Gemini Calendar path worked despite a separate detection model; Google's response, as reported, included asking the user to confirm before Gemini creates events, which is a permission decision rather than a detection one.
  • Read and write in one session: create, send or share rights when the task only needs answers, giving injected instructions an exfiltration channel (ATLAS mitigation AML.M0030 Restrict AI Agent Tool Invocation on Untrusted Data). EchoLeak 2025 and ForcedLeak 2025 are both mapped to ASI01 in the OWASP tracker.
  • Tokens left in reach: account-wide tokens in repositories and config files that a coding agent can find, as in PocketOS. See the AI Coding Agents Security Guide.
  • Direct agent-to-production access: OWASP's ASI05 guidance warns against it, and the tracker maps the Replit AI Agent Database Deletion 2025, where an agent deleted a production database and generated false outputs, to ASI01, ASI09 and ASI10.
  • Unvetted tools and servers: MCP servers and extensions installed from public registries without pinning or provenance checks.
  • Approval theatre: approvals for every step, or a model-written rationale instead of the actual action and its side effects.
  • No off switch: no tested way to stop an agent and revoke its credentials quickly.

Framework mapping

The mappings show where agent controls sit in frameworks you may already report against. NIST's preliminary draft Cyber AI Profile (IR 8596) organises AI cybersecurity guidance using CSF 2.0 outcomes, and the NIST AI RMF provides the governance functions (GOVERN, MAP, MEASURE and MANAGE) for AI risk more broadly.

Control areaNIST CSF 2.0NIST SP 800-53 Rev. 5ISO/IEC 27001:2022 Annex ACIS Controls v8.1OWASP
Agent and tool inventoryID.AM-02, ID.AM-04CM-85.9Control 1, Control 2ASI04, ASI10
Agent identity and credentialsPR.AA-01, PR.AA-03IA-5, IA-95.16, 5.17, 8.5Control 5ASI03; NHI2, NHI7
Least privilege and per-action authorisationPR.AA-05AC-3, AC-6, CM-75.15, 5.18, 8.2Control 6ASI02, ASI03; NHI5; LLM06
Input validation and content handlingPR.PS-06SI-108.28Control 16ASI01, ASI06; LLM01
Sandboxing and isolationPR.IR-01SC-7, SC-398.22, 8.31Control 4ASI05; NHI8
Inter-agent communicationPR.AA-04, PR.DS-02SC-8, SC-238.5Control 3ASI07
Supply chain and component integrityGV.SC-07, ID.RA-09SR-3, SR-4, SR-11, SI-75.19, 5.21Control 15, Control 16ASI04; NHI3
Logging and monitoringPR.PS-04, DE.CM-03, DE.CM-09AU-2, AU-12, SI-48.15, 8.16Control 8ASI08, ASI09, ASI10
Containment and responseRS.MI-01, RS.MI-02IR-45.24, 5.26Control 17ASI10
Threat modelling and testingID.RA-03, ID.RA-04RA-3, CA-8, SA-118.25Control 16All ASI entries

Metrics that show progress

MetricWhat it showsTarget direction
Inventoried agents with a named ownerVisibility and accountabilityUp, towards all agents
Agents running on human or shared credentialsAttribution gap and NHI reuseDown, towards zero
Median lifetime of agent access tokensExposure window if a token leaksDown
Tools and MCP servers allowlisted and pinnedSupply chain controlUp
Destructive actions behind enforced approvalBlast-radius control for high-impact actionsUp
Secrets found in agent prompts, memory or configCredential hygieneDown
Time to stop an agent and revoke its credentials in an exerciseContainment readinessDown
Agents threat modelled and red teamed before productionAssurance coverageUp

A maturity path

Each stage makes the next possible; skipping containment for runtime tools leaves broad credentials untouched. For a scored version, see the Agentic AI Identity Maturity Model.

  1. Visibility: find every agent and AI integration, including those with OAuth access to corporate SaaS, and assign an owner.
  2. Containment: move agents onto their own identities with least privilege; remove shared and human credentials and secrets in the agent's context.
  3. Guardrails outside the model: tool allowlists, sandboxes, policy checks and approval gates for high-impact actions.
  4. Runtime assurance: per-action authorisation, behavioural baselines and alerting tied to ASI risks.
  5. Resilience: tested kill switches and revocation, regular red teaming, and threat models kept current as agents gain tools and autonomy.

Implementation roadmap

PhaseFocusActions
First 30 daysSee and stop the worstBuild the agent inventory; find human or shared credentials and exposed secrets; require approval for deletes, payments and external sends; name an owner.
Days 31 to 90ContainPer-agent identities with short-lived, task-scoped tokens; split read and write tools; allowlist and pin tools and MCP servers; sandbox execution; log every action.
Days 91 to 180Assure and respondPer-action authorisation; behavioural alerting; signed inter-agent messages; red teaming; rehearsed kill switch; report the metrics above.

See the Agentic AI Security Policy Template.

Practitioner checklist

  • Maintain an inventory of agents, their owners, tools, data sources and credentials.
  • Treat all content an agent reads, including tool descriptions and other agents' messages, as untrusted.
  • Keep secrets out of prompts, memory, agent configuration files and repositories agents can read.
  • Give each agent its own short-lived, least-privilege identity; authorise each action, not just the session.
  • Allowlist and pin tools and MCP servers, sandbox code execution and restrict network egress.
  • Bind tokens to their intended audience and never pass client tokens through to downstream APIs.
  • Require enforced human approval for irreversible or high-value actions, with a preview of the actual effect.
  • Authenticate and integrity-protect communication between agents, and stop privileges flowing down delegation chains.
  • Log agent, user, tool and outcome for every action; alert on deviation and rehearse stopping an agent and revoking its access.
  • Threat model and red team agents before deployment and after significant changes.

Standards and references

Related NHI Mgmt Group resources: Agentic AI Identity Guide · MCP Security Guide · AI Agent Threat Modelling Guide · Identity Governance for AI Agents Guide · NHI breach database

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 24 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.