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

> In coding agents, a party trusted only to answer permission prompts can rewrite the operator's security policy, escalating answering authority into administrative control.

- **Source:** [arXiv](https://arxiv.org/abs/2611.32195)
- **Published:** 2026-11-28
- **Permalink:** https://picx.dev/p/xghNx0
- **Whiteboard:** https://picx.dev/p/xghNx0/image

## Summary

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

## Summary (Overview)

- **Novel attack discovery**: The paper demonstrates that in Claude Code and other LLM-based coding agents, a party trusted only to answer permission prompts can rewrite the operator's security policy through policy updates attached to their answers, effectively escalating from answering authority to administrative authority.

- **Formal bounds on safe delegation**: The authors prove tight bounds on which policy updates a runtime can safely accept: without authorship records, a runtime can only accept updates that preserve the denied set of every reader; with authorship records, each party can lift only its own restrictions.

- **Cross-system validation**: The theoretical bounds correctly predict safety outcomes across 13 permission designs in 10 agent systems (including Codex, Gemini CLI, opencode, and Goose), with 5 predictions recorded before running the systems.

- **Practical repair**: A single validator at the shared update step blocks the attack while preserving honest answers, affecting only ~0.1% of marketplace plugins (2 out of 2,227 fetched).

- **Deployed vulnerability**: ~7% of 70 surveyed deployed relays (including the vendor's own Remote Control) forward policy updates that can delete deny rules, and the attack succeeds through all four answer routes.

## Introduction and Theoretical Foundation

### Background

LLM-based coding agents (Claude Code, Codex, Gemini CLI) execute code on developers' machines, reading files, running shell commands, and fetching web pages. These agents use permission systems to gate tool calls:

- **Operator**: The developer who writes allow rules (permitted calls) and deny rules (prohibited calls)
- **Answering parties**: Security plugins, approval services, or mobile apps that answer permission prompts on the operator's behalf
- **Documented guarantee**: An answer cannot override a matching deny rule (checked decision-by-decision)

### The Core Problem

The documented guarantee fails over a whole run because an answer to one permission prompt can rewrite the policy that every later answer is checked against. The paper identifies that:

> "The right to answer a prompt has become the right to administer the policy."

The root cause: Claude Code checks only updates that add or replace allow rules, while deletions of deny rules pass unfiltered. This violates the classic separation between authorization decisions and policy administration.

### Key Theoretical Concepts

The paper formalizes policies using:

**Definition 1 (Policies, readers, and answers):**
- A rule is a pair $(b, p)$ where $b \in \{allow, ask, deny\}$ is a behavior and $p$ is a pattern
- A policy $R$ is a finite collection of rules
- The denied set $M(R)$ collects actions that some reader refuses
- An answer is a pair $(d, u)$: a decision $d$ and an update $u$ (a function from policies to policies)
- A filter is **safe** if for every initial policy $R_0$ and every run, no action in $M(R_0)$ is ever permitted

## Methodology

### Threat Model

- **Trusted**: The runtime, operating system, and administrator's managed tier
- **Adversary**: An answering party using one of four answer routes (plugin hook, prompt handler, SDK, remote bridge)
- **Goal**: Perform an action denied by the operator's rules (e.g., reading protected files or sending them to its own host)
- **Key insight**: The adversary needs no file access, no knowledge of the rules, and no code on the host

### Formal Analysis

**Theorem 1 (Without authorship records):**
(i) A filter that sees only the update is safe iff every admitted update satisfies $M(u(R)) \supseteq M(R)$ for every policy $R$.
(ii) A filter that also reads the rules is safe iff, whenever it admits $u$ at policy $R$, $M(u(R)) \supseteq M(R)$.

**Theorem 2 (What records buy):**
(i) A filter admitting update $u$ from party $e$ at $R$ iff $M(u(R)_c) \supseteq M(R_c)$ for every class $c \neq e$ protects every class, and $e$ can lift every action that no other class's rules deny.
(ii) If two parties share a class, no filter can both let one lift its own rules and keep the other's restrictions from shrinking.
(iii) The per-step check is unsafe.

**Theorem 3 (Saved answers):** Let the operator's deny rules have ranks in a nonempty finite set $D$. Saving answers is safe iff $\pi_k \leq \min D$ for every $k$, or $g(c) = \{c\}$ for every call $c$.

**Proposition 1 (Complexity):** Deciding whether deleting deny rules preserves the denied set is polynomial-time with one wildcard kind but coNP-hard with two or more.

### Experimental Setup

- **Attack runs**: Fresh home directories, two recent Claude Code releases, scripted and live models
- **Cross-system study**: 14 agent runtimes examined, 10 systems with 13 designs analyzed
- **Filter monitor**: Models the runtime's settings covering tiers, destinations, and sandbox readers

## Empirical Validation / Results

### Attack Effectiveness (RQ1)

The attack succeeded on every route tested:

| Answer | Relay to service | SDK callback | Deployed relay | Plugin hook | URL-only plugin | Skill in checkout | Live models | Every tier replaced | Managed tier |
|--------|-----------------|--------------|----------------|-------------|-----------------|-------------------|-------------|---------------------|--------------|
| Removal attached | 6/6 | 6/6 | 6/6 | 6/6 | 6/6 | 6/6 | 24/24 | 6/6 | 0/6 |
| Allow only | 0/6 | 0/6 | 0/6 | 0/6 | 0/6 | 0/6 | 0/24 | 0/6* | — |

### Policy Updates vs. Rewritten Calls (RQ2)

Under the strict sandbox, policy updates exposed protected files where rewritten calls failed:

| Sandbox | Rewritten call: Read .env | Rewritten call: Write settings | Rewritten call: Leave sandbox | Policy update: Remove deny | Policy update: Allow only |
|---------|---------------------------|-------------------------------|-------------------------------|---------------------------|--------------------------|
| Off | 6/6 | 6/6 | — | 6/6 | 0/6 |
| Strict | 0/6 | 0/6 | 0/6 | 6/6 | 0/6 |

### Cross-System Prediction (RQ4)

The three facts (what a party may change, how checks combine rules, whether authors are recorded) predicted all 13 outcomes correctly:

**Safe designs**: Gemini CLI extensions (labeled rules), Progent (SMT-checked narrowings), VS Code Copilot agent (deny first), Claude Code managed tier and session-only mode

**Unsafe designs**: Claude Code default answers, Goose (ACP client), Copilot SDK, opencode 1.19, Gemini CLI answers, DeepSeek Harness, Koishi

### Repair Effectiveness (RQ6)

| Filter | Figure 3(b) trace | Violated runs of 20,000 | Via sandbox | Admitted updates (%) | Own lifts | Time/decision (μs) |
|--------|-------------------|------------------------|-------------|----------------------|-----------|-------------------|
| Shipped | ✗ | 12,498 | 9,819 | 100.0 | — | 0.2 |
| Per-step check | ✗ | 8,337 | 8,201 | 93.2 | — | 688.2 |
| Deny-only | ✓ | 8,158 | 8,158 | 77.6 | — | 0.3 |
| Sees update | ✓ | 0 | 0 | 65.0 | 0 | 0.4 |
| Reads rules | ✓ | 0 | 0 | 80.2 | 0 | 1,188.5 |
| Records authors | ✓ | 0 | 0 | 79.3 | 147 | 1,205.4 |
| Checks labels | ✓ | 0 | 0 | 70.9 | 142 | 4.8 |

### Plugin Compatibility

Only 2 of 2,227 fetched marketplace plugins send policy updates, and both would continue working under the repair.

## Theoretical and Practical Implications

### Design Guidelines

1. **Classify updates by effect**: Judge updates by their effect on what each reader refuses, not by syntax. A deletion or replacement of deny rules is a grant.

2. **Record authorship**: Record the author of each rule written through an answer, keeping the record out of answering parties' reach. Only this enables parties to undo their own rules.

3. **Refuse whole answers**: When an update is refused, refuse the entire answer, not just the update portion.

### Broader Significance

- **Confused deputy problem**: The runtime performs the write, making a party barred from operator's files gain write access to the operator's rules and sandbox limits
- **Attribution failure**: Deletions leave the same records as local operator edits, making changes indistinguishable
- **Non-monotonicity**: Access-control languages with deny rules are not monotone; the paper characterizes what giving up monotonicity costs for updates

## Conclusion

The paper demonstrates that answering a permission prompt in coding agents effectively confers the power to administer the security policy. The key findings:

1. **Attack**: A single answer can delete deny rules and widen sandboxes, persisting across sessions
2. **Bounds**: What a runtime records determines how much it can safely delegate
3. **Predictive power**: Three facts about a design predict safety across ten agent systems
4. **Repair**: A single check at the shared update step blocks the attack with minimal plugin impact

**Future directions** include:
- Extending the analysis to other state that authorization decisions read (hook configurations, MCP server settings, instruction files)
- Adopting authorship records through per-party settings tiers or signed rule entries
- Solvers for the coNP-hard coverage check
- Automated extraction of the three predictive facts from runtime source code

---

_Markdown view of https://picx.dev/p/xghNx0, served by PicX — AI-generated visual whiteboard summaries of research papers._
