By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: AktoPublished July 13, 2026

TL;DR: Prompt injection becomes an operational security problem once AI agents can call tools, access databases, and trigger external actions, and Akto argues traditional filtering fails because it cannot control execution, indirect inputs, or MCP tool poisoning. The real shift is from text moderation to runtime enforcement, least privilege, and output validation across the full agent lifecycle.


At a glance

What this is: This is Akto's analysis of why prompt injection in AI agents and MCP-connected tools needs layered, runtime-first defenses, not just prompt filtering.

Why it matters: It matters because AI agents can now take real actions on behalf of enterprise users, so IAM, PAM, and AI security teams must govern tool access, output controls, and runtime enforcement together.

By the numbers:

👉 Read Akto's analysis of prompt injection defense for AI agents and MCP tools


Context

Prompt injection is an AI security problem that becomes materially worse when the system can do things, not just say things. Once an agent can call tools, read mail, query databases, or send a payment request, a malicious instruction can become an access-control and execution problem, which is why AI agent prompt injection now sits at the intersection of AI governance and IAM.

The article focuses on AI agents connected through MCP servers and third-party tools, where trust boundaries are often weakly defined. That creates a governance gap between untrusted content, tool metadata, and runtime authority, especially when an agent carries credentials or persistent context across sessions.


Key questions

Q: How should security teams handle prompt injection in AI systems?

A: Treat prompt injection as an authorisation problem, not only a content problem. Validate user input, monitor for override patterns, and block any prompt that tries to change model policy, exfiltrate data, or trigger sensitive actions. The safest design is one where untrusted prompts cannot directly reach code execution, production data, or privileged tools without policy checks.

Q: Why do AI agents make prompt injection more dangerous than chat-only tools?

A: AI agents are more dangerous because they can act, not just generate text. When a model can invoke tools, access records, or send messages, a hidden instruction can become a real enterprise action. The risk rises sharply if the agent inherits broad NHI permissions instead of narrowly scoped access.

Q: What breaks when detection-only prompt injection tools are used in production?

A: They create visibility after the fact, but they do not stop an agent from completing the harmful action. In agentic workflows, the dangerous step may finish in seconds, so alerting alone is too late. Production controls need inline blocking and policy enforcement, not just logs.

Q: How should teams govern AI agents that use MCP?

A: Treat each connected agent as a non-human identity with an owner, a scope, and a review cycle. The practical control set is familiar: least privilege, secret rotation, access expiration, and auditability across the systems the agent can reach.


Technical breakdown

Why prompt filtering fails against AI agent prompt injection

Traditional filters look for known bad strings, jailbreak patterns, or obvious unsafe prompts. That approach breaks when the malicious instruction is paraphrased, translated, embedded in a document, or delivered through tool output. In agentic systems, the deeper problem is not the prompt itself but the execution path that follows it. A harmless-looking instruction can lead to a tool call, data retrieval, or downstream action that a text filter cannot reason about. Effective defense therefore has to inspect trust boundaries, not just content.

Practical implication: move controls from the input box to execution-time policy checks on prompts, tool calls, and outputs.

How indirect prompt injection and context manipulation work

Indirect prompt injection hides the attacker instruction inside content the agent already expects to process, such as a web page, email, PDF, ticket, or tool response. Context manipulation is the broader pattern: the attacker influences the information the agent trusts, then the agent treats that information as authoritative context for later actions. Because the malicious text sits inside normal business content, simple keyword controls miss it. Persistent memory makes this worse when a payload planted in one turn changes behaviour in a later turn.

Practical implication: classify untrusted sources, isolate retrieved content, and monitor multi-turn state for delayed abuse.

MCP tool poisoning and runtime enforcement in agent security

MCP reduces integration friction by standardising how agents discover and use tools, but it also expands the attack surface. Tool poisoning occurs when a malicious or compromised MCP server publishes a legitimate-looking tool whose description or metadata contains instructions that shape the agent's behaviour. If the tool catalog is trusted by default, the agent may follow poisoned metadata as if it were configuration. Runtime enforcement is the control that matters here because it can validate whether a tool call, parameter set, or destination is consistent with the task before the action completes.

Practical implication: treat tool metadata as untrusted input and enforce runtime validation on every privileged agent action.


Threat narrative

Attacker objective: The attacker wants to turn a trusted AI agent into an execution layer for data theft, record tampering, or unauthorised downstream action.

  1. Entry occurs when an attacker injects instructions directly into a chat, or indirectly through an email, page, document, or MCP tool description that the agent is designed to ingest.
  2. Credential access or abuse follows when the agent relies on trusted context, carries standing credentials, or reaches into connected systems beyond the original task.
  3. Escalation happens as the agent chains multiple tool calls, persists malicious context across turns, or sends data to an unintended destination.
  4. Impact is achieved when the agent exfiltrates information, edits records, triggers payments, or executes another high-consequence workflow on the attacker's behalf.

NHI Mgmt Group analysis

Prompt injection is now an identity and authorisation problem, not just a content-safety problem. Once an AI agent can act on behalf of a user, the key question is who or what authorised the action after the prompt was accepted. That shifts the control focus toward least privilege, tool scoping, and runtime decision boundaries. For IAM teams, the issue is not whether the model can be tricked, but whether the resulting action can be contained before it becomes an enterprise event.

MCP tool poisoning exposes a new trust boundary around machine-readable configuration. Tool names, descriptions, and metadata are increasingly treated as safe by default, yet the article shows they can carry instructions that alter agent behaviour. That creates a governance blind spot between integration onboarding and runtime use. Security teams should treat tool registries like untrusted supply chain inputs, because the blast radius now depends on what the agent is allowed to do after discovery, not just what the tool is called.

Runtime enforcement is the decisive control gap in production agent security. Detection-only monitoring is useful for forensics, but it does not stop an agent from completing a harmful call. The article's layered model is consistent with a broader control shift in AI security: prevention must happen where intent becomes action. For practitioners, the implication is clear. If policy is not enforced in-line, the agent can still create business impact before any analyst sees the alert.

Context manipulation creates a multi-turn governance debt that most teams are not measuring. Agents that carry memory, chain tool calls, and reuse prior context can be nudged into harmful behaviour long after the original injection. That means review processes built around single prompts or single transactions miss the real failure mode. Security and compliance teams should assume the attack surface extends across the full session lifecycle, not just the first request.

What this signals

Prompt injection defenses are converging with identity governance because the real risk is delegated action. Once an AI agent can authenticate, invoke tools, and persist context, the control question shifts to whether the action was authorised, bounded, and auditable. That is why runtime policy, not content moderation alone, is becoming the useful security layer.

Execution trust gap: this is the gap between accepting a prompt and allowing an action to complete. The article points to a model where control must follow the request through tool discovery, metadata trust, runtime validation, and output handling. For security teams, this means agent oversight has to sit alongside IAM, PAM, and AI governance rather than inside a standalone chatbot filter.

As agent deployments expand, the operating model should assume malicious content can arrive through any trusted channel, including documents and MCP tools. Teams that already manage service accounts, secrets, and privileged integrations are better placed to extend those controls into agent workflows. The practical signal is whether your programme can stop a harmful action before the session ends, not whether it can explain the attack afterwards.


For practitioners

  • Implement execution-time policy checks Validate every agent tool call against task context, allowed parameters, and destination before the action completes. Do not rely on prompt filters alone, because they cannot observe the post-acceptance path.
  • Classify and isolate untrusted inputs Mark user content, retrieved documents, tool responses, and external metadata as different trust levels. Apply stronger scrutiny to lower-trust inputs, especially when they may contain indirect instructions or embedded commands.
  • Restrict agent tool and data scope Apply least privilege to each agent, including the narrowest possible access to databases, messaging, and payment APIs. Use task-scoped permissions so a successful injection cannot inherit broad standing access.
  • Validate tool metadata before onboarding Review MCP server descriptions, tool names, and metadata as untrusted content during integration. Reassess any tool whose behaviour changes after trust is established or whose catalog entry can influence agent decisions.
  • Monitor multi-turn behaviour for drift Baseline normal agent sequences, then flag unusual tool chains, sudden data-volume changes, or cross-session memory effects. Pair telemetry with blocking so suspicious activity can be stopped before the workflow completes.

Key takeaways

  • Prompt injection becomes materially more dangerous when AI agents can execute actions through connected tools and MCP servers.
  • Layered defense is essential because filtering, monitoring, and output checks each cover different parts of the attack path.
  • Runtime enforcement, least privilege, and untrusted-input classification are the controls that change the outcome in production.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10NHI-01Prompt injection and tool misuse are central agentic AI risks in this article.
NIST AI RMFMANAGEThe article is about operational controls for managing AI risk in production agents.
NIST CSF 2.0PR.AC-4Least privilege and access scoping are direct themes in the agent control model.
NIST SP 800-53 Rev 5AC-6Least privilege is the core control for reducing agent blast radius after injection.
MITRE ATT&CKTA0006 , Credential Access; TA0009 , Collection; TA0010 , ExfiltrationThe attack path centers on credential abuse, collection, and data movement through agent actions.

Map agent abuse paths to credential access, collection, and exfiltration tactics to improve detection and testing.


Key terms

  • Prompt Injection (Agentic): An attack where malicious instructions are embedded in content that an AI agent reads — causing the agent to execute unintended actions using its own legitimate credentials. A primary vector for agent goal hijacking and identity abuse.
  • Indirect Prompt Injection: Indirect prompt injection is an attack where malicious instructions are hidden inside content that an AI system reads later. The model may treat that content as context rather than as hostile input, which can influence tool use, data access, or workflow actions if controls are weak.
  • MCP tool poisoning: MCP tool poisoning is the practice of hiding malicious instructions in a tool name, description, or metadata exposed by an MCP server. Because those fields are often treated as trusted configuration, the agent may adopt the attacker’s instructions during tool selection or invocation.
  • Runtime Enforcement: Runtime enforcement is the practice of blocking malicious behaviour while software is running, rather than only detecting it after the fact. It monitors process activity, network actions, and privilege changes so a live attack can be interrupted at the point of execution.

What's in the full article

Akto's full blog covers the operational detail this post intentionally leaves for the source:

  • Step-by-step guidance on layering input guardrails, runtime protection, and output validation for agent workflows
  • Practical detection and blocking patterns for indirect prompt injection, prompt leakage, and MCP tool poisoning
  • Concrete examples of runtime enforcement and schema validation before an agent can complete a harmful action
  • The article's own breakdown of how to separate visibility, red teaming, and enforcement in production

👉 Akto's full post covers the layered controls, attack vectors, and runtime enforcement model in more depth.

Deepen your knowledge

NHI Mgmt Group's NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It is designed for practitioners who need to connect identity controls to real-world access risk across modern security programmes.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org