Skip to content
Open access

D2ANN-RL: Defense-in-Depth ANN-Reinforcement Learning Framework for LLM Chatbot Code Injection Mitigation

Aug 2026 · Scientific Journal of Computer Science · 0 citations · 55 references

TL;DR

A D2ANN-RL framework that integrates input/output sanitization, context isolation, sandboxing, and secure prompt engineering, supported by hybridization of Artificial Neural Network (ANN)–Reinforcement Learning (RL) detection model is introduced.

Abstract

The growing cybersecurity vulnerabilities in artificial intelligence (AI) service models, particularly Large Language Models (LLMs), highlight code injection as a critical threat to chatbot reliability and safe deployment. On the account that LLMs process inputs as undifferentiated token sequences, they cannot reliably distinguish trusted system prompts from untrusted user inputs. This architectural limitation enables attackers to exploit direct and indirect prompt injection channels, resulting in insecure code generation, altered execution flows, and potential data exfiltration or remote code execution. In mission critical environments such as cloud platforms, IoT ecosystems, and defense systems, these risks escalate into unauthorized access and operational compromise. To address this challenge, the present study introduced a D2ANN-RL framework that integrates input/output sanitization, context isolation, sandboxing, and secure prompt engineering, supported by hybridization of Artificial Neural Network (ANN)–Reinforcement Learning (RL) detection model. The ANN component ensures robust feature extraction, while RL dynamically adapts defense strategies to evolving adversarial vectors. Computational evaluation demonstrates the framework’s effectiveness, achieving 96.95% detection accuracy, precision of 96.9%, recall of 97%, and F-Score of 96.95%. The Defense Performance Index (DPI) reached 84.9%, validating model resilience, scalability, and balanced classification integrity. These findings highlight the broader implications of deploying transparent, adaptive, and generalizable safeguards for LLM based chatbot systems, advancing secure AI integration and mitigating systemic vulnerabilities in mission critical operations.

Read PDF

Similar papers

Preprint Aug 2026

SecOPD: Mitigating Adaptive Prompt Injections by On-Policy Distillation

This paper proposes Secure On-Policy Distillation (SecOPD) that provides token-level feedback to guide defensive fine-tuning, and generalizes to domains completely unseen in training.

Yibo Peng, Long Lian, David A. Wagner et al. · 5 citations · ⚡1
2026

Cyber Task Automation With Knowledge-Infused Reinforcement Learning and LLM-Guided Policies

As cyber threats continue to evolve, there is a need for Autonomous Cyber Defense (ACD) strategies capable of fast and context-aware responses. Reinforcement learning (RL) has shown promise in automating cyber defense by exploring and learning effective countermeasures. However, RL often struggles with sparse reward si...

Md. Shamim Towhid, Shahrear Iqbal, E. C. Pinto et al. · 0 citations
Conference Aug 2026

LSTM-PPO: A Hybrid Deep Reinforcement Learning Framework with Asymmetric Reward Engineering for Real-Time Intrusion Detection in IIoT and SCADA Networks

The integration of SCADA systems with the Industrial Internet of Things (IIoT) has dramatically expanded the attack surface of critical infrastructure. Traditional intrusion detection systems (IDS) struggle with evolving threats, class imbalance (attack samples often <5%), and real-time constraints (<100 ms). Deep rein...

Al-Abass Al-Alousi, Mohammed Y. Magnam · 0 citations
#artificial intelligence Preprint Aug 2026

CAITLYN: Can LLM Agents Autonomously Synthesize Defenses against Emerging Injection Attacks?

This work proposes Continuous Agents for Injection Threats via Lifelong Yielding Nexus (CAITLYN), an agent-agnostic defense middleware that matches the detection performance of state-of-the-art defenses at lower token overhead than LLM-as-a-judge baselines.

Zi Liang, XiaoYu Xu, Yanyun Wang et al. · 1 citation
Review Open access 2026

Large Language Model-Assisted Threat-Driven Testing System for Enhanced Cybersecurity Readiness

The proposed Large Language Model-Assisted Threat-Driven Testing System enables security teams, particularly resource-constrained organizations lacking dedicated red-team capabilities, to conduct high-fidelity threat simulation exercises aligned with current adversarial TTPs, without specialized AI expertise, thereby s...

Praise Emeka Nze, A. Ademuwagun, Muktar Bello et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.