Analysing Safety Risks in LLMs Fine-Tuned with Pseudo-Malicious Cyber Security Data
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Large language models (LLMs) have been used in many application domains, including cyber security. The application of LLMs in the cyber security domain presents significant opportunities, such as for enhancing threat analysis and malware detection, but it can also introduce critical risks and safety concerns, including potential personal data leakage and automated generation of new malware. Building on recent findings that fine-tuning LLMs with pseudo-malicious cyber security data significantly compromises their safety, this paper presents a comprehensive validation and extension of these safety risks using a different evaluation framework. We employ the garak red teaming framework with the OWASP Top 10 for LLM Applications to assess four open-source LLMs: Mistral 7B, Llama 3 8B, Gemma 2 9B, and DeepSeek R1 8B. Our evaluation confirms and extends previous findings, showing that fine-tuning reduces safety resilience across all tested LLMs (e.g., the failure rate of Mistral 7B against prompt injection increases from 9.1% to 68.7%). We further propose and evaluate a novel safety alignment approach that carefully rewords instruction-response pairs to include explicit safety precautions and ethical considerations. This work validates previous safety concerns through independent evaluation and introduces new methods for mitigating these risks, contributing towards the development of secure, trustworthy, and ethically aligned LLMs. This approach demonstrates that it is possible to maintain or even improve model safety while preserving technical utility, offering a practical path towards developing safer fine-tuning methodologies.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 22 of its 51 references that are in the map. First posted on arXiv 15 May 2025.
Builds on
22 of 51 references.
Closest ancestors · 3
Same direction, newest first
- 2024What Makes and Breaks Safety Fine-tuning? A Mechanistic Study14 Jul
- 2024Navigating the Safety Landscape: Measuring Risks in Finetuning Large Language Models27 May
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!5 Oct
Other references · 19
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 739
- 2023Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructionscited by 387
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 210
- 2023From ChatGPT to ThreatGPT: Impact of Generative AI in Cybersecurity and Privacycited by 143
- 2024Safe LoRA: the Silver Lining of Reducing Safety Risks when Fine-tuning Large Language Modelscited by 125
- 2023Evaluating the Zero-shot Robustness of Instruction-tuned Language Modelscited by 66
- 2024garak: A Framework for Security Probing Large Language Modelscited by 49
- 2023Gaining Wisdom from Setbacks: Aligning Large Language Models via Mistake Analysiscited by 35
- 2024Safety-Aware Fine-Tuning of Large Language Modelscited by 34
7 more
- 2023From Text to MITRE Techniques: Exploring the Malicious Use of Large Language Models for Generating Cyber Attack Payloadscited by 32
- 2024Measure-Observe-Remeasure: An Interactive Paradigm for Differentially-Private Exploratory Analysiscited by 24
- 2025o3-mini vs DeepSeek-R1: Which One is Safer?cited by 24
- 2023Decoding the Threat Landscape : ChatGPT, FraudGPT, and WormGPT in Social Engineering Attackscited by 23
- 2024Locking Down the Finetuned LLMs Safetycited by 22
- 2023A Security Risk Taxonomy for Prompt-Based Interaction With Large Language Modelscited by 12
- 2025CyberLLMInstruct: A Pseudo-malicious Dataset Revealing Safety-performance Trade-offs in Cyber Security LLM Fine-tuningcited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Safety and Security Analysis of Large Language Models: Benchmarking Risk Profile and Harm Potential
- 2025LLM-Safety Evaluations Lack Robustness
- 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Models
- 2024Threat Modelling and Risk Analysis for Large Language Model (LLM)-Powered Applications
- 2025Evaluating the efficacy of LLM Safety Solutions : The Palit Benchmark Dataset
- 2025Fine-Tuning Lowers Safety and Disrupts Evaluation Consistency
- 2025aiXamine: Simplified LLM Safety and Security
- 2024Trust & Safety of LLMs and LLMs in Trust & Safety