mlsanityData to 7 Oct 2026

Unintended Misalignment from Agentic Fine-Tuning: Risks and Mitigation

arXiv 2508.14031 ↗First posted 19 Aug 2025cs.CL cs.AI cs.LGcited by 9

On the map: LLM agents and tool use → Agent threats, guardrails and governance

Abstract (arXiv)

Beyond simple text generation, Large Language Models (LLMs) have evolved into agentic systems capable of planning and interacting with external tools to solve complex tasks. This evolution involves fine-tuning LLMs on agent-specific tasks to enhance their proficiency. However, safety concerns are frequently overlooked during this fine-tuning process. In this work, we show that aligned LLMs can become unintentionally misaligned, leading to a higher likelihood of executing harmful tasks and a reduced tendency to refuse them when fine-tuned to execute agentic tasks. To address these safety challenges, we propose Prefix INjection Guard (PING), a simple yet effective method that prepends automatically generated natural language prefixes to agent responses, guiding them to refuse harmful requests while preserving performance on benign tasks. Specifically, we introduce an iterative approach that alternates between (1) generating candidate prefixes and (2) selecting those that optimize both task performance and refusal behavior. Experimental results demonstrate that PING significantly enhances the safety of fine-tuned LLM agents without sacrificing their effectiveness. PING consistently outperforms existing prompting approaches across diverse benchmarks in both web navigation and code generation tasks. Our analysis of internal hidden states via linear probes reveals that prefix tokens are crucial for behavior modification, explaining the performance gains. WARNING: This paper contains contents that are unethical or offensive in nature.

Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 33 of its 44 references that are in the map. First posted on arXiv 19 Aug 2025.

Builds on

33 of 44 references.

Closest ancestors · 2

Same direction, newest first

  1. 2024RedCode: Risky Code Execution and Generation Benchmark for Code Agents12 Nov
  2. 2024When LLMs Go Online: The Emerging Threat of Web-Enabled LLMs18 Oct

Other references · 31

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  4. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  5. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 1,908
  6. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
  7. 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
  8. 2022WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agentscited by 1,197
  9. 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!cited by 1,106
  10. 2024ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Toolscited by 1,096
  11. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
  12. 2023Steering Language Models With Activation Engineeringcited by 824
19 more
  1. 2024Executable Code Actions Elicit Better LLM Agentscited by 537
  2. 2024AndroidWorld: A Dynamic Benchmarking Environment for Autonomous Agentscited by 450
  3. 2024Safety Alignment Should Be Made More Than Just a Few Tokens Deepcited by 450
  4. 2023ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledgecited by 324
  5. 2023MINT: Evaluating LLMs in Multi-turn Interaction with Tools and Language Feedbackcited by 293
  6. 2024WebRL: Training LLM Web Agents via Self-Evolving Online Curriculum Reinforcement Learningcited by 243
  7. 2024OpenCodeInterpreter: Integrating Code Generation with Execution and Refinementcited by 242
  8. 2023LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70Bcited by 183
  9. 2024WebLINX: Real-World Website Navigation with Multi-Turn Dialoguecited by 177
  10. 2024AmpleGCG: Learning a Universal and Transferable Generative Model of Adversarial Suffixes for Jailbreaking Both Open and Closed LLMscited by 160
  11. 2024The BrowserGym Ecosystem for Web Agent Researchcited by 152
  12. 2024What is in Your Safe Data? Identifying Benign Data that Breaks Safetycited by 114
  13. 2024VisualAgentBench: Towards Large Multimodal Models as Visual Foundation Agentscited by 101
  14. 2024Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templatescited by 94
  15. 2024Improved Few-Shot Jailbreaking Can Circumvent Aligned Language Models and Their Defensescited by 68
  16. 2024Benchmarking Mobile Device Control Agents across Diverse Configurationscited by 54
  17. 2024MobileSafetyBench: Evaluating Safety of Autonomous Agents in Mobile Device Controlcited by 49
  18. 2025Virus: Harmful Fine-tuning Attack for Large Language Models Bypassing Guardrail Moderationcited by 28
  19. 2024The effect of fine-tuning on language model toxicitycited by 15

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 3; 2026: 6.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025AgentAlign: Navigating Safety Alignment in the Shift from Informative to Agentic Large Language Models
  2. 2026AgentBoundary: Counterfactual Evaluation of Safety in Tool-Using LLM Agents
  3. 2025AgentMisalignment: Measuring the Propensity for Misaligned Behaviour in LLM-Based Agents
  4. 2026Mind the GAP: Text Safety Does Not Transfer to Tool-Call Safety in LLM Agents
  5. 2026The Causal Impact of Tool Affordance on Safety Alignment in LLM Agents
  6. 2024Agent-SafetyBench: Evaluating the Safety of LLM Agents
  7. 2026Agent Safety Is Action Alignment
  8. 2026Beyond the Leaderboard: A Synthesis of Tool-Use, Planning, and Reasoning Failures in Large Language Model Agents