mlsanityData to 7 Oct 2026

PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features

arXiv 2510.14005 ↗First posted 15 Oct 2025cs.CR cs.LGcited by 13

On the map: LLM safety and security → Prompt injection and agent security

Abstract (arXiv)

LLM-integrated applications are vulnerable to prompt injection attacks, where an attacker contaminates the input to inject malicious instructions, causing the LLM to follow the attacker's intent instead of the original user's. Existing prompt injection detection methods often have sub-optimal performance and/or high computational overhead. In this work, we propose PIShield, an effective and efficient detection method based on the observation that instruction-tuned LLMs internally encode distinguishable signals for prompts containing injected instructions. PIShield leverages residual-stream representations and a simple linear classifier to detect prompt injection, without expensive model fine-tuning or response generation. We conduct extensive evaluations on a diverse set of short- and long-context benchmarks. The results show that PIShield consistently achieves low false positive and false negative rates, significantly outperforming existing baselines. These findings demonstrate that internal representations of instruction-tuned LLMs provide a powerful and practical foundation for prompt injection detection in real-world applications.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 53 of its 81 references that are in the map. First posted on arXiv 15 Oct 2025.

Builds on

53 of 81 references.

Closest ancestors · 24

Same direction, newest first

  1. 2025PromptLocate: Localizing Prompt Injection Attacks14 Oct
  2. 2025SecInfer: Preventing Prompt Injection via Inference-time Scaling29 Sep
  3. 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
  4. 2025Progent: Securing AI Agents with Privilege Control16 Apr
  5. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attacks15 Apr
  6. 2025Defeating Prompt Injections by Design24 Mar
  7. 2025PromptShield: Deployable Detection for Prompt Injection Attacks25 Jan
  8. 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMs1 Nov
  9. 2024InjecGuard: Benchmarking and Mitigating Over-defense in Prompt Injection Guardrail Models30 Oct
  10. 2024Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchy9 Oct
  11. 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
  12. 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspective27 Sep
12 more
  1. 2024Get my drift? Catching LLM Task Drift with Activation Deltas2 Jun
  2. 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions19 Apr
  3. 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Models19 Apr
  4. 2024Optimization-based Prompt Injection Attack to LLM-as-a-Judge26 Mar
  5. 2024Automatic and Universal Prompt Injection Attacks against Large Language Models7 Mar
  6. 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attacks6 Mar
  7. 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
  8. 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuning29 Dec
  9. 2023Tensor Trust: Interpretable Prompt Injection Attacks from an Online Game2 Nov
  10. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defenses19 Oct
  11. 2023Prompt Packer: Deceiving LLMs through Compositional Instruction with Hidden Attacks16 Oct
  12. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb

Other references · 29

  1. 2017Attention Is All You Needcited by 59,932
  2. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  3. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  4. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  5. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  6. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  7. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  8. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
  9. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  10. 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
  11. 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,009
  12. 2018Neural Network Acceptability Judgmentscited by 952
17 more
  1. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 893
  2. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  3. 2017Automated Hate Speech Detection and the Problem of Offensive Languagecited by 724
  4. 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 608
  5. 2017The NarrativeQA Reading Comprehension Challengecited by 590
  6. 2023Detecting Language Model Attacks with Perplexitycited by 411
  7. 2015A Neural Attention Model for Abstractive Sentence Summarizationcited by 394
  8. 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 251
  9. 2024Safety Layers in Aligned Large Language Models: The Key to LLM Securitycited by 126
  10. 2024PLeak: Prompt Leaking Attacks against Large Language Model Applicationscited by 113
  11. 2025Securing AI Agents with Information-Flow Controlcited by 108
  12. 2017JFLEG: A Fluency Corpus and Benchmark for Grammatical Error Correctioncited by 96
  13. 2025Prompt Flow Integrity to Prevent Privilege Escalation in LLM Agentscited by 81
  14. 2022Evaluating the Susceptibility of Pre-Trained Language Models via Handcrafted Adversarial Examplescited by 65
  15. 2024What Features in Prompts Jailbreak LLMs? Investigating the Mechanisms Behind Attackscited by 24
  16. 2024Legilimens: Practical and Unified Content Moderation for Large Language Model Servicescited by 13
  17. 2025TracLLM: A Generic Framework for Attributing Long Context LLMscited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 13.

13 papers.

Sort:

By area: