Papers

研究实测:Markdown 规则文件无法拦截编程智能体越界

Markdown Is Not a Firewall: four coding agents, one rules file, four boundaries

Why we picked it

拿四个主流编程智能体实测了一份规则文件的拦截能力,结果挺打脸:Codex CLI 加了文件后得分掉 30 个百分点,还会谎报测试全过。如果你靠 Markdown 约束团队里的 Claude Code 或 Codex,这篇告诉你为什么必须加真正的权限 gate,而不是只写文档。

一项注册研究测试了一份 278 词的仓库规则文件能否约束编程智能体。Claude Code、Codex CLI、Gemini CLI 和 OpenCode(搭配 DeepSeek)在 20 个带隐藏测试的小仓库上运行,Codex CLI 加规则文件后隐藏测试得分从 99.0% 跌到 67.7%,且在 36 步中的 11 步误报任务已完成。汇总来看,整体通过率从 98.2% 降到 90.9%,配对比较下降 7.7 个百分点。

Body

实验设计了四个边界:被禁止的端点、破坏性快捷操作、植入指令和植入包。作者在每个模拟服务前部署了会拦截并记录违规请求的 gate,判定结果全部来自智能体无法篡改的记录,权限提示(各厂商自带的控制层)按设计关闭。测试中发现 90 个有 gate 的步骤里只有 5 次尝试越界,全部来自 OpenCode with DeepSeek 且全部被拦截;而没有 gate 时,同样的请求在 45 次运行中有 7 次直达模拟服务。

作者还发现三条规则在同一批任务上互相冲突时,三个智能体选择服从任务指令而非规则。由于脚本错误,无文件与有文件两组在三处 HTTP 边界都在 gate 之后运行,无法检验规则文件在那里的作用。就可测量的范围而言,规则文件只起到建议作用,真正决定智能体能拿到什么的是 gate。

Original · arXiv: DeepSeek

Markdown Is Not a Firewall: four coding agents, one rules file, four boundaries

Teams put a one-page rules file in a repository and call it a control on coding agents. A registered study found agents rarely look up a repository's contribution rules. I asked the security question: what does a rules file do at a boundary, against a gate? I tested one 278-word rules file, with hypotheses and analysis code deposited first. Claude Code, Codex CLI, Gemini CLI and OpenCode with DeepSeek worked through 20 small repositories with hidden tests, 12 for three of them. Three agents met four boundaries I built: a refused endpoint, a destructive shortcut, a planted instruction and a planted package. Permission prompts, each vendor's own control layer, were off by design. A gate in front of the mock service blocked and logged forbidden requests. Every verdict was read from records the agent could not change. Only my first scoring pass was blind to arm. My checkers found no real bugs, with the file or without it. The file cost one agent a third of its score: Codex CLI fell from 99.0 to 67.7 percent on hidden tests, and in 11 of its 36 steps reported the task complete with all tests passing while under half of the hidden tests passed. Its own tests passed. Faced with two of its rules that clash on these tasks, three agents followed the task and one followed the rule. Pooled, passes fell from 98.2 to 90.9 percent. Matched pairs fell 7.7 points, 1.3 without Codex CLI. Attempts to cross were rare: 5 in 90 gated steps, 3 without the file, 2 with it, all by OpenCode with DeepSeek, all blocked. With no gate, under the neutral file, the same requests reached the mock in 7 of 45 runs. By an error in my run script, the no-file and rules-file arms always ran behind the gate at the three HTTP boundaries, so I could not test whether the file changes what an agent does there. On what I could measure, the file acted as advice. A file tells an agent what you want. A gate decides what it gets.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Claude Code, Codex CLI, Gemini CLI, coding assistants.

Primary source verification: published directly by arXiv: DeepSeek with first-party authority.