Render Before Reading: Visual Rendering as a Prompt Injection Defense
Jie Zhang, Andrei Baroian, Jan N. van Rijn, Avital Shafran, Florian Tramèr
Abstract
Large language models are vulnerable to prompt injection attacks, where third-party adversarial content can hijack the model's behavior. In this paper, we study the role played by the adversarial data's input modality, and identify a systematic asymmetry: multimodal LLMs are more likely to follow adversarial instruction when they appear as text than when the same instruction is delivered through a non-textual channel (e.g., as an image). We hypothesize that this modality gap arises from text-centric instruction tuning, which teaches models to obey textual instructions while treating other modalities mainly as content to parse or describe. We then demonstrate how this gap can be turned into a training-free defense, by rendering all untrusted payloads as typographic images (or audio) before they reach the model. Across ten models and two prompt injection benchmarks (DirectInject and AgentDojo) we show that our defense Pictionary consistently reduces attack success rates even against the strongest adaptive attacks and human red teamers, while largely preserving benign utility. We further show that benign fine-tuning on image-rendered instructions erodes the modality gap, tracing it to the text-centric instruction-tuning distribution.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
Related papers
AETHON: Deterministic Pre-Inference Defense for LLM Prompt Injection
Shared title terminologycs.CRLeonardo Bruscagini de Lima, Jorge Valverde-Rebaza, Alexandre de Barros Barreto et al.
CoDeL: Co-Evolutionary Defense against Indirect Prompt Injection in LLM-based Agents
Shared title terminologycs.CRXiao Yang, Yangchen Ou, Yuhan Gao et al.
Aligning Tool Descriptions and Implementations to Detect Prompt Injections in LLM Agents
Shared title terminologycs.CRJohnny Song, Shih-Chieh Dai, Guanhong Tao
Where Do LLMs Decide to Break the Rules? Mechanistic Localization of Prompt Injection Compliance
Shared title terminologycs.CRRui Wen, Jiayang Liu, Zeyu Yang et al.
pikit: A Composable Toolkit for Indirect Prompt Injection Research and Evaluation
Shared title terminologycs.CRZonghao Ying, Xiangfan Wu, Bo Yang et al.
CounterSteer: Suppressing Indirect Prompt Injection with Activation Steering
Shared title terminologycs.CRMark Russinovich