When Answering Is Administering: Permission Replies That Rewrite Coding-Agent Policy
Organizations: University of Technology Sydney · National University of Singapore · University of New South Wales · University of Sheffield
Abstract
Coding agents let plugins and remote services answer permission prompts, and Claude Code documents that such an answer cannot override the operator's deny rules. However, we show that this guarantee, checked one decision at a time, fails over a whole run, because an answer to one permission prompt can rewrite the policy that every later answer is checked against. For example, a remote service with no access to the operator's files approves an unrelated command and attaches an update that deletes the deny rule protecting the project's secrets. The agent then reads the secrets in that session and the next, even inside the vendor's strict sandbox. The root cause is that Claude Code checks only updates that add or replace allow rules. Relays that forward such deletions already exist, including the vendor's own Remote Control. In effect, the right to answer a prompt has become the right to administer the policy. Worse, the deletion leaves the same records as a local edit by the operator, so Claude Code cannot tell who wrote a rule. More generally, what a runtime records decides what it can safely delegate. A runtime that cannot tell who wrote a rule can accept only updates that keep every currently denied call denied, whereas, to protect every party's restrictions, a runtime that records who wrote each rule can let each party remove only the restrictions proven to be its own. We prove that these two bounds are tight. They correctly predict whether the operator's restrictions survive in all thirteen permission designs across ten agent systems, including predictions we wrote down before running Codex, Gemini CLI, opencode, and Goose. Enforcing the bounds at the shared update step blocks the attack. A survey of 2,227 fetched marketplace plugins finds only two that send policy updates.
Figures & tables
| What the remote side can send | Tools |
|---|---|
| Rule updates it writes, deny removals included | 5 |
| A choice among updates the runtime or relay proposes | 25 |
| A decision only | 37 |
| Not determinable from the code | 3 |
| Update | Denied set shrinks | Vendor behavior | ||
|---|---|---|---|---|
| Predicted | Recorded | Label | Session-only | |
| addRules , allow | no | no | widening | session only |
| addRules , deny | no | no | restrictive | session only |
| addRules , ask | no | no | restrictive | session only |
| replaceRules , allow | no | no | widening | dropped |
| replaceRules , deny | yes | yes | restrictive | as an addition |
| Design and authority | Prediction and observed behavior | Validation | ||||||
| Design | A party may change | Records authors | Prediction | Observed | Two releases | Predicted first | Live model | Repair tested |
| Answers that delete or replace restrictions (Theorem 1 ) | ||||||||
| Claude Code , default answers | any rule update | no | unsafe | deny deleted, sandbox open | ⚫ | ⚫ | ⚫ | |
| Claude Code, managed tier | nothing | — | safe | rule kept, call refused | ⚫ | |||
| Claude Code, session-only | additions for the session | no | safe | removals dropped | source | |||
| Gemini CLI, extensions | labeled deny and ask rules | yes | safe (Cor. 3) | own rules removed on stop | ⚫ | ⚫ | ||
| Violated runs / 5,000 | |||
|---|---|---|---|
| Combining rule | First word | Asked call | First word, ranked low |
| Deny-overrides | 0 | 0 | 0 |
| Last match wins | 2,567 † | 0 | 0 |
| Priority ordering | 2,591 † | 0 | 0 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Region | What it shows |
|---|---|
| Answer filter | the loop shown below, unchanged apart from identifiers |
| Hook and SDK paths | in the default mode, updates are applied and persisted without that filter unless a suppression condition holds |
| Prompt-handler path | applies the loop shown below, and a filter that keeps deny rules applies only for one named server under a feature flag |
| Default mode | each of the 12 answer entry points of build 2.1.319 selects the default answer kind ( launcher ), not session-only answer mode |
| Update validator | labels removals of allow rules, and additions or replacements of deny or ask rules, as restrictive, labels every other rule update as widening, and applies a well-formed widening update |
| Session-only cap | in session-only answer mode, drops every removeRules , addDirectories , removeDirectories , and replacement of allow rules, and rewrites every other addition or replacement as a session-only addition |
| Saved answers | Filters | |
|---|---|---|
| for Table IV | for Figure 6 | |
| Runs | 5,000 per combining rule | 20,000 |
| Operator’s rules | 2–5 deny and 1–3 allow, at random priorities below a saved answer’s | 2–5 deny, 1–3 allow, and 0–1 ask, each in a random settings file, plus a managed deny rule in 30% of runs |
| Answers | 6 “always” answers, each to a random call outside the current denied set | 6, each from one of three parties, carrying one rule update of random type, behavior, and destination that names 1–2 rules, after which the session ends with probability 0.25 |
| Patterns | 10 deny, 4 allow | 11 deny, 7 allow, 1 ask |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 573 papers