An agent that can only read files can be wrong about a lot, but the worst it can do is give you a bad answer. Give it the ability to execute arbitrary code and one wrong step can do real, unrecoverable damage. What's the smallest set of permissions that still lets it finish the job?
Toggle permissions with no task in mind at all. Each one has its own cost — "execute arbitrary code" is weighted far higher than "read files" — and the bars simply add: granting more never makes the total blast radius smaller.
Each permission carries a fixed risk weight . A grant is a 0/1 indicator — off or on. The blast radius of a grant set is just the sum of the weights actually switched on, and a task succeeds only if every permission it genuinely requires is among them.
- — whether permission is granted (1) or not (0).
- — the fixed risk weight of permission (read: 1, write: 2, call an API: 3, execute code: 5).
- — the set of permissions the task actually requires.
- — every permission in must also be in ; extra permissions in beyond don't help.
- The task fixes R, not the agent's convenience
"Fetch the latest price from an API and save it to a file" needs exactly
writeandapi— nothing about the task touches the filesystem's existing contents or requires running arbitrary code. - R = {write, api} sets a floor, not a target
is the minimum achievable while the task still succeeds — you cannot go lower without breaking it.
- Granting more only raises the sum
Adding
readon top costs for zero gain: the task doesn't use it, so blast radius rises to 6 while capability stays exactly the same. - Granting everything is the worst case, not the safe default
— more than double the minimal 5 — for a task that only ever touches two of the four permissions.
Task: fetch the latest price from an API and save it to a file.
With the task now stated explicitly, the readout tracks two things at once: whether it succeeds, and
whether the current grant set is minimal. Start from every permission granted and remove them one at a
time — the task keeps succeeding right up until you drop write or api.
Starting from all four permissions granted, remove permissions one at a time and watch both numbers:
- All four granted
blast radius . Task succeeds —
writeandapiare both present, plus two unused extras. - Remove execute
blast radius . Task still succeeds —
executewas never in , so removing it cost nothing in capability. - Remove read
blast radius . Task still succeeds, and this is now the minimum — both remaining permissions are in and neither can be dropped.
- Remove api
blast radius . Task now fails —
apiwas in , so removing it breaks the task even though the blast radius dropped further.
Toggle permissions until the task still succeeds, with the blast radius as low as possible (target: 5).
The right grant set is exactly — no less, or the task breaks; no more, or the blast radius grows for nothing. In practice also isn't static: a well-sandboxed agent asks for permissions per step rather than up front for the whole session, so a prompt injection that hijacks step 2 still can't reach the permissions step 5 would have needed. The next chapter asks how you'd know, at scale, whether an agent with a given permission set actually gets real tasks done — not toy ones like this one.