Skip to content

Enforce disabled and restricted Environment networks - #890

Merged
SaladDay merged 2 commits into
mainfrom
enforce-environment-network
Oct 27, 2026
Merged

SaladDay merged 2 commits into
mainfrom
enforce-environment-network

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Executes the official Environment network field for hosted Sessions, within the deployment cap.

  • disabled: the sandbox reaches only Core and the Session's model provider for its whole life, packages and setup included. No Core check on packages or setup.
  • restricted: exact host names only. A domain equal to a cap domain goes to Egress.PrivateDomains; otherwise, when the cap allows the public internet, to the new Egress.Domains (public addresses only); otherwise Session creation fails with sandbox_network_outside_cap and param set to that allowed_domains entry. The same check runs again when an allocation derives its Egress.
  • Admission: disabled and restricted on a hosted Environment need the current Provider's NetworkSupport.Restrict (sandbox_network_unsupported); self_hosted keeps accepting only enabled. The blanket rejection is gone.
  • microsandbox: Domains get domain allow rules after deny private, so only public answers pass. E2B: allow_out also lists Domains (not Public denies everything else).
  • Docs (EN + zh): environments, OpenAI compatibility (leading-dot allowed_domains entries are rejected, unspecified officially), Harness capabilities row, Sandbox Provider protocol.

Existing validation already rejects wildcards, a leading dot, and disabled with allowed_domains, and accepts upper case.

Not verified live: E2B allow_out with a public domain on a real sandbox (the SDK documents hostnames; the Core host already uses one).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@blacksmith-sh

This comment has been minimized.

@SaladDay
SaladDay merged commit 9b175fb into main Oct 27, 2026
36 of 38 checks passed
@SaladDay
SaladDay deleted the enforce-environment-network branch October 27, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant