vix.ing · top · new · best · stats · spec

PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features

2025/10/15 by Wei Zou, Yupei Liu, Zou, Wei +9 · 1 citation
Computer Science · #Advanced Malware Detection Techniques #Cryptographic Implementations and Security #Cryptography and Security (cs.CR) #FOS: Computer and information sciences #Machine Learning (cs.LG) #Security and Verification in Computing

paper · pdf · doi:10.48550/arxiv.2510.14005

openalex publication_date 2025/10/15 · openalex created_date 2025/10/18 · openalex updated_date 2026/07/28

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.

Citations

Cited by

Related