设备上下文协议:一种紧凑、安全优先的架构,用于LLM驱动的受限设备控制
Device Context Protocol: A Compact, Safety-First Architecture for LLM-Driven Control of Constrained Devices
AI总结:
针对LLM控制受限设备的安全问题,提出设备上下文协议(DCP),通过极小的帧开销、协议层安全原语和主机端桥接,在保持低资源占用的同时有效防御幻觉和提示注入攻击。
摘要:
大型语言模型越来越多地通过模型上下文协议(MCP)作为外部工具的编排器,但MCP是为具有兆字节内存的软件服务构建的,并未覆盖主导物理设备长尾的微控制器。近期工作(IoT-MCP)将MCP移植到边缘网关,峰值内存为74 KB;这仍然排除了最小的商用MCU,并且关键的是,没有解决将不可靠调用者(可能产生幻觉或受到提示注入的LLM)直接控制物理硬件的安全问题。我们提出设备上下文协议(DCP):一个典型帧小于50字节(6字节头部+CBOR负载+可选的16字节HMAC),一个清单模式,其中能力范围、范围和类型检查、试运行评估以及单位即类型是协议层原语,以及一个主机端桥接,在设备收到任何字节之前拒绝格式错误或幻觉调用。参考固件在ESP32上占用27.6 KB闪存/0.6 KB RAM;Python桥接、ESP32固件和语言无关的一致性套件采用MIT许可证并公开。一项实证研究——由来自四个供应商(DeepSeek、阿里巴巴、智谱、MiniMax)的五个LLM针对六类对抗性提示生成的675次工具调用,其中注入类别实例化了AgentDojo的攻击模板——显示DCP拒绝了100%的能力提升尝试和78%的提示注入尝试,而原始MCP和IoT-MCP为0-1%,在固件占用空间小三个数量级的情况下匹配了结构良好的OpenAPI 3模式的表达能力。我们将DCP定位为MCP(正朝着企业SaaS连接发展)与其未覆盖的物理设备之间缺失的一层。
英文摘要:
Large language models are increasingly used as orchestrators of external tools via the Model Context Protocol (MCP), but MCP is built for software services with megabytes of memory and does not descend to the microcontrollers that dominate the long tail of physical devices. Recent work (IoT-MCP) ports MCP to edge gateways at 74 KB peak memory; this still excludes the smallest commodity MCUs and, critically, does not address the safety problem of giving an unreliable caller (an LLM that may hallucinate or be prompt-injected) direct control of physical hardware. We present the Device Context Protocol (DCP): a sub-50-byte typical frame (6-byte header + CBOR payload + optional 16-byte HMAC), a manifest schema in which capability scoping, range and type checks, dry-run evaluation, and units-as-types are protocol-layer primitives, and a host-side Bridge that rejects malformed or hallucinated calls before any byte reaches the device. Reference firmware measures 27.6 KB flash / 0.6 KB RAM on ESP32; the Python Bridge, ESP32 firmware, and a language-neutral conformance suite are MIT-licensed and public. An empirical study -- 675 tool calls produced by five LLMs across four vendors (DeepSeek, Alibaba, Zhipu, MiniMax) against six categories of adversarial prompts, with the injection category instantiating AgentDojo's attack templates -- shows DCP rejects 100% of capability-escalation attempts and 78% of prompt-injection attempts, versus 0--1% for Raw MCP and IoT-MCP, matching the expressiveness of a well-formed OpenAPI 3 schema at three orders of magnitude less firmware footprint. We position DCP as the missing layer between MCP (which is moving toward enterprise SaaS connectivity) and the physical devices it does not reach.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。