Dual-Role Evaluation of Large Language Models in Cybersecurity: A Unified Framework for Offensive Generation and Defensive Intelligence
Journal of Engineering Research and Sciences, Volume 5, Issue 11, Page # 96-118, 2026; DOI: 10.55708/js0511007
Keywords: Large Language Models, Adversarial AI, Dual-Role Evaluation, Threat Detection
(This article belongs to the Special Issue on Special Issue on Multidisciplinary Sciences & Advanced Technology (SI-MSAT 2026) and the Section Artificial Intelligence – Computer Science (AIC))
Export Citations
Cite
Tiwari, V. , Suaifan, O. and Othman, R. (2026). Dual-Role Evaluation of Large Language Models in Cybersecurity: A Unified Framework for Offensive Generation and Defensive Intelligence. Journal of Engineering Research and Sciences, 5(11), 96–118. https://doi.org/10.55708/js0511007
Vaibhavi Tiwari, Ola Suaifan and Ramy Othman. "Dual-Role Evaluation of Large Language Models in Cybersecurity: A Unified Framework for Offensive Generation and Defensive Intelligence." Journal of Engineering Research and Sciences 5, no. 11 (November 2026): 96–118. https://doi.org/10.55708/js0511007
V. Tiwari, O. Suaifan and R. Othman, "Dual-Role Evaluation of Large Language Models in Cybersecurity: A Unified Framework for Offensive Generation and Defensive Intelligence," Journal of Engineering Research and Sciences, vol. 5, no. 11, pp. 96–118, Nov. 2026, doi: 10.55708/js0511007.
The rapid advancement of large language models (LLMs) is reshaping cybersecurity by strengthening defensive capabilities while simultaneously enabling increasingly sophisticated offensive threats. Despite this dual-use nature, existing evaluation methodologies remain fragmented and commonly assess LLMs in isolation as either offensive or defensive systems. This work presents a unified dual-role evaluation framework that characterizes LLM behavior within a shared cybersecurity context through a multi-dimensional taxonomy encompassing role, capability, intent, and contextual use. The framework is empirically evaluated under a strictly single-turn setting (T = 1), in which each offensive input is independently assessed through one corresponding defensive response. The evaluation covers phishing detection, prompt injection, log analysis, malware reasoning, vulnerability exploitation, and incident response using malicious, benign, and ambiguous scenarios. Experimental results demonstrate strong overall detection performance, low error rates, and effective handling of dual-use and borderline cases through ambiguity-aware classification. The findings further reveal the difficulty of distinguishing malicious intent from structurally similar benign inputs, underscoring the importance of context-sensitive evaluation and uncertainty-aware decision making in cybersecurity applications. Overall, the study establishes a controlled and reproducible single-turn baseline for evaluating offensive inputs and defensive LLM responses across diverse cybersecurity tasks.
- A. Chowdhery, S. Narang, J. Devlin, M. Bosma, G. Mishra, A. Roberts, et al., “PaLM: Scaling language modeling with pathways”, Journal of Machine Learning Research, vol. 24, no. 240, pp. 1–113, 2023.
- OpenAI, “GPT-4 technical report”, Tech. Rep. arXiv:2303.08774, OpenAI, 2023, doi:10.48550/arXiv.2303.08774.
- A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, I. Polosukhin, Attention is all you need, Advances in Neural Information Processing Systems, vol. 30, 2017.
- L. Ouyang, J. Wu, X. Jiang, D. Almeida, et al., Training language models to follow instructions with human feedback, Advances in Neural Information Processing Systems, vol. 35, 2022, doi:10.52202/068431-2011.
- Microsoft, “With security copilot, microsoft brings the power of AI to cyberdefense”, Microsoft News, 2023.
- SentinelOne, Key cyber security statistics for 2026, 2026.
- SlashNext, The state of phishing report 2023, 2023.
- M. Brundage, S. Avin, J. Clark, et al., The malicious use of artificial intelligence: Forecasting, prevention, and mitigation, Tech. rep., Future of Humanity Institute and Centre for the Study of Existential Risk, 2018.
- PwC, Global economic crime survey 2024, 2024.
- Verizon, 2024 data breach investigations report, 2024.
- D. Ganguli, L. Lovitt, J. Kernion, et al., Red teaming language models to reduce harms: Methods, scaling behaviors, and lessons learned, Tech. rep., Anthropic, 2022, doi:10.48550/arXiv.2209.07858.
- T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, T. Scialom, Toolformer: Language models can teach themselves to use tools, Advances in Neural Information Processing Systems, vol. 36, pp. 68539–68551, 2023, doi:10.52202/075280-2997.
- P. Liang, R. Bommasani, T. Lee, D. Tsipras, D. Soylu, M. Yasunaga, et al., Holistic evaluation of language models, Transactions on Machine Learning Research, 2023.
- A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever, Language models are unsupervised multitask learners, 2019.
- T. B. Brown, B. Mann, N. Ryder, et al., Language models are few-shot learners, Advances in Neural Information Processing Systems, vol. 33, 2020.
- S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, Y. Cao, “ReAct: Synergizing reasoning and acting in language models”, International Conference on Learning Representations, 2023.
- G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, A. Anandkumar, Voyager: An open-ended embodied agent with large language models, Transactions on Machine Learning Research, 2024.
- R. Somani, A. K. Cherukuri, Large language models for cyber security, 2025, doi:10.48550/arXiv.2511.04508.
- M. K. Pasupuleti, Threat intelligence automation using natural language processing on dark web data, International Journal of Academic and Industrial Research Innovations, vol. 5, no. 6, pp. 399–411, 2025, doi:10.62311/nesx/rphcrcscrcp3.
- N. Carlini, F. Tramèr, E. Wallace, M. Jagielski, A. Herbert-Voss, K. Lee, A. Roberts, T. Brown, D. Song, Ú. Erlingsson, A. Oprea, C. Raffel, Extracting training data from large language models, 30th USENIX Security Symposium, pp. 2633–2650, USENIX Association, 2021.
- A. Wei, N. Haghtalab, J. Steinhardt, “Jailbroken: How does LLM safety training fail?”, Advances in Neural Information Processing Systems, vol. 36, 2023, doi:10.52202/075280-3508.
- Z. Ji, N. Lee, R. Frieske, T. Yu, D. Su, Y. Xu, E. Ishii, Y. J. Bang, A. Madotto, P. Fung, Survey of hallucination in natural language generation, ACM Computing Surveys, vol. 55, no. 12, 248, 2023, doi:10.1145/3571730.
- M. Hodak, D. Ellison, C. Van Buren, X. Jiang, A. Dholakia, Benchmarking large language models: Opportunities and challenges, R. Nambiar, M. Poess, eds., Performance Evaluation and Benchmarking, pp. 77–89, Springer Nature Switzerland, Cham, 2024, doi:10.1007/978-3-031-68031-1_6.
- O. Golovneva, et al., Dynamic evaluation of language models in interactive environments, ICLR Workshop, 2023.
- G. d. J. C. da Silva, C. B. Westphall, A survey of large language models in cybersecurity, 2024, doi:10.48550/arXiv.2402.16968.
- H. Pearce, B. Ahmad, B. Tan, B. Dolan-Gavitt, R. Karri, “Asleep at the keyboard? assessing the security of GitHub Copilot’s code contributions”, 2022 IEEE Symposium on Security and Privacy (SP), pp. 754–768, IEEE, 2022, doi:10.1109/SP46214.2022.9833571.
- J. Hazell, Spear phishing with large language models, 2023, doi:10.48550/arXiv.2305.06972.
- K. Greshake, S. Abdelnabi, S. Mishra, C. Endres, T. Holz, M. Fritz, “Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection”, Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security, pp. 79–90, Association for Computing Machinery, 2023, doi:10.1145/3605764.3623985.
- A. Zhou, K. Wu, F. Pinto, Z. Chen, Y. Zeng, Y. Yang, S. Yang, S. Koyejo, J. Y. Zou, B. Li, “AutoRedTeamer: Autonomous red teaming with lifelong attack integration”, Advances in Neural Information Processing Systems, vol. 38, 2025, doi:10.52202/085713-5654.
- B. Deng, W. Wang, F. Feng, Y. Deng, Q. Wang, X. He, Attack prompt generation for red teaming and defending large language models, H. Bouamor, J. Pino, K. Bali, eds., Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 2176–2189, Association for Computational Linguistics, Singapore, 2023, doi:10.18653/v1/2023.findings-emnlp.143.
- S. Finistrella, S. Mariani, F. Zambonelli, Multi-agent reinforcement learning for cybersecurity: Classification and survey, Intelligent Systems with Applications, vol. 26, p. 200495, 2025, doi:10.1016/j.iswa.2025.200495.
- L. Weidinger, J. Uesato, M. Rauh, C. Griffin, P.-S. Huang, J. F. J. Mellor, A. Glaese, M. Cheng, B. Balle, A. Kasirzadeh, C. Biles, S. M. Brown, Z. Kenton, W. T. Hawkins, T. Stepleton, A. Birhane, L. A. Hendricks, L. Rimell, W. S. Isaac, J. Haas, S. Legassick, G. Irving, I. Gabriel, Taxonomy of risks posed by language models, Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, pp. 214–229, Association for Computing Machinery, 2022, doi:10.1145/3531146.3533088.
- R. Bommasani, D. A. Hudson, E. Adeli, R. Altman, S. Arora, et al., On the opportunities and risks of foundation models, Tech. rep., Stanford Center for Research on Foundation Models, 2021, doi:10.48550/arXiv.2108.07258.
- L. Weidinger, J. F. J. Mellor, M. Rauh, C. Griffin, J. Uesato, P.-S. Huang, M. Cheng, M. Glaese, B. Balle, A. Kasirzadeh, Z. Kenton, S. M. Brown, W. T. Hawkins, T. Stepleton, A. Birhane, J. Haas, L. Rimell, L. A. Hendricks, W. S. Isaac, S. Legassick, G. Irving, I. Gabriel, Ethical and social risks of harm from language models, 2021, doi:10.48550/arXiv.2112.04359.
- A. Shostack, Threat Modeling: Designing for Security, John Wiley and Sons, 2014.
- A. T. Kalai, O. Nachum, S. S. Vempala, E. Zhang, Why language models hallucinate, 2025, doi:10.48550/arXiv.2509.04664.
- B. Biggio, F. Roli, Wild patterns: Ten years after the rise of adversarial machine learning, Pattern Recognition, vol. 84, pp. 317–331, 2018, doi:10.1016/j.patcog.2018.07.023.
- E. M. Hutchins, M. J. Cloppert, R. M. Amin, Intelligence-driven computer network defense informed by analysis of adversary campaigns and intrusion kill chains, Tech. rep., Lockheed Martin Corporation, 2011.
- Muthukumarapandian Chandrasekaran, “Scoring-Driven Context Memory and Token Optimization for Rapid Prototyping of Scalable Multimodal Intelligent Agents: The MERIT Framework”, Journal of Engineering Research and Sciences, vol. 5, no. 11, pp. 72–79, 2026. doi: 10.55708/js0511005
- Muthukumarapandian Chandrasekaran, “PRISM: Probabilistic Reasoning through Intelligent Situational Modeling – A Dynamic Context Engineering Framework for Uncertainty-Aware Agentic AI in Healthcare Administrative Workflows”, Journal of Engineering Research and Sciences, vol. 5, no. 10, pp. 1–10, 2026. doi: 10.55708/js0510001
- Pratheswaran Hariharan, Haiping Xu, Donghui Yan, “Retrieval-Augmented Reliability-Aware Selective Inference for Visual Classification”, Journal of Engineering Research and Sciences, vol. 5, no. 9, pp. 1–14, 2026. doi: 10.55708/js0509001
- Nikolaos Vasileios Oikonomou, Ioannis Palaiokrassas, Dimitrios Vasileios Oikonomou, Sofia Panagiota Chaliasou, Nikolaos Rigas, “Demographic Stereotype Elicitation in LLMs through Personality and Dark Triad Trait Attribution”, Journal of Engineering Research and Sciences, vol. 5, no. 1, pp. 46–65, 2026. doi: 10.55708/js0501005