feat(windows-sandbox): add network proxy support#12220
Merged
viyatb-oai merged 6 commits intomainfrom Mar 27, 2026
Merged
Conversation
f3e2f3e to
0cbe0bc
Compare
Collaborator
iceweasel-oai
left a comment
There was a problem hiding this comment.
overall looks good.
One downside is that this will cause an unexpected elevated setup UAC prompt for all users. But that is an existing limitation where we don't have a UI treatment letting people know that they need to re-setup their sandbox.
iceweasel-oai
approved these changes
Mar 11, 2026
Contributor
|
Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes Windows sandbox proxying enforceable by routing proxy-only runs through the existing
offlinesandbox user and reserving direct network access for the existingonlinesandbox user.In brief:
offlineuserofflineuser gets firewall rules that block direct outbound traffic and only permit the configured localhost proxy pathonlineuserThis brings Windows in line with the intended model: proxy use is not just env-based, it is backed by OS-level egress controls. Windows already has two sandbox identities:
offline: intended to have no direct network egressonline: intended to have full network accessThis PR makes proxy-enforced runs use that model directly.
Proxy-enforced runs
When proxy enforcement is active:
offlineidentityofflineuser that:allow_local_binding=1So the sandboxed process can only talk to the local proxy. It cannot open direct outbound sockets or do local UDP-based DNS on its own.The proxy then performs the real outbound network access outside that restricted sandbox identity.
Direct-network runs
When proxy enforcement is not active and full network access is allowed:
onlineidentityUnelevated vs elevated
The restricted-token / unelevated path cannot enforce per-identity firewall policy by itself.
So for Windows proxy-enforced runs, we transparently use the logon-user sandbox path under the hood, even if the caller started from the unelevated mode. That keeps enforcement real instead of best-effort.