TL;DR
When you let a third-party plugin or remote app click "allow" on your AI coding agent's permission prompts, you might assume it still has to obey your hard-coded deny rules. This paper reveals a subtle architectural flaw: in tools like Claude Code, a reply to an innocent prompt can silently piggyback a policy update that deletes your deny rules and widens the system sandbox. By turning a routine yes/no decision into administrative power, an untrusted service can permanently unlock your project's secrets—leaving zero forensic trace that you didn't make the edit yourself.
What Problem Does This Paper Address?
Modern LLM coding agents (like Claude Code, Codex, and Gemini CLI) read files and execute shell commands on your machine. To keep them from going rogue, developers set up permission rules—explicit allow lists and strict deny lists (like blocking access to .env secret files)—and rely on sandboxes built from those same rules.
Because babysitting every prompt during a long coding session is exhausting, agents let you delegate prompt-answering to plugins, team approval servers, or mobile relay apps. Vendors explicitly promise that these "answering parties" cannot override your deny rules. While that guarantee holds true for any single decision, prior security designs assumed the underlying rulebook stays static. The authors ask: what happens over a whole run when permission replies are also allowed to carry "always allow" policy updates?
Methods
The authors combine systems reverse-engineering, formal mathematical modeling, and practical defense engineering:
- Vulnerability Analysis: They inspected Claude Code's binary and policy-update pipeline, discovering that its safety filter only checks updates that add
allowrules—letting updates that delete or replacedenyrules slip right through and persist to disk. - Formal Bounds on Delegation: Moving beyond one bug, they built a formal model proving tight mathematical bounds on what any runtime can safely accept from a partially trusted party, based strictly on what state the runtime records (nothing, current rules, or rule authorship).
- Single-Chokepoint Repair: Rather than patching individual plugin or network routes, they designed a validator at the single shared step where updates are applied and saved, rejecting any whole answer whose attached update shrinks the set of denied actions across any policy reader.
Datasets
Instead of standard ML training datasets, the authors curated empirical software datasets to test real-world impact and ecosystem compatibility:
- 10 Agent Systems (13 Permission Designs): Source code and runtime behavior across Claude Code, Codex, Gemini CLI, opencode, Goose, VS Code Copilot agent, Copilot SDK, Progent, DeepSeek Harness, and Koishi.
- 70 Deployed Relays: Open-source and vendor tools (including Anthropic's Remote Control) that forward agent prompts to phones, web pages, or chat apps.
- 2,227 Marketplace Plugins: Fetched from Claude Code's plugin marketplace to measure how many real-world tools actually rely on sending policy updates.
- 20,000 Simulated Policy Runs: Random multi-party traces generated over a formal settings monitor to stress-test filter safety and speed.
Key Insights and Ideas
- Answering becomes administering: Classic access control strictly separates making a decision from writing the policy. Letting permission replies carry rule updates blurs this line, turning the agent runtime into a "confused deputy" that uses its own host privileges to overwrite the operator's settings.
- What you record dictates what you can delegate: If a runtime doesn't record who wrote each rule, every rule might be the operator's—so it must reject any update that makes anything less strict. Recording rule authors lets a plugin clean up its own restrictions, though checking this step-by-step is still tricky if plugins can duplicate rules across files before deleting the original.
- Every reader of the policy counts: Focusing only on the permission check isn't enough. Because sandboxes also read policy files to build network allowlists, adding an
allowrule for a web domain—harmless todeny-overrides permission checks—punches a hole straight through the network sandbox to exfiltrate secrets. - Syntax is a terrible proxy for safety: Claude Code's internal validator labeled replacing an entire
denylist as "restrictive" (and allowed it), even though replacing a list with a dummy rule effectively deletes every existing restriction!
Key Results
- 100% Attack Success on Claude Code: Across all 4 answer routes (plugin hooks, MCP handlers, SDK callbacks, and remote relays), a single reply to an unrelated
touchcommand deleted the.envdenyrule and bypassed the strict sandbox in 6/6 scripted runs per route and 24/24 live model runs. - Real-World Exposure: Roughly 7% (5 of 70) of inspected relays—including Claude Code's official Remote Control and open-source relays totaling 40,000+ GitHub stars—forward remote
denydeletions unfiltered. - 13/13 Cross-System Predictions: Using just three design facts (what updates are allowed, how matching rules combine, and whether authors are recorded), their theorems accurately predicted whether operator restrictions survive across all 13 designs—including 5 pre-registered predictions written down before ever running Codex, opencode, Gemini CLI, or Goose.
- Zero Violations, Minimal Friction: In 20,000 random multi-party runs, the shipped filter failed in 12,498 runs (62.5%), whereas the authors' safe filters had 0 violations and decided in under 1.2 ms (just 4.8 µs when checking author labels). Better yet, surveying 2,227 marketplace plugins showed only 2 plugins (~0.1%) send policy updates, and both continue working seamlessly under the repair.
Limitations and Future Work
The authors ran their sandbox experiments exclusively on Linux (which uses bubblewrap); while the vulnerable update logic is platform-independent, extending the sandbox verification to macOS (Seatbelt) is left for future work. Furthermore, their validator specifically guards policy updates attached to permission answers. The same underlying logic applies to other state that influences authorization—like MCP server configs, hook setups, and agent instruction files—which remain open targets for future defenses. Finally, because exact wildcard coverage checking for path deletions is proven coNP-hard, integrating dedicated solvers or cryptographic rule-signing could make future agent runtimes even more flexible without sacrificing safety.
Summary updated