Scientific Journal of Computer Science
Vol. 2 No. 2 (2026): December (Article in Process)

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

Victor Omoboye Oluwasegun (University of Roehampton)
Oluwatosin Samuel Falebita (Colorado State University)
Nabeela Temitayo Adebola (University of Salford)
Victor Aduragbemi Adekunle (University of Ilorin)
Divine Chukwuemeka Uzodinma (Cyblack Cybersecurity)
Toluhi Michael Lanre (University of Salford)
David Oyewumi Oyekunle (University of Salford)
Chima-Duru Goodness Goziechukwu (Caritas University)
Ugochukwu Okwudili Matthew (Federal University of Lavras)



Article Info

Publish Date
02 Aug 2026

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.

Copyrights © 2026






Journal Info

Abbrev

sjcs

Publisher

Subject

Computer Science & IT

Description

The Scientific Journal of Computer Science (SJCS) (e-ISSN: 3110-3170) is a peer-reviewed and open-access scientific journal, managed and published by PT. Teknologi Futuristik Indonesia in collaboration with Universitas Qamarul Huda Badaruddin Bagu and Peneliti Teknologi Teknik Indonesia. The SJCS ...