Lune

S&P2026Top-tier venue

PromptLocate: Localizing Prompt Injection Attacks

Yuqi Jia, Yupei Liu, Zedian Shao, Jinyuan Jia, Neil Zhenqiang Gong

Abstract

Prompt injection attacks deceive a large language model into completing an attacker-specified task instead of its intended task by contaminating its input data with an injected prompt, which consists of injected instruction(s) and data. Localizing the injected prompt within contaminated data is crucial for post-attack forensic analysis and data recovery. Despite its growing importance, prompt injection localization remains largely unexplored. In this work, we bridge this gap by proposing PromptLocate, the first method for localizing injected prompts. PromptLocate comprises three steps: (1) splitting the contaminated data into semantically coherent segments, (2) identifying segments contaminated by injected instructions, and (3) pinpointing segments contaminated by injected data. We show PromptLocate accurately localizes injected prompts across eight existing and eight adaptive attacks. Our code and data are available at: https://github. com/liu00222/Open-Prompt-Injection.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • LocalAlign: Enabling Generalizable Prompt Injection Defense via Generation of Near-Target Adversarial Examples for Alignment Training cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • RedVisor: Reasoning-Aware Prompt Injection Defense via Zero-Copy KV Cache Reuse cites Optimization-based Prompt Injection Attack to LLM-as-a-Judge
  • Measuring Real-World Prompt Injection Attacks in LLM-based Resume Screening cites PLeak: Prompt Leaking Attacks against Large Language Model Applications
  • Measuring Real-World Prompt Injection Attacks in LLM-based Resume Screening cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Measuring Real-World Prompt Injection Attacks in LLM-based Resume Screening cites Optimization-based Prompt Injection Attack to LLM-as-a-Judge
  • Measuring Real-World Prompt Injection Attacks in LLM-based Resume Screening cites Prompt Injection Attack to Tool Selection in LLM Agents
  • Measuring Real-World Prompt Injection Attacks in LLM-based Resume Screening cites ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data
  • AttnTrace: Contextual Attribution of Prompt Injection and Knowledge Corruption cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • PLeak: Prompt Leaking Attacks against Large Language Model Applications cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Optimization-based Prompt Injection Attack to LLM-as-a-Judge cites PLeak: Prompt Leaking Attacks against Large Language Model Applications
  • Optimization-based Prompt Injection Attack to LLM-as-a-Judge cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Prompt Injection Attack to Tool Selection in LLM Agents cites PLeak: Prompt Leaking Attacks against Large Language Model Applications
  • Prompt Injection Attack to Tool Selection in LLM Agents cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Prompt Injection Attack to Tool Selection in LLM Agents cites Optimization-based Prompt Injection Attack to LLM-as-a-Judge
  • ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data cites PLeak: Prompt Leaking Attacks against Large Language Model Applications
  • ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data cites Optimization-based Prompt Injection Attack to LLM-as-a-Judge
  • ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data cites Prompt Injection Attack to Tool Selection in LLM Agents
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source DataReachal Wang, Yuqi Jia, Neil Zhenqiang GongNDSS 2026 · 24 citations
  2. AttnTrace: Contextual Attribution of Prompt Injection and Knowledge CorruptionYanting Wang, Runpeng Geng, Ying Chen, Jinyuan JiaS&P 2026 · 6 citations
  3. Measuring Real-World Prompt Injection Attacks in LLM-based Resume ScreeningMohan Zhang, Yuqi Jia, Zhen Tan, Steven Jiang et al.USENIX Security 2026 · 4 citations
  4. RedVisor: Reasoning-Aware Prompt Injection Defense via Zero-Copy KV Cache ReuseMingrui Liu, Sixiao Zhang, Cheng Long, Kwok Yan LamICML 2026 · 2 citations
  5. LocalAlign: Enabling Generalizable Prompt Injection Defense via Generation of Near-Target Adversarial Examples for Alignment TrainingYuyang Gong, Zihao Wang, Jiawei Liu, XiaoFeng WangCCS 2026 · 1 citation

Builds on13

  1. Formalizing and Benchmarking Prompt Injection Attacks and DefensesYupei Liu, Yuqi Jia, Runpeng Geng, Jinyuan Jia et al.USENIX Security 2024 · 308 citations
  2. Prompt Injection Attack to Tool Selection in LLM AgentsJiawen Shi, Zenghui Yuan, Guiyao Tie, Pan Zhou et al.NDSS 2026 · 181 citations
  3. Making Monolingual Sentence Embeddings Multilingual using Knowledge DistillationNils Reimers, Iryna GurevychEMNLP 2020 · 54 citations
  4. Optimization-based Prompt Injection Attack to LLM-as-a-JudgeJiawen Shi, Zenghui Yuan, Yinuo Liu, Yue Huang et al.CCS 2024 · 33 citations
  5. PLeak: Prompt Leaking Attacks against Large Language Model ApplicationsBo Hui, Haolin Yuan, Neil Gong, Philippe Burlina et al.CCS 2024 · 28 citations

Related papers

  1. Can Indirect Prompt Injection Attacks Be Detected and Removed?Yulin Chen, Haoran Li, Yuan Sui, Yufei He et al.ACL 2025
  2. DataSentinel: A Game-Theoretic Detection of Prompt Injection AttacksYupei Liu, Yuqi Jia, Jinyuan Jia, Dawn Song et al.S&P 2025
  3. Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought LearningZhiyuan Chang, Mingyang Li, Yuekai Huang, Ziyou Jiang et al.ACL Findings 2026
  4. TopicAttack: An Indirect Prompt Injection Attack via Topic TransitionYulin Chen, Haoran Li, Yuexin Li, Yue Liu et al.EMNLP 2025 · 1 citation
  5. Tensor Trust: Interpretable Prompt Injection Attacks from an Online GameSam Toyer, Olivia Watkins, Ethan Adrian Mendes, Justin Svegliato et al.ICLR 2024 · 123 citations
Dusk over the sea between two cliffs drawn in fine vertical lines