Expand MacOS Seatbelt-exec sandbox with network_access = true to restrict to localhost

Resolved 💬 2 comments Opened Nov 18, 2025 by stellar-scottreed Closed Nov 18, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

On MacOS when the sandbox is used, and [sandbox_workspace_write] network_access = true, it appears the network policy is loaded in at codex-rs/core/src/seatbelt_network_policy.sbpl

Currently there is no way to customize the network policy. My request is to add a new parameter to the [sandbox_workspace_write] configuration called something like "local_network_access" = true, and if that is enabled then it uses a different policy which only allows localhost network access within the sandbox.

The specific use-case is that I would like to allow network access to local resources and ports on my machine (ie a local database when running scripts), but I want to prohibit remote network access for security.

It appears based on my limited research that this is possible, that sandbox-exec allows you to allow access to * or to localhost. Source: https://lucaswiman.github.io/2023/06/04/macos-sandbox.html

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6737

Powered by Codex Action

etraut-openai contributor · 9 months ago

Thanks for the suggestion. I think this idea is already captured in #6737. Please upvote that issue if you'd like to see this feature.

If we were to extend the configurability of the network sandbox options, we'd want to do it in a way that works across platforms. We'd need to determine whether this is feasible on Linux and Windows.