SecureContext EDU: An Open Source University Assistant using Dual - LLM Architecture
Abstract
Chatbots powered by LLMs have become popular due to their scalability and instant reply feature. There can be many security issues associated with LLM-based chatbots, which emerge in the interaction between the LLM-based model and other software components. One major problem is that chatbots can be attacked using prompt injection, jailbreaks, and harmful queries. These attacks can change the chatbot behavior and may lead to wrong answers or leakage of sensitive information. This makes security very important in such systems. Existing methods improve the chatbot performance using techniques like modular design, Retrieval-Augmented Generation (RAG) and input filtering for security. However, most of these methods use a single model and do not have strong real-time protection, making them weak against advanced attacks. Hence, this work proposes a Dual-LLM architecture where security is handled as a separate component for protection against real time threats. A classification model is designed to check the user input queries using threat categories and a confidence score is evaluated to block the harmful inputs. Only safe queries are sent to the response model, which uses a controlled RAG system to generate accurate answers. The system is built as a step-by-step pipeline combining classification and response generation. The results show an accuracy of 90% in detecting threats which leads to reduction of unsafe responses.