Token-Flow Firewall: Semantic Runtime Auditing for Persistent AI Agents

📄 arXiv: 2607.08395v1 📥 PDF

作者: Puji Wang, Yingchen Zhang, Ruqing Zhang, Jiafeng Guo, Xueqi Cheng

分类: cs.CR, cs.CL

发布日期: 2026-07-09


💡 一句话要点

提出Token-Flow Firewall以解决持久AI代理的安全问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 持久AI代理 语义审计 安全防护 自然语言处理 运行时监控

📋 核心要点

  1. 持久AI代理的安全性面临挑战,现有方法无法有效防止不安全内容的传播。
  2. 提出TokenWall作为语义防火墙,通过对令牌流进行边界感知的语义审计来拦截不安全行为。
  3. 实验表明,TokenWall将攻击成功率降低至12.5%,并保持高达97.4%的良性通过率,且延迟仅增加0.69秒。

📝 摘要(中文)

持久AI代理将大型语言模型(LLMs)扩展到长期软件系统中。与传统聊天助手不同,这些代理中的不安全内容可以通过持久状态、可重用技能和工具介导的交互传播,从而形成更大的语义攻击面。我们观察到,这些代理中的大多数安全关键交互通过自然语言令牌流传输,包括内存更新、工具参数、检索文件和组件间通信。基于这一观察,我们提出了TokenWall,一个在代理令牌流上作为语义防火墙的运行时防御框架。TokenWall在执行前对这些流进行边界感知的语义审计,构建结构化的源-汇审计记录,并在执行前进行轻量级本地检查,同时将模糊的高风险案例选择性地上升到更强的仲裁模块。实验结果表明,TokenWall将攻击成功率降低到12.5%,同时保持97.4%的良性可执行通过率,且仅增加0.69秒的延迟,展示了持久AI代理的实用安全-效用权衡。

🔬 方法详解

问题定义:本论文旨在解决持久AI代理中不安全内容传播的问题。现有方法在审计和仲裁方面存在不足,无法全面覆盖所有潜在风险。

核心思路:论文提出的TokenWall框架通过对自然语言令牌流进行语义审计,能够在不安全行为到达特权运行时汇之前进行拦截,从而增强安全性。

技术框架:TokenWall的整体架构包括多个模块:首先进行边界感知的语义审计,构建源-汇审计记录;然后进行轻量级本地检查,最后对模糊的高风险案例进行仲裁。

关键创新:TokenWall的主要创新在于实现了全面覆盖的预执行调解,区别于以往依赖稀疏审计或远程大模型监督的方法。

关键设计:在设计中,TokenWall采用了轻量级的本地检查机制,确保在执行前对令牌流进行有效审计,且在高风险情况下能够快速上升到更强的仲裁模块。实验中,系统的延迟控制在0.69秒以内,确保了良好的用户体验。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,TokenWall将攻击成功率降低至12.5%,同时保持97.4%的良性可执行通过率,且仅增加0.69秒的延迟。这表明该方法在安全性和实用性之间实现了良好的平衡。

🎯 应用场景

该研究的潜在应用领域包括智能助手、自动化客服和其他需要长期交互的AI系统。通过增强安全性,TokenWall可以有效防止不安全内容的传播,提升用户信任度和系统可靠性,具有重要的实际价值和未来影响。

📄 摘要(原文)

Persistent AI agents extend large language models (LLMs) beyond single-turn interaction into long-lived software systems. Unlike traditional chat assistants, unsafe content in these agents can propagate through persistent state, reusable skills, and tool-mediated interactions, creating a substantially larger semantic attack surface. We observe that most security-critical interactions in such agents are transmitted through natural-language token flows, including memory updates, tool arguments, retrieved files, and inter-component communications. This observation enables a new security formulation: unsafe behavior can be intercepted as risky semantic flows before reaching privileged runtime sinks. Based on this insight, we propose TokenWall, a runtime defense framework that acts as a semantic firewall over agent token flows. TokenWall performs boundary-aware semantic auditing over these flows, constructing structured source-sink audit records, applying lightweight local inspection before execution, and selectively escalating ambiguous high-risk cases to stronger arbitration modules. Unlike prior approaches that rely on sparse auditing or remote large-model oversight, TokenWall enables full-coverage pre-execution mediation while reducing remote arbitration and latency. Experiments on CIK-Bench show that TokenWall reduces attack success rate to 12.5% while maintaining a 97.4% benign executable pass rate without human confirmation. TokenWall further introduces only 0.69 seconds of additional latency on benign cases, demonstrating that semantic runtime containment can achieve a practical security-utility trade-off for persistent AI agents.