COPEX: Benchmarking LLM Robustness to Adversarial Context Across Model Context Protocol Layers
Organizations: Old Dominion University
Abstract
Large language models increasingly mediate tool use in Model Context Protocol (MCP) systems, where adversarial influence may enter through user instructions, tool schemas, tool outputs, or protocol messages. Existing benchmarks often evaluate deployed agents, conflating model susceptibility with guardrails, orchestration, and general task capability. We introduce COPEX (COntext Provider EXploitation), a controlled benchmark that isolates the model as an MCP client by fixing the surrounding agent stack and varying only the tool-selecting model. COPEX covers 25 attack types instantiated as 125 scenarios across four entry surfaces: model/agent, client, server/tool, and transport. Across nine models and 3,375 trials, the mean attack success rate is 64.4%, with surface-level means ranging from 58.3% to 71.4%. Some client- and transport-level attacks succeed partly outside the model's observation or control, separating system exposure from model susceptibility. Combined input and context scanning reduces mean attack success by 49.6% on an eight-attack defense subset relative to the undefended setting. The benchmark is available at https://github.com/inspire-center/copex.
Figures & tables
| Feature | MCPTox | MSB | MCPSecBench | MCP-SafetyBench | COPEX(ours) |
|---|---|---|---|---|---|
| Primary target | Tool poisoning | Agent workflow | agent platforms | Agent workflow | Model behavior |
| Isolates model behavior | ✗ | ✗ | ✗ | ✗ | ✓ |
| Attack types | 3 | 12 | 17 | 20 | 25 |
| Transport attacks | ✗ | ✗ | ✓ | ✗ | ✓ |
| Outcome oracle | Tool calls | Execution | Semantic | Execution | Trace + semantic |
| Surface | Adversary-controlled components |
|---|---|
| Model/agent ( ma ) | User task and upstream content in |
| Client ( cl ) | Client-side parsing, metadata, and context assembly |
| Server/tool ( st ) | Tool schemas, responses, and server-side behavior |
| Transport ( tr ) | In-transit data, endpoint resolution, and connection state |
| Model | Opus-4.7 | Sonnet-4.6 | Qwen-2.5 | Llama-3.2 | GPT-5.5 | GPT-5 Mini | GPT-4.1 | Gemini-3.1 | Grok-4.3 | Mean |
|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | 44.3 | 45.1 | 61.1 | 64.5 | 67.5 | 68.0 | 73.1 | 74.1 | 81.6 | 64.4 |
| ma | 33.3 | 38.3 | 56.6 | 53.3 | 75.0 | 76.7 | 55.0 | 61.7 | 75.0 | 58.3 |
| cl | 38.1 | 37.1 | 58.1 | 60.0 | 66.7 | 69.5 | 86.7 | 95.2 | 98.1 | 67.7 |
| st | 44.2 | 47.9 | 64.9 | 70.3 | 61.8 | 65.5 | 69.1 | 64.8 | 73.9 | 62.5 |
| tr | 73.3 | 62.2 | 60.0 | 68.9 | 80.0 | 62.2 | 80.0 | 75.6 | 80.0 | 71.4 |
| Model | Sonnet-4.6 | GPT-5.5 | Gemini-3.1 | Grok-4.3 | Mean |
|---|---|---|---|---|---|
| ReAct | 71.4 | 84.6 | 96.2 | 92.6 | 86.2 |
| Reflexion | 61.5 | 79.3 | 96.2 | 93.1 | 82.5 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Surface | Attack | Mechanism | ASR (%) |
| ma | Prompt injection | Direct instructions bypass safety constraints and expose credentials. | 37.8 |
| Indirect injection | Malicious directives are embedded in model-consumed files. | 53.3 | |
| Tool misuse | Social engineering redefines tool purposes and induces misuse. | 90.4 | |
| Dependency injection | Poisoned tool descriptions induce unnecessary prerequisite calls. | 51.9 | |
| cl | Command overlap | Client commands conflict with server tools and leak sensitive data. | 88.1 |
| Schema inconsistency | Tool schemas do not match their implementations. | 57.8 |
| Layer | Attack | Eval | Sonnet-4.6 | Opus-4.7 | Gemini-3.1 | Grok-4.3 | Llama-3.2 | Qwen-2.5 | GPT-4.1 | GPT-5 Mini | GPT-5.5 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | Prompt injection | J | 0.0 | 0.0 | 46.7 | 20.0 | 80.0 | 73.3 | 60.0 | 40.0 | 20.0 |
| Indirect prompt injection | J | 0.0 | 0.0 | 93.3 | 100.0 | 33.3 | 53.3 | 0.0 | 100.0 | 100.0 | |
| Tool misuse via confused AI | J | 93.3 | 93.3 | 26.7 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | |
| Function dependency injection | D | 60.0 | 40.0 | 80.0 | 80.0 | 0.0 | 0.0 | 60.0 | 66.7 | 80.0 | |
| MCP Client | Slash command overlap | J | 33.3 | 60.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 |
| Schema inconsistencies | D | 66.7 | 80.0 | 100.0 | 93.3 | 20.0 | 0.0 | 100.0 | 6.7 | 53.3 |
| Sonnet-4.6 | GPT-5.5 | Gemini-3.1 | Grok-4.3 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Attack | N | I | C | B | N | I | C | B | N | I | C | B | N | I | C | B |
| Function Dep. Injection | 60 | 60 | 60 | 60 | 80 | 80 | 80 | 60 | 80 | 80 | 80 | 80 | 80 | 80 | 80 | 80 |
| Schema Inconsistencies | 80 | 0 | 0 | 0 | 80 | 0 | 0 | 0 | 100 | 0 | 0 | 0 | 80 | 0 | 0 | 0 |
| Parameter Poisoning | 20 | 20 | 20 | 20 | 20 | 60 | 40 | 60 | 100 | 100 | 80 | 100 | 80 | 100 | 60 | 60 |
| Pkg Squatting (Tool) | 60 | 40 | 60 | 40 | 60 | 40 | 60 | 40 | 60 | 40 | 60 | 40 | 60 | 40 | 60 | 40 |
| Pkg Squatting (Server) | 100 | 20 | 100 | 20 | 100 | 20 | 100 | 20 | 60 | 20 | 80 | 20 | 100 | 20 | 100 | 20 |
| Sonnet-4.6 | GPT-5.5 | Gemini-3.1 | Grok-4.3 | |||||
|---|---|---|---|---|---|---|---|---|
| Attack | R | Ref | R | Ref | R | Ref | R | Ref |
| Function Dep. Injection | 60 | 60 | 80 | 80 | 80 | 80 | 80 | 80 |
| Schema Inconsistencies | 80 | 60 | 100 | 80 | 100 | 100 | 100 | 100 |
| Parameter Poisoning | 20 | 20 | 20 | 20 | 100 | 100 | 80 | 80 |
| Data Exfiltration | 60 | 20 | 40 | 80 | 40 | 20 | 40 | 80 |
| Configuration Drift | 80 | 60 | 100 | 100 | 80 | 100 | 100 | 100 |
| Sonnet-4.6 | GPT-5.5 | Gemini-3.1 | Grok-4.3 | |||||
|---|---|---|---|---|---|---|---|---|
| Attack | Det | Judge | Det | Judge | Det | Judge | Det | Judge |
| Parameter Poisoning | 20.0 | 20.0 | 50.0 | 40.0 | 100.0 | 100.0 | 80.0 | 100.0 |
| Schema Inconsistencies | 80.0 | 80.0 | 80.0 | 100.0 | 100.0 | 100.0 | 60.0 | 60.0 |
| Excessive Permissions | 100.0 | 100.0 | 80.0 | 100.0 | 80.0 | 60.0 | 100.0 | 100.0 |
| Function Dependency Injection | 60.0 | 60.0 | 80.0 | 80.0 | 80.0 | 80.0 | 80.0 | 100.0 |
| Pkg Squatting (Tool) | 60.0 | 100.0 | 60.0 | 100.0 | 60.0 | 100.0 | 60.0 | 100.0 |