TL;DR
LLM agents increasingly rely on the Model Context Protocol (MCP) to autonomously discover and use third-party tools via semantic matching. This paper exposes a critical semantic supply-chain vulnerability by introducing A2M (Attraction-to-Manipulation), a two-stage black-box framework that optimizes tool metadata to trick agents into selecting malicious tools and refines tool outputs to hijack their subsequent reasoning. The framework achieves alarming success rates across frontier models, highlighting an urgent need for robust tool vetting and runtime isolation in agentic ecosystems.
What Problem Does This Paper Address?
Traditional LLM security research focuses heavily on user-to-agent attacks, such as direct prompt injections or jailbreaks, where a malicious user explicitly tries to manipulate model behavior. However, as LLM agents evolve into autonomous systems using frameworks like Anthropic's Model Context Protocol (MCP), a new threat vector emerges: the semantic supply chain.
MCP agents select external tools dynamically by matching the user's request against tool names and descriptions (metadata) provided by third-party registries. If an attacker registers a malicious tool with deceptively relevant metadata, the agent might autonomously select it even if both the user and the agent are entirely benign. Furthermore, once a tool is invoked, the agent treats its output as trusted environmental feedback rather than untrusted text, making it highly susceptible to indirect manipulation. The authors address the challenge of systematically exploiting this full attack chain—getting selected (Attraction) and successfully hijacking the agent's downstream logic (Manipulation).
Methods
The authors propose A2M, a black-box optimization framework split into two distinct phases:
- Phase I: Attraction (Metadata Optimization): A2M uses five distinct persuasion strategies (Authority, Urgency, Comprehensiveness, Resource Optimality, and Security) to prompt a generator LLM to create highly appealing tool names and descriptions. These candidates are ranked using Monte Carlo rollouts to identify the "elite" metadata configurations most likely to be selected by the agent.
- Phase II: Manipulation (Payload Refinement): Once an attractive tool is selected, A2M employs an Analyzer-Optimizer architecture. An LLM-based Analyzer reviews the agent's execution traces to diagnose why an attack failed (e.g., if the agent ignored the payload or encountered a safety refusal). It then provides structured feedback to an Optimizer that iteratively rewrites the tool's return payload to steer the agent toward the attacker's target behavior.
This trace-guided optimization sets A2M apart from standard genetic algorithms or zero-shot generation methods, which rely purely on scalar fitness scores without diagnostic feedback loops.
Datasets
The framework was evaluated using LiveMCPBench, a benchmark designed to test agent navigation in realistic MCP environments. It contains:
- 95 real-world tasks spread across six domains (Office, Lifestyle, Leisure, Finance, Travel, Shopping).
- 70 MCP servers exposing a total of 527 tools.
Key Insights and Ideas
- The Decoupling Insight: A successful tool-based attack requires solving two coupled but distinct problems: getting chosen and executing the payload. An incredibly potent payload does nothing if the tool is never picked; a highly attractive tool fails if the agent ignores its output. A2M makes black-box optimization tractable by separating these into distinct stages.
- Environment Feedback as a Trust Vector: Agents inherently trust tool outputs as "system states" or "execution results." A2M exploits this trust, turning standard tool responses into stealthy indirect prompt injections that bypass traditional user-facing safety filters.
- The Invocation vs. Success Gap: Getting an agent to invoke a malicious tool is relatively easy and transfers well across different models. However, successfully manipulating the agent's final behavior is much harder, as advanced models often implicitly resist or ignore adversarial payloads during their subsequent reasoning steps.
Key Results
The authors evaluated A2M across four attack scenarios: Cognitive Denial of Service (C-DoS), Information Exfiltration (IE), Environment Integrity Compromise (EIC), and Reasoning Derailment (RD).
- Direct Attack (Optimized on GLM-4.6): A2M achieved a macro-average Malicious Tool Invocation Rate (MTIR) of 93.6% and a mean Attack Success Rate (ASR) of 74.4% for IE, EIC, and RD. Under the C-DoS attack, it inflated the agent's token consumption to 32.4× the benign baseline.
- Cross-Model Transfer: Without any re-optimization, tools optimized on GLM-4.6 were transferred to four other frontier models (Qwen3-Max, DeepSeek-V3.1, Kimi-K2-0905, and GPT-5). The transfer yielded a solid macro-average MTIR of 63.6%, though the mean ASR dropped to 24.5%, highlighting that models like GPT-5 are highly resilient to the manipulation phase despite invoking the tool.
- Defenses: Traditional defenses like perplexity-based detection and metadata paraphrasing left significant residual risk. However, a defense inspired by FIDES (Information-Flow Control), which treats tool returns as untrusted data and restricts subsequent actions, successfully mitigated post-invocation harm, dropping the EIC ASR from 64.3% to 22.9%.
Limitations and Future Work
- Semantic-Layer Focus: The attack operates entirely at the semantic layer (manipulating text prompts and JSON returns) and does not explore lower-level operating system or network exploits.
- Trace Visibility Dependency: The Analyzer-Optimizer loop requires full visibility into the agent's execution traces. In real-world black-box scenarios with aggressive rate-limiting or hidden traces, optimization efficiency would drop.
- Fixed Agent Architecture: The evaluations were restricted to a standard ReAct-style agent stack implemented via LangChain. Future work should explore how varying system prompts, routing policies, and larger tool pools affect attack resilience.
Summary updated