Skip to content

feat(sdk): support TLS on the BYOP egress proxy connection - #1958

Merged
mishushakov merged 4 commits into
mainfrom
devin/1791388625-egress-proxy-tls
Oct 20, 2026
Merged

mishushakov merged 4 commits into
mainfrom
devin/1791388625-egress-proxy-tls

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The API accepts an optional tls object on network.egressProxy (e2b-dev/belt#3753, #3816; documented in e2b-dev/docs#508). Both SDKs rebuild the proxy body from known fields, so tls was silently dropped. Worse, an SDK updateNetwork on a TLS sandbox turned TLS off. This PR adds it to the SDKs.

  • SDK shape: SandboxEgressProxyOpts.tls?: boolean | SandboxEgressProxyTLSOpts, with SandboxEgressProxyTLSOpts = { serverName?; caCert? } (Python {server_name?, ca_cert?}). An object turns TLS on, so enabled isn't part of the SDK surface. This applies to create and update.

  • Wire mapping:

    • true → {enabled: true}, which means the system trust store, with the SNI taken from the address host.
    • An object → {enabled: true, ...fields}.
    • false/null → tls is omitted, which the server treats the same as {enabled: false}.
  • Validation: InvalidArgumentError/InvalidArgumentException is thrown when tls is neither a bool nor an object, or when the object contains an enabled key. The second case guards REST-shaped {enabled: false} from silently turning TLS on. Lengths and PEM validity are still checked server-side.

  • Info: SandboxEgressProxyInfo.tls?: SandboxEgressProxyTLSInfo ({ serverName? }) is set only when the API reports TLS enabled. caCert is never returned by the API, so it's never mapped.

  • Naming: TLS is uppercase in the type names on purpose. SDK-387 tracks updating TASTE.md T-12 to match.

  • Spec pin: spec/runtime-ref is bumped to e2b-dev/runtime 9cc9ca75, which adds SandboxEgressProxyTLSConfig. Relative to main, the pin also brings a few unrelated spec changes into the generated clients:

    • in the API spec, the filesHash pattern;
    • in the envd spec, cpuCount on init and the CPU metrics fields cpu_possible, cpu_target, cpu_target_attempts and cpu_write_pending_ms.

    None of them are exposed in or used by the SDK API.

// public CA
await Sandbox.create({
  network: { egressProxy: { address: 'proxy.example.com:1080', username: 'u', password: 'p', tls: true } },
})

// private CA / custom name
await sbx.updateNetwork({
  egressProxy: {
    address: 'proxy.example.com:1080',
    tls: { serverName: 'proxy.internal.example.com', caCert: pem },
  },
})

const info = await sbx.getInfo()
info.network?.egressProxy?.tls // { serverName: 'proxy.internal.example.com' }
Sandbox.create(
    network={
        "egress_proxy": {
            "address": "proxy.example.com:1080",
            "tls": {"server_name": "proxy.internal.example.com", "ca_cert": pem},
        }
    }
)

Covered by mocked-API unit tests in egressProxy.test.ts / test_egress_proxy.py. Not verified live, because the test team gets 403: Egress proxy (network.egressProxy) is not enabled for this team.

Link to Devin session: https://app.devin.ai/sessions/43e708f1a1764a1d8b65c0163545efec
Open in Devin Desktop: https://app.devin.ai/desktop/session/43e708f1a1764a1d8b65c0163545efec?variant=devin
Requested by: @mishushakov

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c16cb96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
e2b Minor
@e2b/python-sdk Minor
@e2b/code-interpreter-python Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from f1216f4. Download artifacts from this workflow run.

JS SDK (e2b@2.56.1-devin-1791388625-egress-proxy-tls.0, with @e2b/dockerfile-utils@0.1.2-devin-1791388625-egress-proxy-tls.0):

npm install ./e2b-dockerfile-utils-0.1.2-devin-1791388625-egress-proxy-tls.0.tgz ./e2b-2.56.1-devin-1791388625-egress-proxy-tls.0.tgz

CLI (@e2b/cli@2.22.1-devin-1791388625-egress-proxy-tls.0):

npm install ./e2b-cli-2.22.1-devin-1791388625-egress-proxy-tls.0.tgz

Code Interpreter JS SDK (@e2b/code-interpreter@2.9.1-devin-1791388625-egress-proxy-tls.0):

npm install ./e2b-code-interpreter-2.9.1-devin-1791388625-egress-proxy-tls.0.tgz

Desktop JS SDK (@e2b/desktop@2.5.1-devin-1791388625-egress-proxy-tls.0):

npm install ./e2b-desktop-2.5.1-devin-1791388625-egress-proxy-tls.0.tgz

Python SDK (e2b==2.56.0+devin.1791388625.egress.proxy.tls, with e2b-dockerfile-utils==0.1.1+devin.1791388625.egress.proxy.tls):

pip install ./e2b_dockerfile_utils-0.1.1+devin.1791388625.egress.proxy.tls-py3-none-any.whl ./e2b-2.56.0+devin.1791388625.egress.proxy.tls-py3-none-any.whl

Code Interpreter Python SDK (e2b-code-interpreter==2.11.0+devin.1791388625.egress.proxy.tls):

pip install ./e2b_code_interpreter-2.11.0+devin.1791388625.egress.proxy.tls-py3-none-any.whl

Desktop Python SDK (e2b-desktop==2.7.0+devin.1791388625.egress.proxy.tls):

pip install ./e2b_desktop-2.7.0+devin.1791388625.egress.proxy.tls-py3-none-any.whl

devin-ai-integration[bot]

This comment was marked as resolved.

@mishushakov

Copy link
Copy Markdown
Member

on the above - TLS should be uppercase (please add Linear task to use abbreviations in their intended casing)

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@mishushakov Keeping SandboxEgressProxyTLSOpts / SandboxEgressProxyTLSInfo as they are. I opened SDK-387 to change TASTE.md T-12 so abbreviations keep their intended casing. I'm also adding the T-69 field docstrings on the ...TLSInfo types.

@mishushakov
mishushakov marked this pull request as ready for review October 7, 2026 16:16
@mishushakov
mishushakov self-requested a review as a code owner October 7, 2026 16:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T16:19:38.018866Z 85d033a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

devin-ai-integration[bot]

This comment was marked as resolved.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Straightforward, well-contained feature addition that passes a new tls option through to the existing SOCKS5 egress proxy config, with matching implementations in both SDKs, generated types kept in sync with the pinned spec bump, and new unit tests on both sides.

What was reviewed: the JS (sandboxApi.ts) and Python (sandbox_api.py) request/response builders for the egress proxy, confirming tls is validated (object with boolean enabled) and round-tripped consistently with the existing address/username/password pattern; the spec/runtime-ref pin bump matches the claimed upstream commit; the changeset covers both packages; and the prior inline review comments (missing doc comments on SandboxEgressProxyTLSInfo.enabled/serverName) were actually fixed in the follow-up commit, not just self-resolved.

Extended reasoning...

Change adds a tls sub-option (enabled/serverName/caCert) to the BYOP SOCKS5 egress proxy feature, touching the OpenAPI/envd specs (via a pinned runtime-ref bump, not hand-edited), generated schema/client code, and the JS and Python SDK request/response builders plus new tests; no injection, auth, or crypto logic lives in the SDK itself (TLS verification happens server-side), so the security-sensitive surface is minimal. The two rounds of inline review comments asking for missing doc comments were genuinely addressed in a follow-up commit, and the JS/Python implementations are symmetric, so this is a low-risk, mechanical-pattern change suitable for approval.
approve

@mishushakov
mishushakov enabled auto-merge (squash) October 19, 2026 18:52
devin-ai-integration Bot and others added 3 commits October 19, 2026 18:55
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1791388625-egress-proxy-tls branch from 85d033a to 09ea97f Compare October 19, 2026 18:59
@mishushakov
mishushakov disabled auto-merge October 19, 2026 19:11
@mishushakov
mishushakov merged commit a1ad326 into main Oct 20, 2026
44 of 48 checks passed
@mishushakov
mishushakov deleted the devin/1791388625-egress-proxy-tls branch October 20, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants