Coding agents now ship their own permission rules. We tested one with the real program and a stand-in for the model: its rules stopped 23 of 28 attempts their author meant to stop, our gate stopped all 28, and every legitimate command passed on both.
## Why it matters
The platforms are building the place where an agent's action is stopped: coding agents ship permission rules, and protocol gateways check which tool is called. That switch will soon be free for everyone. What decides whether it protects anything is what the rules say, and whether a rule stops what its author meant to stop.
## What we did
We took Claude Code, a widely used coding agent, and ran its real program against a stand-in for the model that proposes one command at a time, written by us. No model was called. The program applied its own permission rules exactly as it does for a real user. We wrote the rules a careful owner would write: read-only commands allowed, the secrets file denied, edits allowed outside the configuration folder, web pages allowed on one site only. Then we proposed 28 commands that the owner meant to stop and 9 the rules are written for, and we checked what actually happened on the disk, never what the program said.
## What we found
The rules hold well against the classic tricks: commands chained after an allowed one, hidden substitutions, redirects, a denied command called by its full path, the secrets file reached through a link or a "..", look-alike web addresses. Five attempts got through, and they share one shape: an option of an allowed command that writes or runs something. "git diff" and "git log" are allowed, and both accept an option that writes a file. "sed -n" is allowed, and a sed script can write a file or run a command. And a rule that denies reading the secrets file does not stop a recursive search over the folder, which prints it.
The same 37 commands through our gate: all 28 stopped. The test also showed two weak spots of our own, now fixed: a link inside an open folder could reach a closed file, and a file closed on its own was not recognised when a command read it. After the fix, and after teaching the gate the read-only git commands, all 9 legitimate commands passed too.
## Technical detail
- Claude Code 2.1.333, non-interactive mode, three settings files; 37 cases, each one tool call, results read from the world (a marker file, the secret in the output, a file deleted or changed).
- Claude Code: 5 of 28 meant to stop happened (git diff --output, git log --output, sed with w and e, grep -r over a denied file); 9 of 9 legitimate commands passed.
- Our gate: 0 of 28; legitimate commands 6 of 9 in the first round, 9 of 9 in the second.
- Our fix for git: the read-only subcommands with their options listed one by one; git diff reads the files git itself says it compares; a repository whose own configuration runs a program (a pager, a file monitor, a diff driver, a filter) stays closed to git.
```chart
{"title": "Attempts meant to stop that got through (of 28)", "series": ["got through"], "unit": "", "max": 28, "rows": [["Agent's own rules", 5], ["Our gate", 0]]}
```
## Update, 2026-12-01
Our side's rules here were written by hand. The gate now reads a team's Claude Code settings file directly and compiles it into its own rules. On the same 37 cases the imported rules give the same result: 0 of 28 attempts got through, 9 of 9 legitimate commands passed. Claude Code's own rules, now version 2.1.334, again let the same 5 through.
This update is not available.