🤖 AI Summary
To address prompt injection attacks threatening large language model (LLM)-powered web applications, this paper systematically constructs the first high-quality, real-world-oriented prompt injection benchmark dataset—enhanced from the HackAPrompt Playground—and empirically evaluates four classifier families: LSTM, feedforward neural networks, random forests, and naive Bayes. We propose a lightweight detection framework integrating data augmentation and binary classification, achieving significant improvements in detection accuracy and cross-scenario generalization while maintaining low inference overhead. Our key contributions are: (1) the first publicly released, high-fidelity prompt injection benchmark dataset; (2) an empirical characterization of performance boundaries of diverse detectors under realistic deployment conditions; and (3) a plug-and-play, low-latency security module that enables real-time defense—providing actionable, production-ready safeguards for securing LLM-integrated applications.
📝 Abstract
Prompt injection attacks can compromise the security and stability of critical systems, from infrastructure to large web applications. This work curates and augments a prompt injection dataset based on the HackAPrompt Playground Submissions corpus and trains several classifiers, including LSTM, feed forward neural networks, Random Forest, and Naive Bayes, to detect malicious prompts in LLM integrated web applications. The proposed approach improves prompt injection detection and mitigation, helping protect targeted applications and systems.