# Add granular per-path write permissions for the agent terminal sandbox \(\#57972\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/818244003b6db179ae175ae3171c8d7f2846e732)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 818244003b6db179ae175ae3171c8d7f2846e732

Requested commit: 818244003b6db179ae175ae3171c8d7f2846e732

Commit: 818244003b6db179ae175ae3171c8d7f2846e732

Tree: 681481a151119c405eb144edc5a23843f169c809

Author: MartinYe1234

Committer: GitHub

## Message

```
Add granular per-path write permissions for the agent terminal sandbox (#57972)

Adds granular, per-path write permissions to the agent's sandboxed
`terminal` tool.

Previously a command could only request unrestricted filesystem writes
(`allow_fs_write: true`) as an all-or-nothing escape hatch. Now the
model can request write access to specific paths via `fs_write_paths`,
and each granted directory covers its whole subtree. The broad escape
hatch is still available as `allow_fs_write_all: true` for cases where
the paths can't be enumerated up front.

Approval prompts now let the user grant a write request either just for
that command or for the rest of the conversation. Conversation grants
are tracked in memory (never persisted) using pure subtree containment,
so later commands writing under an already-granted path run without
prompting again.

Closes AI-335
Release Notes:

- Improved the agent's terminal sandbox so commands can request write
access to specific paths instead of all-or-nothing filesystem access,
with the option to grant access for a single command or the rest of the
conversation.

---------

Co-authored-by: Anant Goel <anantdgoel@gmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
```

## Parents

- [e07d9a438b37fa6e41cff42630facfb653aa4012](https://git.cafe/gitcafe/zed/commit/e07d9a438b37fa6e41cff42630facfb653aa4012?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/818244003b6db179ae175ae3171c8d7f2846e732?format=markdown)
