How Prompt Injection Reaches Deployed Agents Through MCP
Attackers poison tool descriptions to manipulate deployed AI agents' decisions.

Prompt injection reaches deployed agents through MCP because text from outside enters the same context the agent uses to decide what to do. The weakness is not reducible to a coding mistake. MCP grants tool metadata a kind of trust that attackers can exploit, so meaningful defense must control that trust before it becomes permission to act.
What MCP is and how it places tool metadata inside the agent's reasoning loop
The Model Context Protocol, or MCP, connects AI agents to external tools and data sources through a host–client–server design [1][2][3]. The host creates a dedicated client for each server. That client issues tools/list, and the server returns tool names, natural-language descriptions, and argument schemas. The descriptions enter the language model’s context, where they help determine which tool it selects and what parameters it supplies.
This is more than a conventional API connection. A conventional integration relies on a static, machine-validated interface, while MCP also puts descriptive language inside the model’s control loop. The model reads what a tool says it does before deciding whether to use it. That expressiveness is a deliberate tradeoff, allowing tools to describe their capabilities without every integration being fixed in advance.
MCP-DPT, a defense-placement study of MCP security, identifies tool names, descriptions, argument schemas, and server-provided prompts and resources as “rich pre-execution artifacts.” These artifacts directly influence tool selection and parameterization. The server therefore contributes more than callable functions. It supplies part of the context through which the agent interprets its available actions.
Why the protocol's structural trust model is what prompt injection exploits, not any single coding mistake
The trust channel becomes an attack path when a server supplies instructions disguised as a description. When the agent calls tools/list, MCP has no native mechanism for distinguishing an honest capability description from adversarial directions. Both enter the model’s context through the same interface. The attacker does not need to break the connection. The normal connection delivers the payload.
MCP-DPT concludes that “many MCP security weaknesses stem from architectural misalignment rather than isolated implementation flaws.” That distinction changes who must provide the defense. The Cloud Security Alliance’s May 2026 research note reports that Anthropic treated the STDIO command execution behavior as intentional and left remediation to downstream developers. That finding specifically concerns command execution, but it reinforces why an upstream patch alone is insufficient.
The obvious objection is that this is an LLM problem. Any system exposing a model to external tool output faces the same basic risk. Google DeepMind, HiddenLayer, OWASP, and academic research share the position that model alignment alone does not reliably prevent prompt injection. MCP amplifies that broader weakness through a tool-description channel largely hidden from users. Human review cannot cover that channel at deployment scale.
The three pre-execution injection vectors and how they differ from post-execution attacks
The pre-execution surface has three entry points: tool descriptions, argument-schema descriptions, and server-provided prompts or resources that are brought into context. They strike before a tool call takes place. Their common purpose is to influence the reasoning that produces the call. Their difference is where the attacker places the instruction.
Tool description poisoning embeds malicious directions in a tool’s description during registration. The model encounters them while deciding what to invoke. Techniques include Unicode zero-width characters, homoglyphs, and strategically placed natural-language commands, which can conceal or obscure the payload from human reviewers. OWASP codified tool poisoning as MCP03:2025 in its MCP Top 10 project.
Full schema poisoning moves the instruction into JSON Schema description fields within inputSchema. It targets parameter generation as well as tool selection. Server-provided prompts and resources offer another pre-execution entry point when the host incorporates them into context before choosing an action. The same underlying weakness appears in different trusted artifacts.
Post-execution injection instead arrives in data returned by a legitimate tool. An attacker might control a web page, document, email, issue comment, or Slack message that the agent retrieves. This attack predates MCP, but MCP broadens its delivery surface. Timing determines the necessary defense. Output inspection can check content that comes back, but by then metadata may have already poisoned the reasoning behind the call.
How rug pulls, tool shadowing, and function dependency injection compound the base vectors
A rug pull changes what an approved server presents after the initial review. MCP lacks cryptographic content-addressing or version pinning for tool descriptions, allowing their meaning to change without the client knowing. CVE-2025-54136, disclosed in August 2025 with a CVSS score of 8.8, documented approval that did not hold through later server-side changes.
Tool shadowing extends that trust problem across servers. Invariant Labs demonstrated a malicious “fact of the day” server operating beside a legitimate WhatsApp MCP integration. The malicious server tricked the agent into sending message history through the legitimate server’s own send capability. The messaging server did nothing wrong in that chain. Trust granted to one server nevertheless influenced the use of another.
Function dependency injection manufactures a reason to call additional tools. A malicious server declares fake “required” helpers, causing the host to invoke them without an explicit user action. The declaration becomes the basis for a harmful execution chain. A defense aimed only at poisoned descriptions leaves those other expressions of inherited trust open.
What the attack chain looks like in documented production incidents
Invariant Labs disclosed Toxic Agent Flow in May 2025 against a GitHub MCP workflow. A prompt injection planted in a public repository issue could steer an agent with private-repository access into leaking private data through a pull request. Broad access tokens let that content reach beyond the public repository without a bug in the server’s code.
The April 2025 Cursor SSH key exfiltration case entered through metadata instead. A poisoned calculator tool description silently exfiltrated a developer’s SSH private key. The shared-repository MCPoison variant, associated with CVE-2025-54136, demonstrated team-wide compromise through a single committed configuration file. Every developer who pulled the repository could be affected.
The July 2025 Supabase and Cursor privilege-escalation case exposed another ordinary input channel. Researchers found that the agent used privileged service-role access as it worked through support tickets that held input from users. Any ticket a user could file was an injection surface. OX Security described Windsurf CVE-2026-30615 as the most severe zero-click case in its MCP STDIO prompt-injection family, requiring no further user interaction after delivery. The CSA note documented at least seven high- or critical-severity CVEs across major MCP-integrated platforms by May 2026.
The 2025 Cursor Auto-Execution Chain went beyond a one-time leak. A crafted Slack message reached Cursor through an already-approved Slack MCP server and directed it to rewrite ~/.cursor/mcp.json. The rewrite inserted a server entry pointing to attacker-controlled code. That turned retrieved content into a persistent infrastructure change. The injected instruction could leave a foothold across sessions by taking control of configuration.
Why the attack surface widens in multi-agent and cross-protocol pipelines
A compromised agent can become the delivery channel for another agent. If downstream agents consume its output, an injected instruction can propagate beyond the first tool interaction. Each agent may also have its own MCP connections and permissions. Containment must account for what agents pass to one another.
An IETF Internet-Draft published in June 2026 describes lateral movement combining MCP with Agent-to-Agent, or A2A, delegation. The draft states that “mitigations that consider each protocol in isolation do not address movement that crosses protocol boundaries.” A defense confined to one protocol cannot cover the whole chain. MCP-DPT likewise identifies persistent gaps in host orchestration, the layer where multi-agent coordination happens. As enterprises connect more agents, they still need to prevent the first injection, but keeping it from spreading becomes just as urgent.
Where current defenses sit in the MCP architecture and what they leave unaddressed
OAuth 2.1 with PKCE, resource indicators, and client registration help govern connections, while machine-to-machine authentication remains a draft extension outside the core specification. These controls do not establish that a tool description is safe. An authenticated server can still poison metadata or perform a rug pull. Per-call approval dialogs add a user decision, but do not by themselves remove the instruction channel.
Even connection security is not consistently applied. The CSA note reports that a July 2025 internet scan identified at least 1,862 publicly accessible MCP instances responding to unauthenticated requests. Configuration introduces a separate route to execution. An attacker able to influence a direct STDIO configuration can achieve arbitrary code execution regardless of session authentication. Fully authenticated deployments also remain exposed when users configure servers from attacker-controlled packages.
Hash-based tool pinning can detect changed descriptions, per-server session segregation can contain shadowing, and human approval can constrain sensitive actions. Each addresses a distinct part of the chain. MCP-DPT nevertheless describes existing defenses as “predominantly tool-centric,” with gaps at the host orchestration, transport, and supply-chain layers.
Ting Liu’s June 2026 HCP benchmark paper tested that gap through modeled attacks. A naive MCP-like baseline permitted all modeled attacks, while a mitigation baseline using metadata linting, warnings, identity fields, session checks, and per-call approvals permitted 6 of 10. An execution-control runtime that enforced explicit invariants blocked all the attacks tested and kept the audit evidence. HCP is a reference runtime and experimental artifact. The result supports a narrower conclusion than universal protection, showing the value of checking identity, resources, capabilities, approval, and audit evidence together.
What meaningful defense actually requires at the layer where trust is granted
Trust must be governed from the moment tool metadata is registered. A server should remain untrusted until its metadata is verified, its access is scoped, and its behavior is continuously monitored. The CSA note recommends treating every MCP server as an untrusted third party and establishing ongoing governance beyond a one-time patch cycle. That places responsibility at the integration layer.
In practice, governance requires a registry of approved servers with tool descriptions pinned at approval time. Later changes can then be detected against the registered state. Role-based access controls should scope which agents may invoke which tools, making capability a deliberate organizational choice. Per-server session segregation addresses the separate risk of one server steering another.
Real-time visibility into what each agent accessed can catch changes as they happen, while an audit log examined only afterward supports a postmortem. Configuration files such as mcp.json should be treated as privileged infrastructure. Changes to them should receive the same review as access-control policy changes, because they can turn a temporary injection into durable execution authority.
A governed path to approved servers lets teams add to what agents can do without making every deployment wait for a new security review. The enabling condition is explicit control over what the agent may trust and do. That is where MCP integration becomes a managed capability rather than an open-ended grant of authority.
Sources
- MCP-DPT: A Defense-Placement Taxonomy and Coverage Analysis for Model Context Protocol Security
- MCP Security Crisis: Systemic Design Flaws in AI Agent Infrastructure
- From Tool Connection to Execution Control: Benchmarking Security Invariants in MCP-Style Agent Runtimes
- From Tool Orchestration to Code Execution: A Study of MCP Design Choices
- Public-Sharing Labels and Verbatim Field Egress in an MCP-to-A2A Agent Configuration: A Controlled Multi-Model Study
- Model Context Protocol Threat Modeling and Analyzing Vulnerabilities to Prompt Injection with Tool Poisoning
- MCP Attack Surface: Tool Poisoning and IDE Auto-Execution


