Design and Evaluation of Multilayered Guardrails for Securing Large Language Model and Retrieval Augmented Generation Based Employee Recruitment Chatbots
DOI:
https://doi.org/10.52436/1.jutif.2026.7.5.5761Keywords:
AI Security, Chatbot, Jailbreak Injection, Large Language Model, Multilayered Guardrails, Prompt Injection, Retrieve Augmented GenerationAbstract
Large Language Models (LLM) deployed in sensitive public services, particularly staff selection chatbot systems, are critically vulnerable to prompt injection and jailbreak attacks, yet existing guardrail solutions remain homogeneous and prone to single points of failure. This research designs, implements, and evaluates a novel multi-layered guardrail architecture based on a defence-in-depth strategy, systematically integrated across the input, retrieval, and output stages of a Retrieval-Augmented Generation (RAG) pipeline. A comparative experimental study was conducted, benchmarking the proposed architecture against state-of-the-art baselines, Llama Guard and NeMo Guardrails, across security and performance metrics. The proposed architecture achieved a Harmful Refusal Rate of 99.5% and demonstrated confirmed robustness against prompt injection, jailbreak, and data leakage vectors as validated by the Garak Vulnerability Scanner. Despite the inherent latency trade-off of layered processing, the system maintained superior efficiency with a median latency of 8.29 seconds, outperforming Llama Guard (8.80 s) and NeMo Guardrails (8.56 s). These findings establish that a defence-in-depth guardrail approach delivers an optimal balance between security and performance, and contribute a replicable architectural framework to the field of AI security for hardening LLM-RAG systems in high-stakes, public-sector deployments.
Downloads
References
M. Ma’rup, Tobirin, and A. Rokhman, “Utilization of Artificial Intelligence (AI) Chatbots in Improving Public Services: A Meta-Analysis Study,” Open Access Indones. J. Soc. Sci., vol. 7, no. 4, 2024, doi: 10.37275/oaijss.v7i4.255.
T.-L. Chen, M. Gascó-Hernández, and M. Esteve, “The Adoption and Implementation of Artificial Intelligence Chatbots in Public Organizations: Evidence from U.S. State Governments,” Am. Rev. Public Adm., vol. 54, no. 3, pp. 255–270, Apr. 2024, doi: 10.1177/02750740231200522.
S. G. Ayyamperumal and L. Ge, “Current state of LLM risks and AI guardrails,” arXiv preprint arXiv:2406.12934, 2024. [Online]. Available: https://doi.org/10.48550/arXiv.2406.12934.
B. Ni et al., “Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Survey,” in arXiv Prepr., 2025, doi: 10.48550/arXiv.2502.06872.
B. An, S. Zhang, and M. Dredze, “RAG LLMs are Not Safer: A Safety Analysis of Retrieval-Augmented Generation for Large Language Models,” in arXiv Prepr., 2025, doi: 10.48550/arXiv.2504.18041.
S. Zeng et al., “The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG),” in Findings of the Association for Computational Linguistics (ACL), 2024, pp. 4505–4524, doi: 10.18653/v1/2024.findings-acl.267.
L. Ammann, S. Ott, C. R. Landolt, and M. P. Lehmann, “Securing RAG: A Risk Assessment and Mitigation Framework,” in IEEE Swiss Conference on Data Science (SDS), 2025, doi: 10.1109/SDS66131.2025.00024.
Y. Dong et al., “Position: Building guardrails for large language models requires systematic design,” in Proceedings of the 41st International Conference on Machine Learning (ICML), 2024, vol. 451, pp. 11375–11394, doi: 10.5555/3692070.3692521.
J. B. Hakim et al., “The need for guardrails with large language models in pharmacovigilance and other medical safety-critical settings,” Sci. Rep., vol. 15, 2025, doi: 10.1038/s41598-025-09138-0.
Y. Dong et al., “Safeguarding large language models: A survey,” Artif. Intell. Rev., vol. 58, p. 382, 2025, doi: 10.1007/s11062-025-11389-2.
M. Shamsujjoha, Q. Lu, D. Zhao, and L. Zhu, “Swiss Cheese Model for AI Safety: A Taxonomy and Reference Architecture for Multi-Layered Guardrails of Foundation Model–Based Agents,” in Proceedings of the 22nd International Conference on Software Architecture (ICSA), 2025, doi: 10.1109/ICSA65012.2025.00014.
S. Han and S. Avestimehr, “Bridging the safety gap: A guardrail pipeline for trustworthy LLM inferences,” arXiv Prepr., 2025, doi: 10.48550/arXiv.2502.08142.
O. Shvetsova, D. Katalshov, and S.-K. Lee, “Innovative guardrails for generative AI: Designing an intelligent filter for safe and responsible LLM deployment,” Appl. Sci., vol. 15, no. 13, p. 7298, 2025, doi: 10.3390/app15137298.
S. Chennabasappa et al., “LlamaFirewall: An open source guardrail system for building secure AI agents,” arXiv Prepr., 2025, doi: 10.48550/arXiv.2505.03574.
H. Abdelkader et al., “Safeguarding LLM-applications: Specify or train?,” in Proceedings of the 4th International Conference on AI Engineering – Software Engineering for AI (CAIN), 2025, doi: 10.1109/CAIN66642.2025.00047.
Z. Chu, Y. Wang, L. Li, Z. Wang, Z. Qin, and K. Ren, “A causal explainable guardrails for large language models,” in Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2024, doi: 10.1145/3658644.3690217.
P. Rai, S. Sood, V. K. Madisetti, and A. Bahga, “GUARDIAN: A multi-tiered defense architecture for thwarting prompt injection attacks on LLMs,” J. Softw. Eng. Appl., vol. 17, pp. 43–68, 2024, doi: 10.4236/jsea.2024.171003.
Z. Yuan et al., “RigorLLM: Resilient guardrails for large language models against undesired content,” in Proceedings of the 41st International Conference on Machine Learning (ICML), 2024, vol. 235, pp. 57953–57965, doi: 10.5555/3692070.3694461.
R. Dayarathne, U. Ranaweera, and U. Ganegoda, “Comparing the performance of LLMs in RAG-based question-answering: A case study in computer science literature,” arXiv Prepr., 2025, doi: 10.48550/arXiv.2511.03261.
A. Q. Jiang et al., “Mistral 7B,” arXiv Prepr., 2023, doi: 10.48550/arXiv.2310.06825.
S. Knollmeyer, O. Caymazer, and D. Grossmann, “Document GraphRAG: Knowledge graph enhanced retrieval augmented generation for document question answering within the manufacturing domain,” Electronics, vol. 14, no. 11, p. 2102, 2025, doi: 10.3390/electronics14112102.
L. Wang et al., “Multilingual E5 text embeddings: A technical report,” arXiv Prepr., 2024, doi: 10.48550/arXiv.2402.05672.
R. N. Pushpa, S. G. Walke, D. Sharadhi, P. K. Sharvari, and C. S. Shreya, “AI powered legal querying system using NLP,” Int. J. Res. Appl. Sci. Eng. Technol. (IJRASET), 2024, doi: 10.22214/ijraset.2024.65895.
L. Stuhlmann, M. A. Saxer, and J. Furst, “Efficient and reproducible biomedical question answering using retrieval augmented generation,” in 2025 IEEE Swiss Conference on Data Science (SDS), 2025, doi: 10.1109/SDS66131.2025.00029.
W. Hackett, L. Birch, S. Trawicki, N. Suri, and P. Garraghan, “Bypassing LLM guardrails: An empirical analysis of evasion attacks against prompt injection and jailbreak detection systems,” arXiv Prepr., 2025, doi: 10.48550/arXiv.2504.11168.
G. Kumbhat and E. Ju, “Serving LLMs as detectors in workflows with guardrails,” in 22nd International Conference on Software Architecture Companion (ICSA-C), 2025, doi: 10.1109/ICSA-C65153.2025.00075.
X. Wang et al., “SoK: Evaluating jailbreak guardrails for large language models,” arXiv Prepr., 2025, doi: 10.48550/arXiv.2506.10597.
T. Shi, R. A. McCann, Y. Huang, W. Wang, and J. Kong, “Malware detection for Internet of Things using one-class classification,” Sensors, vol. 24, p. 4122, 2024, doi: 10.3390/s24134122.
A. F. Alqahtani and M. Ilyas, “An ensemble-based multi-classification machine learning classifiers approach to detect multiple classes of cyberbullying,” Mach. Learn. Knowl. Extr., vol. 6, pp. 156–170, 2024, doi: 10.3390/make6010009.
Y. Wang, H. Li, X. Han, P. Nakov, and T. Baldwin, “Do-not-answer: A dataset for evaluating safeguards in LLMs,” arXiv Prepr., 2023, doi: 10.48550/arXiv.2308.13387.
E. Yu et al., “CoSafe: Evaluating large language model safety in multi-turn dialogue coreference,” in Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2024, pp. 17494–17508.
N. Rajan, “LLM red teaming dataset: A comprehensive collection for AI safety research,” 2025. [Online]. Available: https://github.com/NaviRocker/llm-red-teaming-dataset (accessed Apr. 2, 2026).
X. Qi et al., “Fine-tuning aligned language models compromises safety, even when users do not intend to!,” in Proceedings of the International Conference on Learning Representations (ICLR), 2024.
X. Shen, Z. Chen, M. Backes, Y. Shen, and Y. Zhang, “‘Do anything now’: Characterizing and evaluating in-the-wild jailbreak prompts on large language models,” in Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2024, doi: 10.1145/3658644.3670388.
T. L. Żarski and A. Janicki, “Enhancing privacy while preserving context in text transformations by large language models,” Information, vol. 16, no. 49, 2025, doi: 10.3390/info16010049.
Y. Bestgen, “Please, Don’t Forget the Difference and the Confidence Interval when Seeking for the State-of-the-Art Status,” in Proceedings of the 13th Conference on Language Resources and Evaluation (LREC 2022), Marseille, Jun. 20-25, 2022, pp. 5956–5962. [Online]. Available: https://aclanthology.org/2022.lrec-1.640/
H. Oosterhuis, R. Jagerman, Z. Qin, X. Wang, and M. Bendersky, “Reliable Confidence Intervals for Information Retrieval Evaluation Using Generative A.I.,” in Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD '24), Barcelona, Spain, Aug. 2024, pp. 2275–2286, doi: 10.1145/3637528.3671883.
B. C. Das, M. H. Amini, and Y. Wu, “Security and Privacy Challenges of Large Language Models: A Survey,” ACM Comput. Surv., vol. 57, no. 6, art. no. 152, pp. 1–39, Feb. 2025, doi: 10.1145/3712001.
M. Q. Li and B. C. M. Fung, “Security concerns for Large Language Models: A survey,” J. Inf. Secur. Appl., vol. 95, p. 104284, Dec. 2025, doi: 10.1016/j.jisa.2025.104284.
S. T. Garren and G. H. Davenport, “Using Kurtosis for Selecting One-Sample T-Test or Wilcoxon Signed-Rank Test,” Curr. J. Appl. Sci. Technol., vol. 41, no. 18, pp. 46–55, Jun. 2022, doi: 10.9734/cjast/2022/v41i1831737.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Angga Pratama, Kalamullah Ramli

This work is licensed under a Creative Commons Attribution 4.0 International License.

</a



