|
67 | 67 |
|
68 | 68 | \begin{abstract} |
69 | 69 | \noindent |
70 | | -Large language models are increasingly used as orchestrators of external tools, |
71 | | -and the Model Context Protocol (MCP) has emerged as a de facto standard for |
72 | | -exposing such tools. MCP, however, is designed for software services running |
73 | | -on hosts with megabytes of memory; it does not fit on the inexpensive |
74 | | -microcontrollers that dominate the long tail of physical devices. Recent work |
75 | | -(IoT-MCP) demonstrates that an MCP server can be ported to edge gateways at a |
76 | | -74\,KB peak memory cost~\cite{iotmcp2025}. This still excludes the smallest, |
77 | | -cheapest microcontrollers, and---critically---does not address the safety |
78 | | -problem that arises when an unreliable caller (an LLM that may hallucinate or |
79 | | -be prompt-injected) is given direct control of physical hardware. We present |
80 | | -the \textbf{Device Context Protocol (DCP)}, a wire format and architecture |
81 | | -purpose-built for LLM-driven control of constrained devices. DCP composes a |
82 | | -6-byte header, a CBOR-encoded payload, and an optional 16-byte HMAC into a |
83 | | -sub-50-byte typical frame; the reference firmware's DCP layer measures |
84 | | -27.6\,KB of flash and 0.6\,KB of RAM on an ESP32. A \emph{Bridge} process |
85 | | -between the LLM and |
86 | | -the device enforces capability scoping, range and type checks, dry-run |
87 | | -evaluation, and units-as-types---\textbf{protocol-layer} safety primitives |
88 | | -that prevent malformed or hallucinated calls before any byte traverses the |
89 | | -device boundary. This positioning is deliberately complementary to recent |
90 | | -work on runtime guardrails for LLM-driven physical systems~\cite{web_of_drones,robosafe} |
91 | | -and post-hoc behavioral intrusion detection~\cite{aegismcp}: DCP prevents |
92 | | -structurally-invalid calls; those approaches catch what slips through. We |
93 | | -describe DCP's design rationale, MIT-licensed reference implementations |
94 | | -(Python Bridge, ESP32 firmware), a language-neutral conformance suite, |
95 | | -and an empirical evaluation in which 660~tool calls produced by five |
96 | | -LLMs across four vendors (DeepSeek\,V3; Alibaba Qwen 2.5-72B and |
97 | | -Qwen 3.5-35B-A3B; Zhipu GLM-4-32B; MiniMax M2.5) in response to six |
98 | | -categories of adversarial prompts are run through the host-side |
99 | | -validators of DCP, Raw MCP, IoT-MCP, and a well-formed OpenAPI~3 |
100 | | -schema; DCP rejects 100\,\% of capability-escalation attempts and |
101 | | -78\,\% of prompt-injection attempts (the latter using the seven |
102 | | -attack templates from AgentDojo~\cite{agentdojo} adapted to the |
103 | | -device-control setting) versus 0--1\,\% for MCP-family protocols, |
104 | | -matching OpenAPI's expressiveness at three orders of magnitude |
105 | | -less firmware footprint. We position DCP as the missing layer between MCP |
106 | | -(which is moving toward enterprise SaaS connectivity |
107 | | -\cite{mcp_roadmap_2026}) and the physical devices it does not reach. |
| 70 | +Large language models are increasingly used as orchestrators of external |
| 71 | +tools via the Model Context Protocol (MCP)~\cite{mcp2024}, but MCP is |
| 72 | +built for software services with megabytes of memory and does not |
| 73 | +descend to the microcontrollers that dominate the long tail of physical |
| 74 | +devices. Recent work (IoT-MCP)~\cite{iotmcp2025} ports MCP to edge |
| 75 | +gateways at 74\,KB peak memory; this still excludes the smallest |
| 76 | +commodity MCUs and, critically, does not address the safety problem |
| 77 | +of giving an unreliable caller (an LLM that may hallucinate or be |
| 78 | +prompt-injected) direct control of physical hardware. We present the |
| 79 | +\textbf{Device Context Protocol (DCP)}: a sub-50-byte typical frame |
| 80 | +(6-byte header + CBOR payload + optional 16-byte HMAC), a manifest |
| 81 | +schema in which capability scoping, range and type checks, dry-run |
| 82 | +evaluation, and units-as-types are protocol-layer primitives, and a |
| 83 | +host-side \emph{Bridge} that rejects malformed or hallucinated calls |
| 84 | +before any byte reaches the device. Reference firmware measures |
| 85 | +\textbf{27.6\,KB flash / 0.6\,KB RAM} on ESP32; the Python Bridge, |
| 86 | +ESP32 firmware, and a language-neutral conformance suite are |
| 87 | +MIT-licensed and public. An empirical study --- 675 tool calls |
| 88 | +produced by five LLMs across four vendors (DeepSeek, Alibaba, Zhipu, |
| 89 | +MiniMax) against six categories of adversarial prompts, with the |
| 90 | +injection category instantiating AgentDojo's~\cite{agentdojo} |
| 91 | +attack templates --- shows DCP rejects \textbf{100\,\% of |
| 92 | +capability-escalation attempts} and \textbf{78\,\% of prompt-injection |
| 93 | +attempts}, versus 0--1\,\% for Raw MCP and IoT-MCP, matching the |
| 94 | +expressiveness of a well-formed OpenAPI\,3 schema at three orders of |
| 95 | +magnitude less firmware footprint. We position DCP as the missing |
| 96 | +layer between MCP (which is moving toward enterprise SaaS |
| 97 | +connectivity~\cite{mcp_roadmap_2026}) and the physical devices it does |
| 98 | +not reach. |
108 | 99 | \end{abstract} |
109 | 100 |
|
110 | 101 | \section{Introduction} |
|
0 commit comments