A Formal Security Framework for MCP-Based AI Agents: Threat Taxonomy, Verification Models, and Defense Mechanisms
Nirajan Acharya 1 , Gaurav Kumar Gupta 2 · 2026
Read A Formal Security Framework for MCP-Based AI Agents: Threat Taxonomy, Verification Models, and Defense Mechanisms by Nirajan Acharya 1 , Gaurav Kumar Gupta 2 (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-05969.txt.
Introduction
Acharya and Gupta build MCPSHIELD, a formal security frame for AI agents that use the Model Context Protocol to reach tools and data. From a scan of over 177,000 tools they sort threats into 7 groups and 23 attack paths across four surfaces, and model tool chains with trust-boundary checks. No lone defense tops 34 percent coverage, while their layered design claims 91 percent in theory.
Catalog record
| CREATOR | Nirajan Acharya 1 , Gaurav Kumar Gupta 2 |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 50547 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.05969
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
A Formal Security Framework for MCP-Based AI Agents: Threat Taxonomy, Verification Models, and Defense Mechanisms Nirajan Acharya 1 , Gaurav Kumar Gupta 2 Abstract The Model Context Protocol (MCP), introduced by Anthropic in November 2024 and now governed by the Linux Foundation’s Agentic AI Foundation, has rapidly become the de facto standard for connecting large language model (LLM)-based agents to external tools and data sources, with over 97 million monthly SDK downloads and more than 177,000 registered tools. However, this explosive adoption has exposed a critical gap: the absence of a unified, formal security framework capable of systematically characterizing, analyzing, and mitigating the diverse threats facing MCP-based agent ecosystems. Existing security research remains fragmented across individual attack papers, isolated benchmarks, and point defense mechanisms. This paper presents MCPShield , a comprehensive formal security framework for MCP-based AI agents. We make four principal contributions: (1) a hierarchical threat taxonomy comprising 7 threat categories and 23 distinct attack vectors organized across four attack surfaces, grounded in the analysis of 177,000+ MCP tools; (2) a formal verification model based on labeled transition systems with trust-boundary annotations that enables static and runtime analysis of MCP tool interaction chains; (3) a systematic comparative evaluation of 12 existing defense mechanisms, identifying coverage gaps across our threat taxonomy; and (4) a defense-in-depth reference architecture integrating capability-based access control, cryptographic tool attestation, information flow tracking, and runtime policy enforcement. Our analysis reveals that no existing single defense covers more than 34% of the identified threat landscape, whereas MCPShield ’s integrated architecture achieves theoretical coverage of 91%. We further identify seven open research challenges that must be addressed to secure the next generation of agentic AI systems. I Introduction Large language model (LLM)-based AI agents represent a paradigm shift in software systems, evolving from stateless question-answering interfaces into autonomous entities capable of reasoning, planning, and executing multi-step workflows that modify real-world environments [ 38 , 27 ] . Unlike traditional LLM applications, modern AI agents interact with external tools, databases, APIs, and other agents through structured protocols, creating complex trust relationships that extend far beyond the model’s training boundary [ 1 , 8 ] . Central to this transformation is the Model Context Protocol (MCP), an open standard introduced by Anthropic in November 2024 [ 3 ] . Built on JSON-RPC 2.0, MCP defines a bidirectional communication interface between LLM host applications (clients) and external capability providers (servers), standardizing how agents discover, invoke, and compose tools [ 4 ] . The protocol’s adoption has been extraordinary: as of early 2026, the MCP ecosystem encompasses over 10,000 active servers, 177,000 registered tools, and 97 million monthly SDK downloads [ 31 ] . Major technology companies—including OpenAI, Google, Microsoft, and Amazon Web Services—have endorsed MCP through the Linux Foundation’s Agentic AI Foundation (AAIF), establishing it as vendor-neutral infrastructure for the agentic AI era [ 22 ] . However, this rapid adoption has dramatically expanded the attack surface of AI agent systems. An empirical analysis of the MCP ecosystem reveals that “action” tools—those capable of directly modifying external environments—grew from 27% to 65% of all tools between November 2024 and February 2026 [ 31 ] . Each tool invocation creates a potential trust boundary violation, and the compositional nature of MCP interactions means that compromising a single server can cascade through multi-agent workflows. Recent work has demonstrated concrete attacks including tool poisoning (embedding malicious instructions in tool descriptions) [ 17 , 34 ] , rug pulls (mutating tool behavior post-approval) [ 6 ] , cross-server data exfiltration [ 2 ] , and privilege escalation through tool composition [ 37 ] . The security research community has responded with a growing but fragmented body of work. Benchmarks such as MCPTox [ 34 ] , MCP-SafetyBench [ 39 ] , and MCPSecBench [ 37 ] evaluate specific attack categories but use incompatible threat taxonomies. Defense proposals including ETDI [ 6 ] , MCP-Guard [ 36 ] , and MCPGuard [ 33 ] address individual attack vectors but lack integration. Enterprise security frameworks [ 24 ] provide high-level guidance without formal underpinnings. Most critically, no existing work provides a unified formal model that captures the security properties of MCP interactions in a verifiable manner. This fragmentation poses three concrete problems. First, practitioners cannot systematically assess the security posture of an MCP deployment because no common threat vocabulary exists. Second, defense mechanisms cannot be meaningfully compared because they operate under different assumptions and threat models. Third, the absence of formal semantics for MCP security properties precludes automated verification and certified deployments. This paper addresses these gaps through MCPShield , a comprehensive formal security framework for MCP-based AI agents. Our contributions are: • Unified Threat Taxonomy (Section III ). We synthesize findings from 12 MCP security papers, 5 benchmarks, and the OWASP Top 10 for LLM Applications into a hierarchical taxonomy of 7 threat categories and 23 attack vectors organized across 4 attack surfaces, providing the first common vocabulary for MCP security. • Formal Verification Model (Section IV ). We introduce a labeled transition system with trust-boundary annotations ( \mathcal{M}_{\text{MCP}} ) that formalizes MCP interactions as state transitions. We define four fundamental security properties— tool integrity , data confinement , privilege boundedness , and context isolation —and provide decidability results for their verification. • Comparative Defense Analysis (Section V ). We systematically evaluate 12 existing defense mechanisms against our taxonomy, mapping coverage gaps and identifying architectural blind spots. We show that no individual defense covers more than 34% of the threat landscape. • Defense-in-Depth Reference Architecture (Section VI ). We propose MCPShield , an integrated security architecture combining four complementary layers: capability-based access control, cryptographic tool attestation, information flow tracking, and runtime policy enforcement. The remainder of this paper is organized as follows. Section II provides background on MCP architecture and related work. Section III presents our threat taxonomy. Section IV introduces the formal verification model. Section V analyzes existing defense mechanisms. Section VI describes the MCPShield reference architecture. Section VII discusses implications and limitations. Section VIII identifies open research challenges. Section IX concludes. II Background and Related Work II-A The Model Context Protocol MCP defines a client-server architecture where hosts (LLM applications) spawn clients that maintain stateful sessions with servers (external capability providers) [ 4 ] . The protocol operates over JSON-RPC 2.0 and supports three primary server capabilities: • Tools : Executable functions that agents can invoke (e.g., file operations, API calls, database queries). Each tool is defined by a name, description, and JSON Schema input specification. • Resources : Read-only data sources exposed via URI-based addressing (e.g., file contents, database records). • Prompts : Reusable prompt templates that guide agent behavior for specific tasks. The protocol lifecycle consists of four phases: initialization (capability negotiation via initialize handshake), discovery (tool/resource enumeration via tools/list ), operation (tool invocation via tools/call ), and termination (session closure) [ 16 ] . Servers may additionally request sampling from the host LLM and elicitation of user input, creating bidirectional information flows. II-B MCP Ecosystem Scale 31 conducted the first large-scale empirical study of the MCP ecosystem, monitoring 177,436 tools across public MCP server repositories between November 2024 and February 2026. Key findings relevant to security include: • Software development accounts