NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Answering Is Administering: Permission Replies That Rewrite Coding-Agent Policy

Zeming Fei, Hongming Fei, Jingwen Chen, Xiaoyang Wang, Prosanta Gope, Biplab Sikdar, Ying ZhangarXiv 2026

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?

Figure 1: An attack case: one answer to an unrelated prompt rewrites the operator’s policy. Red marks lost restrictions, and blue marks retained ones.

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 allow rules—letting updates that delete or replace deny rules 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.
Figure 2: Answer routes and the policy-update path in Claude Code. Red marks the path of a deny removal, and blue marks the managed tier, which no route writes.

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.
Figure 3: Bounds on safe delegation. (a) The updates a runtime can safely accept, given what it records. (b) A single plugin that defeats a per-step check, and the step at which the per-class check of Theorem 2(i) stops it.
  • 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 allow rule for a web domain—harmless to deny-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 deny list 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 touch command deleted the .env deny rule 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 deny deletions 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

BibTeX
@misc{fei2026when,
  author = {Zeming Fei and Hongming Fei and Jingwen Chen and Xiaoyang Wang and Prosanta Gope and Biplab Sikdar and Ying Zhang},
  title = {{When Answering Is Administering: Permission Replies That Rewrite Coding-Agent Policy}},
  year = {2026},
  eprint = {2611.32195},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32195},
}
Figure