REVIEW 4 major objections 4 minor 15 cited by
Design Patterns for Securing LLM Agents against Prompt Injections
T0 review · 4 major / 4 minor · reviewed 2026-08-07 · deepseek-v4-flash
Pith's one-line read This paper argues that application-specific LLM agents can be made meaningfully resistant to prompt injection by constraining what a model may do after it has seen untrusted input.
desk verdict A clear, honest catalog of design patterns for prompt-injection resistance; the abstract overclaims 'provable resistance' but the body mostly concedes the guarantee is narrowed attack scope. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing mechanism is the enforced separation between untrusted content and any component that can act. Concretely, the paper treats an LLM agent as a composition of an instruction-following model, a set of tools, and an orchestrator, and inserts a choke point between them: actions are either selected from a closed allowlist, committed to in a plan before untrusted data is read, produced by a tool-less quarantined model whose output passes a format constraint or is dereferenced symbolically by the orchestrator, or executed as code written by the model. The key technical object is the constrained output—a boolean, a number, a category, a regex-validated string, or a symbolic variable—that cannot carry an arbitrary instruction without being detected. That object is what makes the guarantees composable: each pattern can be combined with the others, for example plan-then-execute with dual-LLM processing and context-minimization, to narrow the remaining attack surface.
What would settle it
Take a client that follows pattern 2 or 4, feed it a single crafted calendar event or document containing hidden instructions, and inspect every tool call and sent message. If the injection can change which tool is called or which recipient or parameter is chosen—beyond the already-conceded power to alter free-text bodies and summaries—the 'impossible for untrusted input to trigger consequential actions' claim is refuted. The paper itself shows near-misses of this kind, so the sharper experiment is to attempt the same through a constrained field such as a boolean, number, category, or symbolic variable rather than through open-ended text.
Extended reading notes
Core claim
The central claim is that the boundary between untrusted content and privileged action is what determines whether an LLM agent is secure, and that this boundary can be drawn in system architecture even when the underlying model remains fully injectable. The paper's six patterns each redraw the boundary differently: the action-selector pattern turns the LLM into a switch that chooses from a hardcoded action list; plan-then-execute fixes the list of tool calls before any untrusted data is read; the map-reduce pattern processes each untrusted document by an isolated sub-agent whose output is checked or aggregated without an LLM; the dual LLM pattern runs a tool-less quarantined model over untrusted text and gives the privileged model only symbolic references; code-then-execute has the LLM write a program that is run by an interpreter; and context-minimization deletes the user prompt or other untrusted text before later generation steps. Applied across ten case studies, from OS assistants and SQL agents to email, booking, hiring, medical, and software-engineering agents, the patterns are claimed to give meaningful resistance to prompt injection while retaining practical utility, with provable resistance understood at the system level, not as a property of the model.
Load-bearing premise
The whole scheme rests on the premise that an LLM's output can be constrained so tightly—to a short action list, a number, a category, or a fixed format—that malicious text hidden in untrusted data cannot smuggle itself through disguised as a legitimate value.
Editorial extensions
If this is right
- Developers who adopt the patterns should be able to ship application-specific agents whose consequential actions are fixed by a trusted plan, so injected text in files, emails, or reviews cannot add new tool calls.
- No single pattern covers every threat, so the paper's own recommendation is to combine several patterns, trusting different boundaries against different attackers.
- Injections can still alter the parameters of an already-approved action, for instance the body of an email or a structured summary, so the guarantee is a narrowed attack surface rather than total safety.
- Security analysis shifts from trying to make the LLM behave to designing and verifying the small action space around it.
Reading between the lines
- If the constrained-output premise holds, the same six patterns give a general recipe for any system that mixes privileged instructions with untrusted content, not just LLM agents; the quarantined-submodel idea is a capability-isolation primitive.
- The case studies are qualitative, but they imply a testable ordering: attacks through third-party content should be far harder under map-reduce and dual-LLM designs than under direct processing, and this could be measured with a standardized injection benchmark that varies only the untrusted-data channel.
- The abstract's 'provable resistance' is stronger than what the case studies demonstrate, since the paper itself shows constrained outputs can sometimes smuggle attacker-controlled content; a formal proof would require a precise definition of 'consequential action' and of the output constraints.
- A practical consequence the paper leaves implicit is the usability cost: secure agents become brittle to requests that do not fit the predefined actions, so adoption will hinge on how well developers anticipate the small set of legitimate actions.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes six system-level design patterns for building LLM-based agents that are resistant to prompt injection: action-selector, plan-then-execute, map-reduce, dual-LLM, code-then-execute, and context-minimization. It argues that application-specific agents can be made secure against prompt injection by constraining untrusted data so that it cannot trigger consequential actions, even though the underlying LLM remains vulnerable. The patterns are illustrated through ten case studies spanning OS assistants, SQL agents, email/calendar assistants, chatbots, recommender systems, resume screening, medical applications, and software engineering. The paper is written as design guidance rather than as a formal security analysis, and it repeatedly acknowledges residual attack surfaces in the case studies.
Significance. The paper is a valuable consolidation of practical, system-level defensive engineering for LLM agents. Its strengths include clear articulation of a guiding security principle, concrete and composable patterns, and unusually honest case studies that name residual failures (e.g., §4.3.3 email body manipulation, §4.1.2 map-LLM malleability, §4.9.3 tamperable symptom summaries). The paper also transparently attributes several patterns to prior work, notably Willison's dual-LLM pattern and the plan-then-execute/code-then-execute ideas in Debenedetti et al. If reframed as 'meaningful resistance' rather than 'provable resistance,' the paper would be a useful reference for agent designers. As written, however, the headline guarantee is not backed by any formal proof or empirical evaluation, and several documented examples directly contradict the stated 'impossible' principle.
major comments (4)
- [Abstract and §3] The abstract promises 'provable resistance to prompt injection,' and §3 states that once untrusted input is ingested, it must be constrained so that 'it is impossible for that input to trigger any consequential actions.' No formal threat model, security definition, or proof is provided anywhere in the paper. More importantly, the paper's own case studies contain concrete counterexamples to this impossibility claim: in §4.3.3 design 3, the quarantined LLM's output, even when stored as a symbolic variable, can carry attacker-controlled text into an outbound email; in §4.1.2, a malicious file can trick the map LLM into a false invoice match, causing the file to be moved or copied. These are consequential actions triggered by untrusted input. The central claim is therefore unsupported as stated, and the paper should either supply a formal argument with explicit assumptions or revise the abstract and Section 3 to claim architectural mitigation or narrowing of attack surface rather than provable impossibility.
- [§4.1.2 (map-reduce)] The security analysis of the map-reduce pattern concludes that the design 'resists prompt injection attacks' because a malicious file can at worst be treated as a matching invoice. But the paper's own guiding principle requires that untrusted input be unable to trigger consequential actions. Marking a malicious file as an invoice and moving or copying it to a protected location is itself a consequential action caused by the injection. The comparison to an actual invoice is not a security equivalence: a prompt injection's goal is to make the agent perform an action the user did not request, and the false-match case does exactly that for the affected file. The paper should explicitly acknowledge that this pattern reduces the blast radius to a single file but does not satisfy the 'impossible' standard, and should adjust the security claims accordingly.
- [§4.3.3 design 3 (dual LLM)] The dual-LLM symbolic-variable mechanism is presented as a way to prevent untrusted data from reaching the privileged LLM. The paper concedes, however, that the quarantined LLM remains susceptible to prompt injection and can produce attacker-controlled output, and that the orchestrator subsequently dereferences this value into an actual email send. This means the symbolic indirection does not make the value inert; attacker-controlled text reaches a consequential action parameter. The paper's claim that the privileged LLM cannot dereference the value is true but insufficient, because the orchestrator dereferences it. To support any form of provable resistance, the authors would need to define a safety predicate on quarantined-LLM outputs (e.g., a grammar or semantic restriction) and prove that attacker-controlled inputs cannot produce outputs satisfying the predicate in a way that causes harm. The current text does not provide such a predicate.
- [§4.9.3 design 3 (structured formatting)] The paper states that enforcing a structured format for the symptom summary 'leaves no room for prompt injection in the summary.' This is misleading: structured decoding constrains syntax, not semantics. The patient's prompt can still manipulate the content of the symptoms summary before it is formatted, as the paper itself notes in the preceding design 2. An attacker can encode a prompt injection in a structured field just as easily as in free text if the downstream consumer interprets that field. The case study does not identify the format or the downstream use sufficiently to support the claim, and no experiment or formal argument is provided. This is another instance where the constrained-output channel is assumed to be tamper-proof without evidence.
minor comments (4)
- [§3.1 pattern 6] The description of the context-minimization pattern says the user prompt is removed 'to prevent it from modifying the LLM's response,' but the example only removes the prompt before a post-processing step. The text should clarify whether the pattern removes the prompt before all response generation or only before specific downstream LLM calls.
- [Figure 1 caption] The caption says 'The red color represents untrusted data,' but subsequent figures do not consistently use red to mark untrusted data or use the same legend. Consider adding a consistent legend to all figures.
- [§4.4.2] The statement that answering 'go see a doctor and ask' could be problematic 'because it is medical advice' is presented without a source. If this is a legal or regulatory claim, it should be cited; if it is an assumption, the text should label it as such.
- [References] The closely related work 'Defeating Prompt Injections by Design' (Debenedetti et al., 2025) is cited, but its relationship to the code-then-execute pattern could be discussed more explicitly in Section 3.1 pattern 5, since that pattern is described as being instantiated by that framework.
Circularity Check
No circularity: the design patterns are architectural arguments with transparent provenance; the paper's own case studies concede residual attacks, and the unsupported 'provable resistance' wording is an overclaim rather than a circular derivation.
full rationale
The paper contains no fitted parameters, no quantitative predictions, and no equations whose outputs are defined to be their inputs. The six design patterns are presented as system-architecture constraints, and their security properties are argued from the structure of those constraints (e.g., an action selector chooses from a pre-defined allowlist; a map operation limits each untrusted file to one constrained output; the dual-LLM pattern dereferences symbolic variables only in a non-LLM orchestrator). These are first-principles design arguments, not conclusions derived from the claims themselves. Self-citations appear (Debenedetti et al. 2024/2025, Beurer-Kellner et al. 2024), but the paper explicitly attributes the core pattern ideas to external sources such as Willison's dual-LLM blog post, and the cited works are implementations or benchmarks rather than unverified authorities invoked to close an argument. The code-then-execute pattern says it is 'instantiated in the framework of Debenedetti et al. (2025)', but the pattern's own description is self-contained and the citation is provenance, not the sole load-bearing justification. Notably, the paper itself documents residual attack surface: a malicious file can trick the map LLM into a false match (Sec. 4.1.2), a symbolic variable in the dual-LLM pattern can carry attacker-controlled content into an outbound email (Sec. 4.3.3, design 3), and a structured symptoms summary remains tamperable (Sec. 4.9.3). These concessions undermine the abstract's 'provable resistance' as an unsupported overclaim, but they are the opposite of circularity: the text openly acknowledges that the idealized guarantee is not achieved in those instantiations. The gap between the abstract's promise and the body's caveats is a correctness/support issue, not an equivalence-to-input issue, so no circularity step is identified.
Assumptions & free parameters
assumptions (4)
- domain assumption Current LLMs cannot be made robustly resistant to prompt injection at the model level, so security must come from system architecture.
- domain assumption The application can identify which inputs are untrusted (third-party data, possibly user prompts) and enforce the separation at the system boundary.
- ad hoc to paper Constrained LLM outputs (fixed action lists, regex formats, structured decoding, symbolic variables) are tamper-proof enough that injected content cannot cause consequential side effects through the output channel.
- domain assumption The planning or selection LLM, seeing only the user prompt and not third-party data, will not choose an unsafe action or plan.
Cite this review
Pith. "Pith review of Design Patterns for Securing LLM Agents against Prompt Injections." pith.science (2026). https://pith.science/paper/6KPSY3BG
@misc{pith2026250608837,
author = {Pith},
title = {Pith review of: Design Patterns for Securing LLM Agents against Prompt Injections},
year = {2026},
howpublished = {\url{https://pith.science/paper/6KPSY3BG}},
note = {Machine review of arXiv:2506.08837}
}
read the original abstract
As AI agents powered by Large Language Models (LLMs) become increasingly versatile and capable of addressing a broad spectrum of tasks, ensuring their security has become a critical challenge. Among the most pressing threats are prompt injection attacks, which exploit the agent's resilience on natural language inputs -- an especially dangerous threat when agents are granted tool access or handle sensitive information. In this work, we propose a set of principled design patterns for building AI agents with provable resistance to prompt injection. We systematically analyze these patterns, discuss their trade-offs in terms of utility and security, and illustrate their real-world applicability through a series of case studies.
Figures
Figures from the paper (4 more)
Forward citations
Cited by 15 Pith papers
-
Prismata: Confining Cross-Site Prompt Injection in Web Agents
Prismata cuts web-agent prompt-injection attack success from 85.5% to 0.7% via Biba-inspired DOM trust labeling and mechanical least-privilege confinement without site annotations.
-
Beyond Self-Resolution: Settlement Factorization for Robust Natural Language Mechanism
Settlement factorization is a normal form: every mechanism admits a ghost-reference label with leakage ε within factor two of optimal, and truthful margins degrade by at most the tight constant 2Lε.
-
Agent Data Injection Attacks are Realistic Threats to AI Agents
Agent data injection (ADI) forges trusted agent metadata via probabilistic delimiter injection and bypasses defenses built only for instruction injection.
-
AISPA: User-Centric System Prompt Auditing for Large Language Model Applications
A human-in-the-loop audit of system prompts from 88 commercial AI products finds protective instructions nearly universal yet incomplete, with ~40% of products containing at least one user-harmful directive.
-
Are You Still the Agent I Authorized? Earned Authority under a Fixed Ceiling for Evolving Agents
Evolving agents may change active authority only beneath an immutable user-issued effect ceiling, and a transition envelope decides whether the old grant survives mutation at all.
-
How Context Attribution Handles What the Model Already Knows
Context attribution methods cannot disentangle in-context from in-weight knowledge and assign unfaithful scores under overlap; new metrics and WMDP-Cyber++ quantify the failure.
-
Agent Security Needs Redefinition through a Holistic Framework
Agent security should be redefined around four contextual authorization properties instead of the content of the action performed.
-
IssueTrojanBench: Benchmarking AI Coding Agents Against Malicious Issue Requests
AI coding agents followed malicious instructions embedded in issue-style artifacts in 66.5% of 4,176 test runs.
-
Specifying the Delegated-Autonomy Boundary: Requirements Engineering for Agentic AI
A requirements-engineering framework that justifies when agentic AI is warranted (AJR) and specifies graduated autonomy, memory, coordination, assurance, and evolution policies (ADP).
-
Prevalence of Security and Privacy Risk-Inducing Usage of AI-based Conversational Agents
Roughly a third of UK adults use AI chatbots weekly, and among them a substantial minority upload untrusted content, connect bots to other programs, share sensitive data, or attempt jailbreaks.
-
When Compression Becomes an Attack Surface: Black-Box Attacks on Prompt-Compressed LLM Agents
The paper claims prompt compression is a new attack surface, but the abstract's COMA attack never appears in the body and the body's SoftCom requires white-box access.
-
Bridging AI and Software Security: A Comparative Vulnerability Assessment of LLM Agent Deployment Paradigms
Function Calling and MCP architectures show distinct vulnerability patterns, with chained attacks succeeding 91-96% of the time in both.
-
MedMKEB: A Comprehensive Knowledge Editing Benchmark for Medical Multimodal Large Language Models
MedMKEB is a medical multimodal knowledge-editing benchmark with four task types, on which existing editing methods underperform according to the authors.
-
Adversarial Prompting Framework for AI Safety Assessment
An adversarial prompt testing framework with a five-level attack taxonomy and a composite harmfulness score is proposed; the paper claims encoded prompts bypass safety filters most often.
-
Prompt Injection 2.0: Hybrid AI Threats
A structured taxonomy of hybrid prompt injection attacks shows how XSS, CSRF, and SQL injection vectors converge with LLM manipulation to bypass traditional controls.
Reference graph
Works this paper leans on
-
[3]
Benjamin Cohen-Wang, Harshay Shah, Kristian Georgiev, and Aleksander Madry
URL https://arxiv.org/ abs/2402.06363. Benjamin Cohen-Wang, Harshay Shah, Kristian Georgiev, and Aleksander Madry. Contextcite: Attributing model generation to context. In NeurIPS,
-
[4]
URL https://arxiv.org/abs/2406.13352. Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, and Florian Tram `er. Defeating prompt injections by design,
-
[6]
ASCII Smuggler Tool: Crafting Invisible Text and Decoding Hidden Codes
Embrace The Red. ASCII Smuggler Tool: Crafting Invisible Text and Decoding Hidden Codes. https://embracethered.com/blog/posts/2024/ hiding-and-finding-text-with-unicode-tags/ , 2024a. Blog post – Posted on Jan 14,
work page 2024
-
[7]
GitHub Copilot Chat: From Prompt Injection to Data Exfiltration (Copirate)
Embrace The Red. GitHub Copilot Chat: From Prompt Injection to Data Exfiltration (Copirate). https://embracethered.com/blog/posts/2024/ github-copilot-chat-prompt-injection-data-exfiltration/ , 2024b. Blog post – Posted on Jun 14,
work page 2024
-
[8]
Gupta, Niloofar Mireshghallah, Taylor Berg- Kirkpatrick, and Earlence Fernandes
Xiaohan Fu, Zihan Wang, Shuheng Li, Rajesh K. Gupta, Niloofar Mireshghallah, Taylor Berg- Kirkpatrick, and Earlence Fernandes. Misusing tools in large language models with visual adversarial examples. CoRR, abs/2310.03185,
-
[9]
Goodside. I genuinely believe prompt engineering is the highest-leverage skill someone can learn in 2022, Sep 2022a. URL https://x.com/goodside/status/1569128808308957185. Tweet. Riley Goodside. Exploiting GPT-3 prompts with malicious inputs that order the model to ignore its previous directions. https://x.com/goodside/status/1569128808308957185, 2022b. D...
arXiv 2022
-
[12]
URL https://arxiv.org/abs/2406.00199. Shoaib Ahmed Siddiqui, Radhika Gaonkar, Boris K¨opf, David Krueger, Andrew Paverd, Ahmed Salem, Shruti Tople, Lukas Wutschitz, Menglin Xia, and Santiago Zanella-B´eguelin. Permis- sive information-flow analysis for large language models,
-
[13]
Joseph Spracklen, Raveen Wijewickrama, A H
URL https://arxiv.org/ abs/2410.03055. Joseph Spracklen, Raveen Wijewickrama, A H. M. Nazmus Sakib, Anindya Maiti, and Murtuza Jadliwala. We have a package for you! A comprehensive analysis of package hallucinations by code generating llms. ArXiv preprint,
Show all 20 references
-
[14]
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus
URL https://arxiv.org/abs/2406.10279. Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks,
-
[16]
Prompt injection attacks against GPT-3
Simon Willison. Prompt injection attacks against GPT-3. https://simonwillison.net/2022/ Sep/12/prompt-injection/,
2022
-
[17]
Delimiters won’t save you from prompt injection
Simon Willison. Delimiters won’t save you from prompt injection. https://simonwillison. net/2023/May/11/delimiters-wont-save-you/ , 2023a. 30 Simon Willison. The Dual LLM Pattern for Building AI Assistants That Can Resist Prompt Injection. https://simonwillison.net/2023/Apr/25...
2023
-
[18]
John Yang, Carlos E
URL https://arxiv.org/abs/2306.02224. John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineer- ing. In NeurIPS,
-
[19]
Traditional
URL https://arxiv.org/abs/2403.06833. A Best Practices for LLM Agent Security In conjunction with the system-level design patterns presented in Section 3, there are some general best practices that, ideally, are always considered when designing an AI agent. These are related t...
2024 arXiv
-
[2008]
Usability is crucial, as in the worst case, feedback is perceived as annoying, and provided information will not be read by the rater (Micallef et al., 2017)
should be avoided. Usability is crucial, as in the worst case, feedback is perceived as annoying, and provided information will not be read by the rater (Micallef et al., 2017). Orthogonally, the intersection of provided suggestions and human judgment is complex, with experts ...
2017
-
[2014]
Eric Wallace, Kai Xiao, Reimar Leike, Lilian Weng, Johannes Heidecke, and Alex Beutel
URL https://arxiv.org/abs/1312.6199. Eric Wallace, Kai Xiao, Reimar Leike, Lilian Weng, Johannes Heidecke, and Alex Beutel. The instruction hierarchy: Training LLMs to prioritize privileged instructions,
-
[2017]
URL https://doi.org/10.1145/3152771.3156139
ISBN 9781450353793. URL https://doi.org/10.1145/3152771.3156139. Shishir G. Patil, Tianjun Zhang, Xin Wang, and Joseph E. Gonzalez. Gorilla: Large language model connected with massive apis. In NeurIPS,
-
[2022]
ProtectAI.com
URL https://arxiv.org/abs/2211.09527. ProtectAI.com. Fine-tuned deberta-v3-base for prompt injection detection,
-
[2023]
Get my drift? catching llm task drift with activation deltas, 2025a
Sahar Abdelnabi, Aideen Fay, Giovanni Cherubin, Ahmed Salem, Mario Fritz, and Andrew Paverd. Get my drift? catching llm task drift with activation deltas, 2025a. URL https: //arxiv.org/abs/2406.00799. Sahar Abdelnabi, Amr Gomaa, Eugene Bagdasarian, Per Ola Kristensson, and Rez...
-
[2024]
Mislav Balunovic, Luca Beurer-Kellner, Marc Fischer, and Martin Vechev
URL https://arxiv.org/abs/2405.05175. Mislav Balunovic, Luca Beurer-Kellner, Marc Fischer, and Martin Vechev. AI agents with formal security guarantees. In ICML 2024 Next Generation of AI Safety Workshop,
2024 arXiv
-
[2025]
Embrace The Red
URL https://arxiv.org/abs/2503.18813. Embrace The Red. Hacking Google Bard: From Prompt Injection to Data Exfiltration. https: //embracethered.com/blog/posts/2023/google-bard-data-exfiltration/ ,
2023 arXiv
Reviewed August 7, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.