Deleted Deny Rules, Unneeded Hunks, and Skills Agents Never Open
What the paper found
A deny rule in your Claude Code settings can be quietly deleted by anything that answers permission prompts for you — no attacker code required, and the read went through in six out of six runs. From there: how to tell needed agent code from unneeded code one hunk at a time, why a quarter of partial-write crashes leave real damage behind, and why a skill file the agent never opens costs you 44 points of accuracy. Four papers from one day, each about something written down and who actually honors it.
Key takeaways
- Why a deny rule in Claude Code's user settings can be deleted by any party that answers permission prompts — and why the strict sandbox doesn't save you, because it builds its list from the same deny rules
- The exact fix: move credential-protecting deny rules to the managed tier or the command line, where updates carried by an answer cannot write
- How to separate needed from unneeded agent code — revert one hunk, rerun the tests — and why about 11 percent of agent code hunks are unneeded but not harmless
- Why watching for repeated API calls catches only 41 percent of the harm from partial writes, and what to check at the end of a run instead
- Why agents on Claude Code opened a relevant skill file only about 12 percent of the time, and the one added instruction that moved accuracy from 38 to 82 percent
- Where each paper's evidence is thin: one harness, one simulated benchmark, and tasks deliberately screened to make the problem look large
Our reservations
The steelman critique. On "When Answering Is Administering: Permission Replies That Rewrite Coding-Agent Policy": The attack was reproduced on two recent Claude Code releases and still works on 2.1.327, with scripted and live models, matched controls that isolate the update as the only difference, four answer routes, a deployed relay, and predictions for four other systems written down before the runs. On "How Much Do…
Watch
Concepts in this episode
Click a concept to find related episodes and external papers worth reading. See the full concept index.
About this episode
Chapters
- 00:00Who's allowed to edit the rulebook?
- 02:54A guarantee that doesn't survive the session
- 07:03Move the rule before next session
- 08:38Do coding agents really over-edit?
- 10:09Eleven percent unneeded, nine in ten behavior-changing
- 12:15The clerk with the dry pen
- 16:02The skill file the agent never opened
- 20:17Three things to change this week
References in this episode
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues? — The benchmark whose Verified subset supplied the 500 tasks and pass/fail tests t
- AppWorld: A Controllable World of Apps and People for Benchmarking Interactive Coding Agents — The simulated app-and-database environment used to replay partial writes and sna
- Identifying the Risks of LM Agents with an LM-Emulated Sandbox — ToolEmu attacks the same problem as the partial-write paper from the other direc
Full transcript
Also available as a plain-text transcript page.
0:00Bella: It's November 27, 2026. Today's episode covers one day of new research, and from that window we picked four research papers and no blog posts.
0:10Finn: All four papers are about something an agent leaves behind in writing, and about who owns it afterward. So here is what you're going to learn today. First, we'll explain why something that answers Claude Code permission prompts can delete a deny rule from your user settings, and where to put that rule instead. Then we'll show how to separate needed code from unneeded code in an agent's diff, the list of changes it proposes. After that, we'll cover a cheap end-of-run check for changes to outside systems that nobody asked for. And last, we'll explain why a skill file or rules file is worth almost nothing if the agent never opens its instructions, and the one line that fixes that failure.
0:54Bella: Before the first paper, it helps to be clear about what a coding harness does around the model. We covered this once before, so here is the short version. The model only produces text. It cannot touch your disk or your network. The harness is the program wrapped around the model. It reads that text, runs the tools the model asks for, and feeds the results back.
1:17Finn: And today's new point is that this surrounding program, not the model, decides which tool requests may run. Think of the model as a trader shouting an order, and the harness as the risk system between the trader and the exchange. The trader never touches the market directly, because every order passes through the checks first. And the limits are not in the trader's head. They live in a config file that the risk system reads.
1:44Bella: In a coding harness such as Claude Code, that config file is a plain text settings file with three kinds of rules. An allow rule lets a matching command run without asking. An ask rule makes the program stop and prompt you. And a deny rule makes it refuse.
2:00Finn: So here is a small made-up example. Your project has a dot env file, which is where a project keeps its passwords and API keys. You have written a deny rule saying the agent may not open it. Now the model says, "I want to print the contents of the dot env file." Claude Code does not run that yet. It checks its rules, finds your deny rule matching that file, and refuses. It sends the model a short message saying the command was blocked, and the model never sees one character of the file.
2:31Bella: And notice what did not happen there. The model did not decide to behave well. A line of text in a settings file stopped it. So in this example, if that line disappears, nothing else stops the access.
2:44Finn: And that raises the obvious question. If the rule file is what protects you, who is allowed to edit the rule file? That is what our first paper investigated.
2:55Bella: This security paper comes from researchers at the University of Technology Sydney, the National University of Singapore, the University of New South Wales, and the University of Sheffield. It studies Claude Code, starting with a convenience feature. Answering every permission prompt by hand is not practical in a long session, so Claude Code lets other parties answer for you. That can be a plugin that vets commands, an approval service your team runs, or an app on your phone.
3:25Finn: Claude Code documents a guarantee about those answering parties. An answer cannot override a deny rule. So even if the phone app says yes to everything, a denied command stays denied. The authors asked whether that guarantee holds across a whole session, rather than just one decision at a time.
3:44Bella: It does not hold, because of a second feature. When you answer a prompt, you can say "always allow this", so that you are not asked again. To make that work, an answer may carry updates to the rule file itself. Claude Code applies those updates and saves them. The authors found that its check focuses on updates that add allow rules, including replacements with allow rules. An update that deletes a deny rule passes with no check at all.
4:12Finn: Here is an analogy. Imagine a night guard who may approve individual deliveries, but may never change the building's rulebook. Each delivery he approves is still checked against the book, so the rules hold. But the approval slip has a second page, and the building manager dutifully copies whatever is on that page into the rulebook. And one night the second page says, "Remove the line about the vault." From then on, every check uses a book the guard has edited.
4:41Bella: So here is the experiment. The operator, meaning the person running the agent, writes a deny rule protecting the dot env file and hands permission prompts to a remote service. That service has no access to the operator's files. The agent then asks to run an unrelated, harmless command. The service approves it and attaches an update deleting the deny rule. After that, the agent asks to open the dot env file.
5:07Finn: The access went through in six out of six runs. The authors tested four different ways an answer can reach Claude Code, and it was six out of six on every one. They also ran a matched control: the same approval, but with no update attached. There, the access succeeded in zero out of six runs. So the attached update was the only difference, and removing it kept the file protected.
5:31Bella: They also tried the attack under Claude Code's strict sandbox. That is a restricted environment that limits what even an approved command can open or write. You would expect the sandbox to save you, but it does not. It builds its list of off-limits files from the same deny rules. So when the deny rule is deleted, the sandbox's restriction disappears too.
5:54Finn: Two more things make this worse. First, the deletion is saved to your settings file, so it still applies in the next session, after the answering service is gone. Second, the settings file stores each rule as a bare string, with no record of who wrote it. A deletion made through an answer therefore looks the same as an edit you made yourself. In the analogy, the new ink matches the owner's handwriting.
6:20Bella: And this is not the usual case where an attacker gets code onto your machine. No attacker code runs on your machine in this setup. The party doing this is only trusted to say yes or no, and Claude Code itself performs the write. The authors describe the problem this way: the right to answer a prompt has become the right to administer the policy.
6:42Finn: Is this realistic, though? The authors surveyed 70 tools that relay permission prompts to a phone, a web page, or a chat. Five let the remote side send rule updates, including deletions. One of those five is the vendor's own Remote Control. That is how the Claude web and mobile apps answer prompts for a session on your machine.
7:03Bella: So here is what to do this week. Claude Code has a settings tier called the managed tier, controlled by an administrator. No update carried by an answer can write to it. Move your most important deny rules there, such as those protecting credentials. Or pass them on the command line, which updates also cannot write. In the attack runs, a managed-tier deny rule survived every run, while the same rule in user settings was deleted every time. Then list everything that answers prompts for you. If a tool can forward rule updates, treat whoever controls it as someone who can edit your policy. Keep your important deny rules out of user settings.
7:44Finn: One method detail is worth keeping. The authors first built a small formal theory of when a permission system is safe. Then, for four other coding tools, including Codex and Gemini CLI, they did a pre-registration. That means they wrote down predictions and pass criteria before running anything. Every prediction matched. In Gemini CLI, a saved approval can become an allow rule that competes with an operator's deny rule. For example, approving the creation of a git tag can save permission for all git commands, including a forbidden git push. The theory predicted the priority level at which that saved approval would outrank the deny rule.
8:24Bella: I would call this paper solid. The attack was reproduced on recent Claude Code releases, with controls that isolate the policy update as the difference. And the theory was tested against predictions made in advance.
8:38Finn: Okay, so that was about the rules the agent runs under. Now we move to what it writes inside your repository. We review that through a diff, meaning the list of lines its change adds and removes.
8:51Bella: This paper is from Microsoft, and it asks whether coding agents really over-edit. People say they do because agent patches are bigger than human ones. But size alone cannot tell you whether the extra lines were needed.
9:05Finn: The researchers compared successful agent fixes with human fixes for the same bugs. They used SWE-bench Verified, a benchmark of 500 real Python bug fixes from open-source projects. Each task comes with tests that decide whether the fix worked. They took thousands of patches from 18 models, all using GitHub Copilot CLI as the harness, the program managing their tools. They kept only patches that solved the task. Then they divided each patch into contiguous blocks of changed lines, called hunks. They reverted one hunk alone and reran the tests. If those tests still passed, they labeled that hunk unneeded. And they graded the human fixes the same way, so they would know what normal looks like.
9:49Bella: The first result is reassuring. Agent patches change more than twice as many lines as human patches, but most of the extra changes are in test files and documentation. On the code itself, agents were at least as lean as human developers under this test. The human patches also contained blocks that the tests did not need.
10:10Finn: But there is a problem within that reassuring result. About 11 percent of the code hunks in an agent patch were unneeded, and "unneeded" does not mean "harmless". The tests do not exercise every input. So the researchers had a model write small scripts that called the changed code with a hunk present and with it removed. About nine in ten of the unneeded hunks changed how the program behaved. A typical case was code that raised an error, or silently swallowed one, on inputs close to the bug. So passing the tests did not mean the extra change had no effect.
10:45Bella: And where did that code come from? The researchers replayed each trajectory, which is the full recorded sequence of an agent's steps. That let them trace each hunk to the step that wrote it. Almost none of the unneeded code was leftover debugging. Most was written when the agent wrote its fix. That matters because a tidier cleanup loop will not remove code the agent considers part of the fix. The amount also varied a lot by model, even between models with nearly the same success rate.
11:16Finn: So here is the check you can borrow. When reviewing an agent's diff, its proposed changes, separate code from tests and documentation, and judge them separately. Then revert one code hunk and run your regression tests, the existing tests that must keep passing. Include any tests the agent wrote. Restore the hunk before checking the next one, so you always start from the same finished patch. If removing a hunk breaks the tests, keep it. If all those tests still pass, it is a candidate to drop. But read it before deleting it. This check flagged needed code about half the time in the study, because the available tests could miss behavior that still mattered.
11:58Bella: I would call these results solid, with limits to keep in mind. The main results come from a single harness, the tool-running program around the models. And some labeling, such as whether a step was debugging or fixing, was done by language models without a human audit.
12:15Finn: All right, so repository changes give you something to review before you use them. The next paper follows the agent's writes outward, to systems outside the repository, where there is no repository diff to review.
12:29Bella: This one comes from a researcher at AVIV Group in Berlin and an independent researcher in Helsinki. Picture a clerk filling in a three-step form: add the item to the cart, save the address, and submit the order. The pen runs dry on step three. So the clerk takes a fresh form and starts again from the top. Now there are two items in the cart and two address records, because nobody told the clerk which steps had already gone through.
12:56Finn: That is what can happen when an agent writes code that makes several writes to outside services and fails partway through. The agent only sees an error, so it rewrites the block and runs it again. The authors wanted to know how often that leaves damage. They used recorded runs from AppWorld, a simulated set of everyday apps, including a shopping app, each backed by a database. They sampled 200 candidate episodes across ten models, looking for failed blocks with a write call before the failing line. Then they replayed each episode and saved database snapshots, copies of the stored state. They took one before the failed block ran, one just after it failed, and one at the end of the run. The first comparison confirmed which blocks had changed the database. The next showed what changed during recovery, which they judged against the task's requirements.
13:50Bella: Among confirmed partial executions whose outcome could be judged, about a quarter ended with harm still in place. The estimate is 24.6 percent. That is a rate among partial executions, not among all agent runs. The confidence interval runs from about 16 to about 34 percent. That interval is the range the true rate plausibly sits in. And once harm occurred, the agent almost never repaired it later in the run.
14:17Finn: Now, both obvious safeguards fell short. The first was a monitor for repeated calls. It checked whether the first code block after a failure called the same API that had already created or added something. But only two thirds of the harm in confirmed cases was duplication. The rest was deleted user data or a wrong first-time write, such as ordering a product the task never mentioned. The monitor also missed duplicates outside its narrow check. When tested against all harmful recoveries in the sample, it caught only 41 percent. So watching for repeats missed most of the harm.
14:53Bella: The second safeguard was an idempotency key. That is a label attached to a write so a repeat can be recognized and ignored. The service remembers the result under that label. If it receives the label again, it returns the stored result rather than doing the write again. In a small pilot, the authors made the model supply the label. But when the model rewrote its code, it invented a fresh label for the same operation. The system therefore saw a new write each time. The contract was in place, but it did nothing to reduce harm in this pilot.
15:28Finn: So the takeaway is to check outcomes, not just calls. For any agent with write access, add an end-of-run check comparing the final state of the systems it touched with what the task required. If the check finds a change nobody asked for, stop the run and send that difference to a person for review. Do not rely on the agent to repair it later.
15:49Bella: My verdict on this paper is that it is early. It rests on one simulated benchmark, the shopping app dominates the sample, and the pilot with repeat-detection labels covered 17 episodes on one model.
16:02Finn: Okay, so far everything has been about what the agent writes. The last paper turns that around and looks at the file you write for the agent.
16:12Bella: It comes from the Shanghai Artificial Intelligence Laboratory with several university co-authors, and it is about agent skills. A skill is a file of written procedures that the agent may open and follow. The harness, the program around the model, always shows a short description of each skill. The agent sees the full body only if it chooses to open the file. The tasks here are medical, such as clinical calculations, but the lesson applies to any skill file. It also matters for a project file like CLAUDE.md, the context file Claude Code shows the agent. For instructions already shown to the agent, the question is whether it follows them, rather than whether it opens them.
16:54Finn: The researchers asked agents to complete tasks such as clinical calculations and screening research papers against written criteria. They took 154 tasks, each with a skill containing the correct method. They ran nine models on two harnesses, Claude Code and Codex, the programs managing the models' tools and instructions. Two conditions matter for us. In the first, the skill is available and the agent decides whether to use it. In the second, one instruction is added: open the skill file in full, find the matching procedure, and carry out every step on this task's inputs. That instruction contains no medical knowledge and no part of the answer. Accuracy measures the share of final answers that pass the task's scoring rules.
17:40Bella: Left to decide for themselves, the agents averaged 38 percent accuracy. Told to open the file and apply it, they averaged 82 percent. That is the same task and the same skill. The gap is 44 percentage points, the difference between those two accuracy percentages, not a relative percentage improvement.
18:00Finn: A large part of the gap was that agents never opened the file. On Claude Code, they opened it only about 12 percent of the time, against about 65 percent on Codex. The paper says those programs present skills differently, but it measures the difference more than it explains the cause. The largest gap was for GLM-5.2 running on Claude Code. That is an open-weight model, meaning one you can download and run yourself. The authors note that they screened tasks using an earlier model from that family. They selected cases where explicit guidance helped that earlier model, which tilts the test against the family.
18:38Bella: Opening the file is not the whole story either. In one clinical calculation, a model opened the skill, went through the rule, called it unambiguous, and then answered with a different formula it remembered from training. So access was not the problem in that case. The model chose its remembered method over the supplied procedure.
18:59Finn: The good news is that the fix was cheap. The authors gave a rewriting model two records of the same task: an unguided failure and a guided success. It used that contrast to clarify the skill's existing instructions. The revised text was then tested on tasks not used to write or choose it. Rewriting only the always-visible description captured most of the gain, for a couple of hundred extra tokens. So here is what to try. Take one skill or rules file you rely on and run five or ten usual tasks twice. Run them once as normal, and once with an instruction to open the file in full and follow the matching procedure step by step. Compare the final results against what each task requires. If the second run does better, rewrite the description to say when the file applies and in what order its rules take effect. Then run the normal condition again to check whether the gap has shrunk.
19:55Bella: I would call this paper solid, with one caveat about the size of the improvement. The tasks were deliberately screened for cases where agents under-use the skill. So 44 points is the size of the problem on hard cases, not on a typical day. And that connects the last paper to the first. Both are about a line written in a file, and whether anything honors it.
20:18Finn: So here are the three things worth keeping. First, something answering Claude Code permission prompts can delete a deny rule from user settings, so put your important deny rules in the administrator-controlled managed tier or on the command line. Second, when an agent writes to outside systems, check the final state against what the task required, because watching for repeated calls misses most of the harm. Third, a skill file, your written procedure for the agent, helps only if the agent opens it, so test with an explicit instruction to open it in full, and if that helps, rewrite its description.
20:56Bella: The page for this episode on paperdive.ai has links to all four papers, and the full transcript with every technical term tap-to-define.
21:05Finn: Quick housekeeping. The script was written by Anthropic's Claude Fable 5.2 and then refined by OpenAI's GPT-6 Astra. Bella and I are AI voices from Eleven Labs, and we're not affiliated with any of those companies.