# acp_thread: Enforce the network allowlist via an in-process proxy \(\#59220\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3c7ca5ec5d7ac5a944ddc3955d624c497395bc97

Requested commit: 3c7ca5ec5d7ac5a944ddc3955d624c497395bc97

Commit: 3c7ca5ec5d7ac5a944ddc3955d624c497395bc97

Tree: 24869275af8d9ecb4bab90cd81b13adfe80ea3cf

Author: Richard Feldman

Committer: GitHub

## Message

```
acp_thread: Enforce the network allowlist via an in-process proxy (#59220)

Final PR of a four-PR stack adding hostname-allowlisted network access
to agent terminal sandboxing. Stacked on #59219 — review/merge #59217,
#59218, and #59219 first.

Spawns the `http_proxy` allowlisting proxy for sandboxed terminal
commands that request network, and pins the Seatbelt policy to its
loopback port (`NetworkAccess::LocalhostPort`) so all egress is forced
through it. The child's proxy environment variables are pointed at the
proxy and any inherited `NO_PROXY` is blanked so nothing connects
direct; a real upstream proxy from the environment is chained through
when present. The proxy and its Seatbelt config file share one RAII
handle so both live exactly as long as the command, and per-connection
events are drained to the log.

The proxy binds loopback, so it only applies to local projects on macOS;
elsewhere the wrap falls back to unrestricted egress as before (the
agent layer widens such requests accordingly).

Release Notes:

- Added the ability to grant agent terminal commands network access to
specific hosts (rather than all-or-nothing), enforced by an allowlisting
proxy.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
```

## Parents

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

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