SafeMCP: Proactive Power Regulation for LLM Agent Defense via Environment-Grounded Look-Ahead Reasoning
Lichao Wang, ZhaoXing Ren, Tianzhuo Yang, Jiaming Ji, Chi Harold Liu, Yaodong Yang, Juntao Dai
Abstract
As Large Language Model (LLM) agents increasingly leverage the Model Context Protocol (MCP) to operate in complex environments, the expansion of their action spaces offers agents unsafe capabilities and underscores the risk of power-seeking. While broad action space and greater environment influence are essential for task fulfillment, they create a fragile risk surface where minor errors or hallucinations are magnified into catastrophic failures. In response, we propose SafeMCP, a server-side defense plugin that constrains tool acquisition via predictive reasoning regarding future safety risks. SafeMCP utilizes an internal world model for look-ahead reasoning to implement a two-tier defense: proactive tool filtering to constrain hazardous power expansion and immediate intervention as a failsafe. To train SafeMCP, we introduce a threestage pipeline comprising environmental dynamic grounding, safe policy initialization, and reinforcement learning (RL) with dual verifiable rewards. Experiments on PowerSeeking Bench, ToolEmu, and AgentHarm show that SafeMCP achieves a safe equilibrium, effectively mitigating risks while preserving agent utility. Code and data are available at https: //github.com/wlc2424762917/SafeMCP .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- R-Judge: Benchmarking Safety Risk Awareness for LLM Agents cites Identifying the Risks of LM Agents with an LM-Emulated Sandbox
- AGrail: A Lifelong Agent Guardrail with Effective and Adaptive Safety Detection cites Identifying the Risks of LM Agents with an LM-Emulated Sandbox
Builds on11
- Identifying the Risks of LM Agents with an LM-Emulated SandboxYangjun Ruan, Honghua Dong, Andrew Wang, Silviu Pitis et al.ICLR 2024 · 292 citations
- Optimal Policies Tend To Seek PowerAlexander Matt Turner, Logan Smith, Rohin Shah, Andrew Critch et al.NeurIPS 2021 · 111 citations
- Smooth Tchebycheff Scalarization for Multi-Objective OptimizationXi Lin, Xiaoyuan Zhang, Zhiyuan Yang, Fei Liu et al.ICML 2024 · 48 citations
- R-Judge: Benchmarking Safety Risk Awareness for LLM AgentsTongxin Yuan, Zhiwei He, Lingzhong Dong, Yiming Wang et al.EMNLP Findings 2024 · 46 citations
- AGrail: A Lifelong Agent Guardrail with Effective and Adaptive Safety DetectionWeidi Luo, Shenghong Dai, Xiaogeng Liu, Suman Banerjee et al.ACL 2025 · 41 citations
Related papers
- MCP-SafetyBench: A Benchmark for Safety Evaluation of Large Language Models with Real-World MCP ServersXuanjun Zong, Zhiqi Shen, Lei Wang, Yunshi Lan et al.ICLR 2026 · 34 citations
- MCPTox: A Benchmark for Tool Poisoning on Real-World MCP ServersZhiqiang Wang, Yichao Gao, Yanting Wang, Suyuan Liu et al.AAAI 2026 · 6 citations
- ContractGuard: Auditing Semantic Contracts of MCP Tools for Security ViolationsHengkai Ye, Zhechang Zhang, Ruibo Lu, Jinyuan Jia et al.CCS 2026
- ToolSafe: Enhancing Tool Invocation Safety of LLM-based agents via Proactive Step-level Guardrail and FeedbackYutao Mou, Zhangchi Xue, Lijun Li, Peiyang Liu et al.ACL Findings 2026 · 4 citations
- MCP-Flow: Facilitating LLM Agents to Master Real-World, Diverse and Scaling MCP ToolsWenhao Wang, Peizhi Niu, Zhao Xu, Zhaoyu Chen et al.ACL 2026 · 8 citations
