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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Novel GNN-based Approach for Detection of Prompt Injection Attacks

Robert Hercock, G. Jadhav, Amit Kumar Singh, Zeba Khanam
Network Security and Intrusion Detection
article

A Novel GNN-based Approach for Detection of Prompt Injection Attacks

Robert Hercock, G. Jadhav, Amit Kumar Singh, Zeba Khanam
article en

Abstract

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.

University of Essex (GB), BT Research (GB)
Openalex Percentile: Top 75%
Network Security and Intrusion Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A Novel GNN-based Approach for Detection of Prompt Injection Attacks — Robert Hercock, G. Jadhav, et al. · (2025) | TGRS Research Map | TGRS