A Deep Learning Framework for Evaluating and Mitigating Prompt Injection in LLM Agents
DOI:
https://doi.org/10.56979/1201/2026/1552Keywords:
Prompt Injection, Large Language Models, Agent Security, Deep LearningAbstract
In the world of large language models (LLMs), prompt injection attacks are a severe security risk that can circumvent the instructions given to AI agents and potentially cause damage. In agentic architectures, the vulnerabilities are magnified because of the increased attack surfaces which are present in the use of tools, APIs and chains of reasoning. The vulnerabilities are compounded in agentic architectures as the tools used, APIs called, and chains of reasoning become a larger attack surface, resulting in an increased sense of unreliability. Paraphrased, adaptive, and context-aware attacks are not thwarted by rule-based and static prompt engineering defenses. This paper introduces a deep learning-based approach to detecting and thwarting prompt injection attacks in LLM agent systems. Uses a hybrid model of known and customer-generated adversarial prompts to combine transformer-based classification, semantic risk-scoring and adaptive mitigation procedures. Stratified data splits are used in the experiments, as are synthetic attack generation and rule-based, BERT and zero-shot LLM classifiers. In terms of precision, recall, F1 score and AUC, the proposed framework is found to be better than all the baselines. Attack of instruction override, data extraction and tool misuse are greatly enhanced and resistant to adversarial scenarios that are not seen and adaptable. The mitigation module achieves high task utility; low false positive rates and the high success rate of the attacks is significantly reduced. Overall, the framework demonstrates that it is possible to integrate detection, risk estimation, and mitigation in a single pipeline, resulting in a great improvement in the security of LLM agents, while not burdening them with significant computing costs. It further highlights the importance of security layers before deploying LLM agents to the real world as the input they receive can be adversarial and continuously change, requiring a mixture of machine learning and structured control to ensure they remain safe and reliable across different application areas. Scalable AI systems deployment safety improvements involve multi-agent security, real-time learning, and multimodal prompt injection detection in the future.
Downloads
Published
How to Cite
Issue
Section
License
This is an open Access Article published by Research Center of Computing & Biomedical Informatics (RCBI), Lahore, Pakistan under CCBY 4.0 International License




