A Novel GNN-based Approach for Detection of Prompt Injection Attacks
Prompt injection attacks manipulate language model inputs to bypass intended constraints, extract sensitive information, or generate misleading responses, posing a significant security risk in real-world applications. To address this challenge, we propose a Graph Neural Network (GNN)based approach that integrates sentiment features and Bidirectional Encoder Representations from Transformers (BERT) embeddings to effectively detect malicious prompt injections. By transforming textual data into structured graph representations, our approach captures both semantic and contextual relationships that conventional models often overlook. We evaluated our approach against traditional machine learning techniques, including Random Forest, Logistic Regression, and XGBoost, demonstrating its superior performance. Experimental results show that our approach achieves a high detection accuracy of $98.70 \%$ and an F1-score of 0.9799, significantly outperforming conventional methods. Additionally, we provide an in-depth analysis of computational efficiency, highlighting the trade-offs between detection effectiveness and model complexity, ensuring a practical balance between security and performance.
Authors
- Robert Hercock
- G. Jadhav
- Amit Kumar Singh (ORCID: https://orcid.org/0000-0001-7359-2068)
- Zeba Khanam (ORCID: https://orcid.org/0000-0002-2886-683X)
Institutions
- University of Essex (GB)
- BT Research (GB)
Publication Details
- Published
- 2025-08-04
- DOI
- https://doi.org/10.1109/csr64739.2025.11130138
- Primary Topic
- Network Security and Intrusion Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00