Add `E2BSandbox(network=)`, passing E2B's network options through to a new sandbox

Merged
AD
18d ago
+109-5

Stack: #13587 E2B network → #13589 boxd secrets → #13590 Daytona secrets → #13591 OpenSandbox network_policy/credential_proxy → #13592 clai2 /sandbox. Each harness PR stands alone; clai2 uses the first two.

Why we make these changes

Part of #13593. An agent in a cloud sandbox needs credentials (a GitHub token for git push and gh) that its commands can use but not read, so a prompt injection cannot copy them out. E2B's network rules have its proxy, outside the sandbox, set request headers per host. This PR passes that option through unchanged, under the SDK's own name, so users write what the provider documents.

New public surface

  • E2BSandbox(network=) and E2BSandboxBackend(network=): e2b.SandboxNetworkOpts, passed to Sandbox.create.

User-visible behavior

Before: no way to give the sandbox's commands a credential they cannot read. After: the new docs section "Give commands a credential they cannot read" shows it for a GitHub token. Without the option, sandbox creation is unchanged.

Verification

  • tests/harness/e2b_sandbox/test_backend.py::test_network_options_pass_through
  • Live on E2B with dummy values, on this branch: a rule replaced the Authorization header the sandbox sent, still applied after a reattach, and did not apply over plain HTTP. E2B 2.48.0 (the floor) already has network.rules, transform and Secret.fill.
  • Live on E2B with a real GitHub token, on this branch (d5294bb2b), running the docs example as written through E2BSandbox: echo $GH_TOKEN printed placeholder; git clone and git push over https://github.com worked; gh api user returned the token's owner; gh pr create opened a PR; gh release create uploaded an asset through uploads.github.com; no token was found in the sandbox's environment or files.

What changes for existing users

Nothing.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.