doi: 10.7763/IJCTE.2026.V18.1408
AI-Guard: A Dual-feature Fusion Framework for Mitigating Direct and Indirect Prompt Injections in RAG Systems
- 1Department of Computer Engineering, Biruni University, Istanbul, Türkiye
- 2Department of Computer Engineering, Loyola University Chicago, Chicago, USA
- 3Department of Computer Engineering, Fatih Sultan Mehmet Vakif University, Istanbul, Türkiye
- Manuscript receivedJuly 19, 2026
- revisedAugust 21, 2026
- acceptedAugust 31, 2026
- publishedNovember 10, 2026
Abstract
Retrieval-Augmented Generation (RAG) systems have greatly increased the capabilities of Large Language Models (LLMs) by allowing them to access and use information from external knowledge sources. However, this advantage also introduces new security risks, one of which is named the “Blind Trust” vulnerability, where malicious instructions are hidden in retrieved content that can influence the behavior of the LLM through direct or indirect prompt injection attacks. To address this problem, we proposed an AI-Guard mechanism, in which intelligent firewall architecture is con-structed to examine incoming requests before they reach the LLM and block the system. The proposed system was constructed with a machine learning approach, and it was trained on a balanced dataset containing approximately 70,000 samples and combined Term Frequency-Inverse Document Frequency (TF-IDF)-based text representations with handcrafted lexical features to better identify malicious patterns. To evaluate its effectiveness, several traditional machine learning and deep learning models were implemented by using 5-Fold stratified cross-validation. Among all evaluated models, the LightGBM model achieved the highest results, obtaining an F1-score of 98.68% and a Recall of 99.66% for the injection class, resulting in a very low false negative rate of only 0.33%. As a deep learning model, One-Dimensional Convolutional Neural Network (1D-CNN) model produced strong results by achieving an F1-score of 97.52%. Instead of merely permitting or refusing the request, AI-Guard employs a three-tiered mechanism, which includes Allow, Sanitize, and Block operations, thus enabling it to minimize the level of security threats while maintaining the normal operation of the RAG system. Furthermore, the adversarial experiments conducted through character substitution attacks have proven that the proposed framework is highly resistant against such kinds of obfuscation-based attacks.
Keywords
- Retrieval-Augmented Generation (RAG)
- prompt injection
- artificial intelligence firewall
- feature fusion
- LLM
How to Cite
Gokay Mutlu, Nese Rihani, Ozgur Koray Sahingoz, Gozde Karatas Baydogmus, and Esra Calik Bayazit, "AI-Guard: A Dual-feature Fusion Framework for Mitigating Direct and Indirect Prompt Injections in RAG Systems," International Journal of Computer Theory and Engineering, vol. 18, no. 4, pp. 287-294, 2026. https://doi.org/10.7763/IJCTE.2026.V18.1408
Copyright & License
Copyright © 2026 by the authors. This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).