MCP Safety Training: Learning to Refuse Falsely Benign MCP Exploits using Improved Preference Alignment
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 2 more
Abstract (arXiv)
The model context protocol (MCP) has been widely adapted as an open standard enabling the seamless integration of generative AI agents. However, recent work has shown the MCP is susceptible to retrieval-based "falsely benign" attacks (FBAs), allowing malicious system access and credential theft, but requiring that users download compromised files directly to their systems. Herein, we show that the threat model of MCP-based attacks is significantly broader than previously thought, i.e., attackers need only post malicious content online to deceive MCP agents into carrying out their attacks on unsuspecting victims' systems. To improve alignment guardrails against such attacks, we introduce a new MCP dataset of FBAs and (truly) benign samples to explore the effectiveness of direct preference optimization (DPO) for the refusal training of large language models (LLMs). While DPO improves model guardrails against such attacks, we show that the efficacy of refusal learning varies drastically depending on the model's original post-training alignment scheme--e.g., GRPO-based LLMs learn to refuse extremely poorly. Thus, to further improve FBA refusals, we introduce Retrieval Augmented Generation for Preference alignment (RAG-Pref), a novel preference alignment strategy based on RAG. We show that RAG-Pref significantly improves the ability of LLMs to refuse FBAs, particularly when combined with DPO alignment, thus drastically improving guardrails against MCP-based attacks.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 26 of its 45 references that are in the map. First posted on arXiv 29 May 2025.
Builds on
26 of 45 references.
Closest ancestors · 4
Same direction, newest first
- 2025LlamaFirewall: An open source guardrail system for building secure AI agents6 May
- 2025MCP Guardian: A Security-First Layer for Safeguarding MCP-Based AI System17 Apr
- 2025MCP Safety Audit: LLMs with the Model Context Protocol Allow Major Security Exploits2 Apr
- 2024RedCode: Risky Code Execution and Generation Benchmark for Code Agents12 Nov
Other references · 22
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2024Refusal in Language Models Is Mediated by a Single Directioncited by 1,032
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 422
- 2023Statistical Rejection Sampling Improves Preference Optimizationcited by 323
10 more
- 2024Self-Play Preference Optimization for Language Model Alignmentcited by 232
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
- 2024Provably Robust DPO: Aligning Language Models with Noisy Feedbackcited by 135
- 2024Noise Contrastive Alignment of Language Models with Explicit Rewardscited by 85
- 2024Surgical, Cheap, and Flexible: Mitigating False Refusal in Language Models via Single Vector Ablationcited by 48
- 2024Anchored Preference Optimization and Contrastive Revisions: Addressing Underspecification in Alignmentcited by 46
- 2024Binary Classifier Optimization for Large Language Model Alignmentcited by 45
- 2024Towards Efficient Exact Optimization of Language Model Alignmentcited by 37
- 2024Distributional Preference Alignment of LLMs via Optimal Transportcited by 26
- 2025RAG LLMs are Not Safer: A Safety Analysis of Retrieval-Augmented Generation for Large Language Modelscited by 24
Built on by
Citing papers per year: 2025: 2; 2026: 1.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2026Training-Free Refusal of MCP Exploits via Retrieval-Augmented Generation
- 2025Improving LLM Safety Alignment with Dual-Objective Optimization
- 2025MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols
- 2025MCPXKIT: The Unified Toolkit for Analyzing Model Context Protocol Security
- 2025MCP-Guard: A Multi-Stage Defense-in-Depth Framework for Securing Model Context Protocol in Agentic AI
- 2026Compatibility at a Cost: Systematic Discovery and Exploitation of MCP Clause-Compliance Vulnerabilities
- 2026Defensive Refusal Bias: How Safety Alignment Fails Cyber Defenders
- 2026Localizing Safety Alignment: MLP Layers and Mid-Network Blocks Encode Refusal Behavior in Large Language Models