WebMCP-Phalanx: Enforcing and Characterizing Trust Boundaries for Browser-Integrated LLM Agents
Organizations: Department of Institute of Artificial Intelligence Innovation National Yang Ming Chiao Tung University Hsinchu, Taiwan
Abstract
The emerging W3C WebMCP proposal enables LLM agents to invoke tools exposed by web pages. In multi-party web environments, however, integrating agent execution into a browser security model centered on the Same-Origin Policy (SOP) leaves insufficient provenance and lifecycle guarantees for agent-accessible tools, creating three risks: subject-attribution spoofing, uncontrolled tool lifecycles, and semantic prompt injection. We propose WebMCP-Phalanx, a dual-layer agent runtime architecture. Its first layer provides a browser-native trust anchor that binds each tool to its registering principal through cryptographically protected capability credentials and propagates provenance labels throughout the tool lifecycle. Its second layer separates semantic inspection from privileged tool use. A Quarantine Agent (Q-LLM), without tool invocation authority, inspects tool metadata, outputs, and page-supplied content for prompt injection. Validated content is then forwarded to a Privileged Agent (P-LLM) for execution, while the Q-LLM's internal state remains hidden from page scripts. Empirical evaluation shows that the browser-native ownership mechanism reduces revocation and overwrite attack success from 100% to 0%. The dual-agent runtime blocks all 80 prompt-injection attempts embedded in tool descriptions and limits tool-return attacks to 2 successful cases out of 80. Across experiments, task utility remains statistically indistinguishable from the no-attack baseline. Under a white-box adaptive attacker, however, description-based filtering can be bypassed through malicious tool names invoked before inspection. This finding motivates a call-timing gate that delays tool invocation until all agent-visible tool metadata has been validated.
Figures & tables
| Injection Vector | L0 | L1 | L2 | L3 |
| Description (Registration) | 69/80 | 71/80 | 25/80 | 0/80 |
| Returned Content (Execution) | 42/80 | 38/80 | 2/80 | 2/80 |
| Handling Point | Mechanism | Fails When |
| Registration: Description | Label Rules | Always, under a same origin adversary: every successful registrant obtains a capability, so the origin dimension is constant and its veto cannot fire (Table in Appendix). |
| Registration: Description | Rule based Stripping | The tool name is task relevant. ASR rises from 0% to 70% as name relevance increases (Table 4 ). |
| Registration: Description | Multi Agent (Q) | Not observed; 0% across all name relevance tiers (Table 4 ). |
| Execution: Return Content | Label Rules | Always: the label is minted at registration, whereas the injected content does not yet exist at that moment. |
| Execution: Return Content | Rule based Stripping | The agent invokes the tool on its name before the carrier executes (1 of the 2/80 residual; the other is channel consistent). |
| Execution: Return Content | Multi Agent (Q) | The agent invokes the tool on its name before the carrier executes (2/80). |
| Condition | Attack Success Rate | Task Completion Rate |
| No Defense | 80% | 95% |
| No Attack | 0% | 100% |
| Lifecycle Monitor Only | 70% | 80% |
| Lifecycle Monitor + Our Framework | 0% | 100% |
| Name Relevance | L2 ASR | L3 ASR |
| N0 Completely Irrelevant | 0% | 0% |
| N1 Generic | 0% | 0% |
| N2 Common Step | 25% | 0% |
| N3 Task Domain | 55% | 0% |
| N4 Essential Step | 70% | 0% |
LLM Agent Security
Large language model agent security studies attacks and safeguards for systems that plan, use tools, retain memory, and act across applications.
See all 327 papers