The Research Report
When Prompts Become Shells: Microsoft's Indirect Injection RCE Disclosure and What to Do About It
On May 7, 2026, Microsoft Security published a research post that changed how we talk about prompt injection. They showed that attacker-controlled content in retrieved documents could travel straight into tool calls and execute native code on the host. Two CVEs followed: CVE-2026-26030 and CVE-2026-25592 in Semantic Kernel, both rated Critical with CVSS scores of 9.9.
OWASP confirmed Prompt Injection as LLM01, the top risk for LLM applications, for the third consecutive year. The combination of a major vendor disclosure and an independent risk ranking makes this the moment the industry stopped treating prompt injection as a chatbot nuisance and started treating it as a systems security problem.
The Attack Vector: From Document to Shell
The kill chain is simple. An agent reads untrusted content, usually through RAG retrieval or web browsing. That content contains hidden instructions. The LLM processes those instructions alongside legitimate user queries. The LLM then emits a tool call with attacker-controlled parameters. The framework executes the tool. If the tool does anything dangerous, the attacker wins.
Microsoft's researchers built a "hotel finder" agent using Semantic Kernel with an In-Memory Vector Store. A user query like "Find hotels in Paris" triggered a search plugin. The plugin built a Python lambda expression from user input and passed it to eval(). The code looked like this:
expr = f"lambda x: x.{field} == '{value}'"
The value parameter came from the LLM. An attacker who controlled a retrieved document could inject a payload that closed the string quote and appended arbitrary Python code. Microsoft's proof of concept launched calc.exe. Another payload wrote a file to the Windows Startup folder and achieved full host persistence after one reboot.
Microsoft's developers had anticipated this risk. They built an AST validator that walked the parsed lambda tree and rejected dangerous identifiers like eval, exec, open, and import. The researchers bypassed it in hours using Python's class-hierarchy traversal. From any object, class reaches the type. From the type, mro reaches base classes. From there, subclasses reaches every loaded class in the process, including BuiltinImporter, which can load any module. The bypass required no import call. It required no direct reference to any blocked name.
The second vulnerability, CVE-2026-25592, exposed an unguarded DownloadFileAsync tool decorated with [KernelFunction]. The local file path was AI-controlled. An attacker who reached this tool could write to any path the agent process could touch, including %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup.
Why This Matters Beyond Semantic Kernel
Semantic Kernel has 27,000 GitHub stars and ships in production .NET and Python deployments at Fortune 500 scale. But the structural pattern exists in every agent framework that wires LLM outputs to executable tools.
The Microsoft researchers announced a series on framework vulnerabilities beyond the Microsoft ecosystem. Their point is not that Semantic Kernel is uniquely broken. Their point is that any framework which maps model outputs to tool parameters without an execution boundary has the same class of vulnerability.
The researchers made this explicit: "The AI model itself isn't the issue as it's behaving exactly as designed by parsing language into tool schemas. The vulnerability lies in how the framework and tools trust the parsed data."
Why Prompt-Level Defenses Are Insufficient
Input classifiers, fine-tuned refusal heads, and delimiter-based marking of untrusted content all share the same structural limit. They produce probabilistic verdicts on each input. Even a 95% detection rate leaves a 5% gap. In a long-running agent loop, that gap compounds to near-certain exploitation over a session.
Microsoft's own Spotlighting technique, which wraps untrusted content in XML delimiters like <untrusted> and appends an instruction telling the model to treat the marked region as data, achieved a 41.65% attack success rate on the AgentDojo benchmark. A static tool-filter whitelist achieved 6.84% attack success rate but collapsed utility to unusable levels.
The problem is that filtering inspects content, but the security property depends on control flow. An attacker who lands one successful injection can poison the agent's memory so that every future retrieval replays the attack without the attacker needing to be present.
OWASP LLM01: Three Years at the Top
OWASP's Top 10 for LLM Applications has ranked Prompt Injection as LLM01 since the first edition in August 2023. The 2025 edition kept it at #1. SecurityWeek coverage in April 2026 documented a 32% surge in indirect prompt injection attacks in the wild, with Google, Palo Alto Unit 42, and others publishing confirmation that the threat had moved from theoretical to actively exploited.
RingSafe's analysis of the OWASP Agentic Top 10 (2026) noted that prompt injection "remains LLM01" and that the structural conditions for exploitation, the lethal trifecta of private data, untrusted content, and an exfiltration channel, are present in most deployed agents.
The Dual-LLM Defense Pattern
The architectural response that actually changes the shape of the problem is the dual-LLM pattern, also called information flow control.
Simon Willison proposed the original design in April 2023: split the agent into a Privileged LLM that plans and calls tools but never reads untrusted data, and a Quarantined LLM that reads untrusted data but has no tools. The Privileged LLM orchestrates. The Quarantined LLM extracts structured outputs. The insight is that no single model should simultaneously hold tool authority and process adversarial input.
CaMeL (Capabilities for Machine Learning), introduced by Debenedetti et al. at DeepMind (arXiv:2503.18813), closes the remaining gap. Instead of trusting type shape alone, every value produced by the Quarantined LLM is wrapped in a capability record carrying provenance and permitted readers. Every arithmetic or string operation propagates the capability through an information-flow-control algebra. At every tool invocation, a policy engine inspects the capabilities of the arguments before execution.
On the AgentDojo benchmark (arXiv:2406.13352), undefended GPT-4o showed a 47.69% attack success rate. CaMeL dropped that rate to a negligible level. The cost was a 7-point utility drop, from 84% to 77%. That is a tradeoff security teams can reason about. A 95% classifier that leaves a 5% exploit window is not.
Microsoft's FIDES framework (arXiv:2505.23643), released May 14, 2026, implements bidirectional information-flow control with both confidentiality and integrity tracking inside the Agent Framework. It is the first major vendor to ship IFC as a first-party capability.
Practical Hardening Recommendations
1. Audit your tool registry as if it were an attack surface.
Every agent framework has a tool registry. Most have not been audited as one. Map every tool the model can reach. Ask whether each tool accepts AI-controlled parameters that reach file system, network, code execution, or privilege escalation paths. If the answer is yes, that tool needs a capability policy or it needs to be removed from the agent's catalog.
2. Never eval() or exec() AI-generated strings.
Dynamic code generation from model outputs is a remote code execution primitive. Replace it with parameterized queries, structured parsing, or sandboxed interpreters with explicit allowlists. Blocklists in dynamic languages like Python are inherently fragile because the language's flexibility allows restricted operations to reappear through alternate syntax.
3. Implement provenance tracking on all external content.
Tag every piece of retrieved text, email body, web page, and document with its source. Propagate that tag through summarization, extraction, and reasoning. At the tool invocation boundary, reject any call where a state-changing parameter derives from untrusted provenance unless an explicit policy authorizes it.
4. Separate planning from ingestion.
The dual-LLM pattern is not a research toy. It is an architecture that production teams can adopt today. The planner sees the user query and the tool catalog. It never sees tool outputs or content derived from them. The reader sees external content and returns only typed, validated outputs. The boundary between them is where you enforce your security policy.
5. Patch and monitor.
Microsoft patched Semantic Kernel in version 1.39.4. If you run any agent framework with vector store plugins, code execution plugins, or file download tools, apply vendor patches immediately. Then set up monitoring for tool invocation patterns that include unexpected parameters, repeated failures, or calls to tools that the agent should not need.
The Bottom Line
Prompt injection stopped being a content security problem the moment agents gained tool access. Microsoft's May 7 disclosure made that transition public. The CVEs are fixed. The pattern is not.
Every framework that maps model outputs to executable tools carries the same systemic risk. The model is not the vulnerability. The trust model between the model and the tools is. OWASP has been saying this for three years. Now the code execution proofs are in production. The defense is architectural, not algorithmic. Split the roles. Track the provenance. Enforce the boundary.
Sources
- Microsoft Security Blog: "When prompts become shells: RCE vulnerabilities in AI agent frameworks" (May 7, 2026). https://www.microsoft.com/en-us/security/blog/2026/05/07/prompts-become-shells-rce-vulnerabilities-ai-agent-frameworks/
- CVE-2026-26030 / CVE-2026-25592: Semantic Kernel prompt-injection-to-RCE. https://ctipilot.ch/briefs/2026-05-10/cve-2026-26030-cve-2026-25592-microsoft-semantic-kernel-prompt-injection-to-rce/
- Replyant Lab: "Prompts as Shells: How Prompt Injection Became RCE in Semantic Kernel" (May 2026). https://replyant.com/lab/prompts-as-shells-rce/
- OWASP Top 10 for LLM Applications (2025). https://owasp.org/www-project-top-10-for-large-language-model-applications/assets/PDF/OWASP-Top-10-for-LLMs-v2025.pdf
- RingSafe: "OWASP Agentic Top 10 (2026): Prompt Injection #1" (May 25, 2026). https://ringsafe.in/prompt-injection-owasp-agentic-top-10-2026/
- Debenedetti et al., "CaMeL: Capabilities for Machine Learning" (arXiv:2503.18813). https://arxiv.org/abs/2503.18813
- Wu et al., "System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspective." https://openreview.net/pdf?id=LQVizJNJXx
- Hines et al., "Defending Against Indirect Prompt Injection Attacks With Spotlighting." https://ceur-ws.org/Vol-3920/paper03.pdf
- Microsoft Agent Framework Blog: "Stop prompt injection from hijacking your agent" (May 14, 2026). https://devblogs.microsoft.com/agent-framework/fides/
- Simon Willison: "The lethal trifecta" (June 2025). https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/
- AgentDojo benchmark (arXiv:2406.13352). https://arxiv.org/abs/2406.13352
- Lyrie Research: "When Prompts Become Shells: CVE-2026-26030, In-the-Wild IPI Payloads, and the Escalating War for AI Agent Integrity" (May 9, 2026). https://lyrie.ai/research/research/2026-05-09-09-deepdive-prompt-injection-rce-ai-agent-frameworks-semantic-kernel-ipi-wild