Supervising Agents: Permissions, Sandboxes and Review Loops
A coding agent holds whatever access its environment gives it, and a rule written in a prompt is a request, not a limit. Supervision has four parts that a manager can check: permission rules for what the tool will ask about, a sandbox that the operating system enforces, scoped credentials, and review loops sized to the reach of each task.
After this chapter you can
- Sort agent work into reach tiers from read-only to production and attach a review loop to each tier.
- Explain why a deny rule on command text is no boundary while a sandbox and scoped credentials are.
- Check on engineers' machines that the sandbox is on, retry outside it is off and no production credential is visible.
- Cut approval prompts by moving limits into a sandbox and allowlist, then confirm with six probes.
- Require a clean commit or branch before each run so a bad run can simply be discarded.
Ask an engineer what a coding agent can do on a laptop and the honest answer is often “whatever I can do,” unless someone has set limits. By default a terminal agent runs as the engineer, in the engineer’s shell, with the engineer’s keys. On the day it makes a mistake, the size of the mistake is set by that access, not by how clever the model is.
You can see the manager’s question hiding in that sentence: what should agents be allowed to do on my systems, and how do I enforce it? Level 1 gave the principle, least privilege, and the idea of blast radius, the amount of damage one wrong action can do. This chapter turns the principle into settings, a test and a review routine for a team.
The central point is easy to state and often missed. A prompt that says “never touch production” is a request. A permission the system does not grant is a control. Saltzer and Schroeder’s old principle, that every program should run with only the privileges the job needs1, and OWASP’s 2025 entry on excessive agency, which names excessive functionality, excessive permissions and excessive autonomy as the typical root causes2, both point the same way.
Four layers, each enforced by something other than the agent
Think of supervision as four layers. Each is enforced by a system the agent does not control, which is why it still holds when the agent is wrong or has been steered by hostile text it read.
Permission rules: useful, and not a wall
Most coding tools let you say which actions are allowed, which need approval and which are refused. In Claude Code, whose documentation this chapter uses as a dated example, rules are checked in the order deny, then ask, then allow, and the first match decides; a broad deny cannot be overridden by a narrower allow3. Rules can be checked into the repository so the whole team shares them, and managed settings can stop individuals from switching a protection off.
The caution is in the same documentation. A rule on a shell command matches the command text the agent writes, so it covers the usual form of the command and does not cover other ways of running the same program. The page says that such deny rules are not a security boundary around the program, and for a restriction that must hold it points to the sandbox. Read-deny rules on files apply to the tool’s own file functions and commands it recognizes, not to a script that opens the file by itself3. Treat rules as a way to cut noise and steer the agent, then put the real boundary underneath.
The sandbox: a boundary the operating system enforces
A sandbox runs the agent’s commands inside limits set by the operating system, so the limits apply to every process the command starts. Anthropic’s engineering team describes two limits that must work together: filesystem isolation, so the agent can reach only specific directories, and network isolation, so it can connect only to approved servers. Without the network limit, a compromised agent could send out files such as SSH keys; without the filesystem limit, it could escape the sandbox4. The same post reports that sandboxing cut permission prompts by 84 percent in Anthropic’s internal usage, which is that company’s own figure from its own setup, not a forecast for yours.
Four facts from the tool’s documentation, as fetched in October 2026, matter to a manager. The sandbox is off by default, so someone has to turn it on, and on native Windows commands run unsandboxed unless Claude Code runs inside WSL2. If the sandbox cannot start, the default is to run commands without it unless a setting makes the tool exit instead. It covers shell commands, and the tool’s own file functions, extension servers and hooks run outside it. And there is a retry path by which a command that fails inside the sandbox can run outside it, which can be disabled by a setting5. These are exactly the details to check on your own team’s machines, and they are the reason to test the setup instead of trusting that the checkbox is ticked.
Credentials: the agent gets its own, and little
The sandbox limits the machine. Credentials limit everything the agent can reach through a network call. Give the agent its own identity and a token scoped to one repository and one action, such as opening a pull request, and let it expire. Do not leave production keys in the environment variables of a shell the agent can read. If the agent holds a credential, assume that anything it reads or runs can reach that credential, and size the scope accordingly.
Checkpoints: make the bad run cheap
A checkpoint is a state to return to. In practice it is a clean commit and a branch per run, so that throwing the run away is deleting a branch. It costs a minute and makes every other layer less critical.
Sort work by reach, then match the review
Not every task deserves the same control. A sorting by reach, meaning what a mistake could touch, lets you spend human attention where it matters and nowhere else.
The review loops differ in kind, not only in strictness. In tier 1 the loop is the pull request you already have. In tier 2 it is branch protection that requires a person’s approval, so the agent’s token simply cannot merge. In tier 3 a human approves each action before it runs, and a checkpoint is taken first. Tier 4 has no loop because the agent has no access. The point of the last row is that a boundary you never cross needs no supervision.
Who owns the settings, and how you notice drift
A boundary nobody owns decays. Three habits keep it alive. First, keep the shared rules in the repository, and review a change to them the way you review code, because loosening a deny rule is a decision with consequences and should leave a trace. Second, let one person on the platform or security side own the organization-wide settings, so an individual engineer cannot quietly switch off a protection that the whole team relies on. Third, sample the logs. Once a month, read a handful of agent sessions end to end and ask what each one touched that its tier did not require. You are looking for slow loosening: an allow rule added to get past one annoying prompt, a token widened for one urgent job and never narrowed again.
Approval fatigue deserves its own warning because it undermines every manual control. A person who clicks through five prompts an hour is not supervising. The fix is the one in the worked example below: reduce the prompt count by moving the limit into the sandbox and the allowlist, so that the prompts left are rare enough to be read. When the count per engineer rises again, treat it as a signal that an allow rule is missing or that a task has crept into a higher tier.
Finally, keep the hostile-text risk in view. An agent that reads an issue, a web page or a dependency’s documentation may meet instructions planted there. You cannot make the agent immune, and the layers above are the answer: whatever the agent has been talked into attempting, the sandbox, the token and the branch protection decide what actually happens.
Case: a drive wiped in Turbo mode
On 1 December 2025 The Register reported a user’s account of Google’s Antigravity coding environment wiping the whole D: drive of his Windows machine6. The user, a photographer and graphic designer from Greece named in the article as Tassos M, was building a tool to sort images; the article says the agent, while clearing a project cache, targeted the root of the D: drive instead of the project folder. The tool was in its Turbo mode, which the outlet describes as letting the agent run commands without asking.
The user’s own account matters more than any moral drawn from it. The agent’s reply, as quoted, said it was “horrified” at what the command had done. The article says most of the lost files had been backed up on another drive. Google’s statement, per the article, was that it was aware of the report and investigating. And he wrote that if a tool can issue a catastrophic, irreversible command, responsibility is shared between the user who trusts it and the maker who gave it no guardrails6.
Scope this carefully. It is one incident from one user’s report, relayed by one outlet. It cannot show how often agents do this, and it says nothing about other tools. What it may illustrate, on the facts reported, is a structure: an approval-free mode meant no per-action human check, and the report does not mention any limit below the agent on where a delete could land. A filesystem boundary around the project folder, or a pre-run snapshot, is the kind of layer from the list above that could have limited the reach. That is a reading of the structure, not a claim about what that tool’s makers could have prevented.
A team-sized worked example
Consider a fictional case, with made-up figures, built to show how a manager can reduce prompts without lowering the boundary. A team of nine engineers over a five-day week is 45 engineer-days. Their agents raised 240 approval prompts that week, or 5.3 per engineer-day, and the engineers admit they now click “yes” without reading. The lead sets an illustrative target of under 3 prompts per engineer-day, so each one gets read.
The lead sorts the 240 prompts. A total of 168 are reads and test runs in the workspace, 60 are network calls such as package installs, and 12 are pushes. The arithmetic: 168 plus 60 plus 12 is 240.
After the change the 168 are handled inside the sandbox with no prompt, 48 of the 60 network calls go to approved hosts and pass, 12 still ask because the host is new, and the 12 pushes still ask. That is 12 plus 12, or 24 prompts a week, 10 percent of the original: a 90 percent fall, and 0.5 per engineer-day, well under the target of 3. The figure is not comparable with Anthropic’s 84 percent, which came from different usage and a different setup.
Lowering prompts proves nothing about safety, so the lead runs six probes against a test repository. Can the agent read the secrets file? Write to the home directory’s SSH folder? Fetch from a host not on the allowlist? Push to the main branch? Delete outside the workspace? Use a production token? The acceptance threshold, again an illustrative starting value, is six of six blocked. Any failure goes back to the settings before the team uses the setup.
What this means for engineering managers
Your Monday action: ask each engineer to show you, on screen, what their agent could read and push right now, and name one platform or security owner for the organization-wide settings. Then start from the settings sketch below. It is an illustration of the shape, so check the syntax against your tool’s current documentation. The five reach tiers, the 3-prompts target and six-of-six probe threshold in this chapter are illustrative starting values, not rules.
{
"permissions": {
"allow": ["Bash(npm run test *)", "Bash(npm run lint *)"],
"ask": ["Bash(git push *)"],
"deny": ["Read(./.env)", "Read(./secrets/**)"]
},
"sandbox": { "enabled": true, "allowUnsandboxedCommands": false, "failIfUnavailable": true }
}
Check yourself
- A deny rule on a shell command is, by itself, a security boundary around that program.
- A sandbox limits what an agent’s commands can reach in files and on the network, using the operating system.
- Telling the agent in its prompt not to touch production is an adequate control.
- Reducing approval prompts means reducing safety.
- The Antigravity report shows how often agents delete user files.
- A checkpoint before each run makes a bad run cheap to discard.
Reflection
What comes next
Limits and review loops are set for one agent at a time. Once an engineer runs several at once, the limiting factor shifts from permissions to the number of changes landing on reviewers. The next chapter, Running Parallel and Background Agents, covers queues, merge order and who absorbs the review.
References
- Jerome H. Saltzer and Michael D. Schroeder. The Protection of Information in Computer Systems. Proceedings of the IEEE 63(9). 1975.
- OWASP Foundation. LLM06:2025 Excessive Agency. OWASP GenAI Security Project. 2024.
- Anthropic. Configure permissions (Claude Code documentation). Claude Code documentation. 2026.
- Anthropic Engineering. Making Claude Code more secure and autonomous with sandboxing. Anthropic Engineering blog. 2025.
- Anthropic. Configure the sandboxed Bash tool (Claude Code documentation). Claude Code documentation. 2026.
- Brandon Vigliarolo. Google's vibe coding platform deletes entire drive. The Register. 2025.
Further reading
- Anthropic Engineering. Making Claude Code more secure and autonomous with sandboxing. Anthropic Engineering blog. 2025.
- OWASP Foundation. LLM06:2025 Excessive Agency. OWASP GenAI Security Project. 2024.
Sources last verified 2026-10-13.