# PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features

Source: [PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features](<https://www.sota2.com/research/paper/68fa7c451e209131cea8d4c4>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-28T05:00:08.385Z

Authors: Wei Zou, Yupei Liu, Yanting Wang, Ying Chen, Neil Gong, Jinyuan Jia

Published: 2025-10-15T18:34:49.000Z

## Abstract

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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Multimodal Attack Detection on Multimodal attack detection (test)](<https://www.sota2.com/research/sota/multimodal-attack-detection-on-multimodal-attack-detection-test.md>): Multimodal Attack Detection; Multimodal attack detection (test); Precision: 57.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2510.14005>)

[PDF](<https://arxiv.org/pdf/2510.14005.pdf>)
