Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1c4dc53
Remove SDK-side defaults from API request payloads
devin-ai-integration[bot] Aug 21, 2026
b92ce2b
Fix ruff formatting in test_api_defaults.py
devin-ai-integration[bot] Aug 21, 2026
996c679
Keep SDK-side secure=true default for sandbox creation
devin-ai-integration[bot] Aug 21, 2026
ef24b64
Remove redundant API-default doc mentions
devin-ai-integration[bot] Aug 21, 2026
b984e34
fix(sdk): match JS and Python on malformed and null egress proxy input
mishushakov Aug 19, 2026
6d991cb
Revert "fix(sdk): match JS and Python on malformed and null egress pr…
devin-ai-integration[bot] Aug 21, 2026
aa59e1f
Pin explicit 300s timeout in test sandbox fixtures
devin-ai-integration[bot] Aug 21, 2026
e4d7b95
Address review: add template build payload tests, mirror connect time…
devin-ai-integration[bot] Aug 21, 2026
a06670b
Drop SDK-side connect timeout and secure defaults
devin-ai-integration[bot] Aug 21, 2026
e9963a5
Remove client-side fork count validation per T-52
devin-ai-integration[bot] Aug 21, 2026
7f20cda
Merge origin/main into devin/1787318715-remove-sdk-defaults
devin-ai-integration[bot] Sep 9, 2026
947368f
Merge origin/main into devin/1787318715-remove-sdk-defaults
devin-ai-integration[bot] Sep 9, 2026
c5ed9b1
feat(sdk): create and connect sandboxes through the v2 API endpoints
devin-ai-integration[bot] Sep 16, 2026
9a90eef
Merge origin/main into devin/1787318715-remove-sdk-defaults
devin-ai-integration[bot] Sep 16, 2026
9055c26
Drop removed secure option from downstream packages and point client …
devin-ai-integration[bot] Sep 16, 2026
31c28c0
Update template build body tests for API-owned cpu/memory defaults
devin-ai-integration[bot] Sep 16, 2026
88e5b44
Drop removed secure option from sync secured-files tests
devin-ai-integration[bot] Sep 16, 2026
f345482
Keep deprecated secure option accepted and drop logsOffset preset
devin-ai-integration[bot] Sep 16, 2026
e875d62
Sync v2 sandbox timeout minimum from belt spec
devin-ai-integration[bot] Sep 16, 2026
973a2da
Sync v2 sandbox timeout minimum (15s) from belt spec
devin-ai-integration[bot] Sep 16, 2026
0ee39e4
Sync v2 sandbox timeout minimum (1s) from belt spec
devin-ai-integration[bot] Sep 16, 2026
e7306ec
chore(spec): bump runtime-ref to the exported v2 sandbox create/conne…
devin-ai-integration[bot] Sep 16, 2026
f611cef
Merge remote-tracking branch 'origin/main' into devin/1787318715-remo…
devin-ai-integration[bot] Sep 18, 2026
11d377d
test(js-sdk): use setupMockApi in apiDefaults test so it runs in the …
devin-ai-integration[bot] Sep 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/olive-poets-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'e2b': minor
'@e2b/python-sdk': minor
---

Remove SDK-side defaults from API request payloads so the API defaults apply when options are omitted. Sandbox create/fork/connect no longer preset a 5-minute timeout, fork no longer presets `count: 1`, create no longer presets `allow_internet_access`, pause no longer presets keeping memory, and template builds no longer preset CPU/memory. Explicitly provided values are still sent unchanged.

Sandbox create and connect now use the v2 API endpoints (`POST /v2/sandboxes`, `POST /v2/sandboxes/{id}/connect`), which default `timeout` to 5 minutes and always secure envd access. The `secure` option on `Sandbox.create` is deprecated: every sandbox is secured, so the option is still accepted but ignored.
5 changes: 5 additions & 0 deletions .changeset/quiet-desks-secure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@e2b/desktop-python': minor
---

Deprecate the `secure` option of `Sandbox.create` (still accepted, now ignored): every sandbox is created through the v2 API, which always secures envd access. `allow_internet_access` is no longer preset to `True`; when omitted, the API default applies.
6 changes: 6 additions & 0 deletions .changeset/witty-parrots-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'e2b': patch
'@e2b/python-sdk': patch
---

Remove client-side validation of the fork `count` argument. The API validates the requested fork count and rejects invalid values.
1 change: 0 additions & 1 deletion packages/code-interpreter-js/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const isIntegrationTest = process.env.E2B_INTEGRATION_TEST !== undefined

export const secureSandboxTest = sandboxTest.extend({
sandboxOpts: {
secure: true,
network: {
allowPublicTraffic: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ async def test_restart_context(async_sandbox: AsyncSandbox):

@pytest.mark.skip_debug
async def test_create_context_secure_traffic(async_sandbox_factory):
async_sandbox = await async_sandbox_factory(
secure=True, network={"allow_public_traffic": False}
)
async_sandbox = await async_sandbox_factory(network={"allow_public_traffic": False})
context = await async_sandbox.create_code_context()

contexts = await async_sandbox.list_code_contexts()
Expand All @@ -81,9 +79,7 @@ async def test_create_context_secure_traffic(async_sandbox_factory):

@pytest.mark.skip_debug
async def test_remove_context_secure_traffic(async_sandbox_factory):
async_sandbox = await async_sandbox_factory(
secure=True, network={"allow_public_traffic": False}
)
async_sandbox = await async_sandbox_factory(network={"allow_public_traffic": False})
context = await async_sandbox.create_code_context()

await async_sandbox.remove_code_context(context.id)
Expand All @@ -94,9 +90,7 @@ async def test_remove_context_secure_traffic(async_sandbox_factory):

@pytest.mark.skip_debug
async def test_list_contexts_secure_traffic(async_sandbox_factory):
async_sandbox = await async_sandbox_factory(
secure=True, network={"allow_public_traffic": False}
)
async_sandbox = await async_sandbox_factory(network={"allow_public_traffic": False})
contexts = await async_sandbox.list_code_contexts()

# default contexts should include python and javascript
Expand All @@ -107,9 +101,7 @@ async def test_list_contexts_secure_traffic(async_sandbox_factory):

@pytest.mark.skip_debug
async def test_restart_context_secure_traffic(async_sandbox_factory):
async_sandbox = await async_sandbox_factory(
secure=True, network={"allow_public_traffic": False}
)
async_sandbox = await async_sandbox_factory(network={"allow_public_traffic": False})
context = await async_sandbox.create_code_context()

# set a variable in the context
Expand Down
1 change: 0 additions & 1 deletion packages/code-interpreter-python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def template():
@pytest.fixture()
def sandbox_factory(request, template, sandbox_test_id):
def factory(*, template_name: str = template, **kwargs):
kwargs.setdefault("secure", False)
kwargs.setdefault("timeout", DEFAULT_TEST_SANDBOX_TIMEOUT)

metadata = kwargs.setdefault("metadata", dict())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_basic(sandbox: Sandbox):

@pytest.mark.skip_debug
def test_secure_access(sandbox_factory):
sandbox = sandbox_factory(secure=True, network={"allow_public_traffic": False})
sandbox = sandbox_factory(network={"allow_public_traffic": False})
# Create sandbox with public traffic disabled (secure access)
result = sandbox.run_code("x =1; x")
assert result.text == "1"
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_restart_context(sandbox: Sandbox):
# Secure traffic tests (public traffic disabled)
@pytest.mark.skip_debug
def test_create_context_secure_traffic(sandbox_factory):
sandbox = sandbox_factory(secure=True, network={"allow_public_traffic": False})
sandbox = sandbox_factory(network={"allow_public_traffic": False})
context = sandbox.create_code_context()

contexts = sandbox.list_code_contexts()
Expand All @@ -80,7 +80,7 @@ def test_create_context_secure_traffic(sandbox_factory):

@pytest.mark.skip_debug
def test_remove_context_secure_traffic(sandbox_factory):
sandbox = sandbox_factory(secure=True, network={"allow_public_traffic": False})
sandbox = sandbox_factory(network={"allow_public_traffic": False})
context = sandbox.create_code_context()

sandbox.remove_code_context(context.id)
Expand All @@ -91,7 +91,7 @@ def test_remove_context_secure_traffic(sandbox_factory):

@pytest.mark.skip_debug
def test_list_contexts_secure_traffic(sandbox_factory):
sandbox = sandbox_factory(secure=True, network={"allow_public_traffic": False})
sandbox = sandbox_factory(network={"allow_public_traffic": False})
contexts = sandbox.list_code_contexts()

# default contexts should include python and javascript
Expand All @@ -102,7 +102,7 @@ def test_list_contexts_secure_traffic(sandbox_factory):

@pytest.mark.skip_debug
def test_restart_context_secure_traffic(sandbox_factory):
sandbox = sandbox_factory(secure=True, network={"allow_public_traffic": False})
sandbox = sandbox_factory(network={"allow_public_traffic": False})
context = sandbox.create_code_context()

# set a variable in the context
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-js/tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function handler(req: IncomingMessage, res: ServerResponse) {
}

const path = req.url ?? ''
if (path.startsWith('/sandboxes')) {
if (path.startsWith('/v2/sandboxes')) {
respond(201, {
sandboxID: 'test-sandbox-id',
templateID: 'desktop',
Expand Down
9 changes: 4 additions & 5 deletions packages/desktop-python/e2b_desktop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def create(
timeout: Optional[int] = None,
metadata: Optional[Dict[str, str]] = None,
envs: Optional[Dict[str, str]] = None,
secure: bool = True,
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
allow_internet_access: bool = True,
secure: Optional[bool] = None,
allow_internet_access: Optional[bool] = None,
network: Optional[SandboxNetworkOpts] = None,
iam: Optional[SandboxIamOpts] = None,
lifecycle: Optional[SandboxLifecycle] = None,
Expand All @@ -244,8 +244,8 @@ def create(
:param timeout: Timeout for the sandbox in **seconds**, default to 300 seconds. The maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users.
:param metadata: Custom metadata for the sandbox
:param envs: Custom environment variables for the sandbox
:param secure: Envd is secured with access token and cannot be used without it
:param allow_internet_access: Allow sandbox to access the internet, defaults to `True`.
:param secure: Deprecated — every sandbox secures envd access; accepted for backward compatibility and ignored
:param allow_internet_access: Allow sandbox to access the internet

:return: A Sandbox instance for the new sandbox

Expand All @@ -263,7 +263,6 @@ def create(
timeout=timeout,
metadata=metadata,
envs=envs,
secure=secure,
allow_internet_access=allow_internet_access,
network=network,
iam=iam,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-python/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def do_POST(self):
if length:
self.rfile.read(length)

if self.path.startswith("/sandboxes"):
if self.path.startswith("/v2/sandboxes"):
self._record_and_respond(201, SANDBOX_RESPONSE)
elif self.path.startswith("/volumes"):
self._record_and_respond(
Expand Down
143 changes: 140 additions & 3 deletions packages/js-sdk/src/api/schema.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions packages/js-sdk/src/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createConnectTransport } from '@connectrpc/connect-web'
import {
ConnectionConfig,
ConnectionOpts,
DEFAULT_SANDBOX_TIMEOUT_MS,
defaultUsername,
Username,
} from '../connectionConfig'
Expand Down Expand Up @@ -75,7 +74,6 @@ export interface SandboxUrlOpts {
export class Sandbox extends SandboxApi {
protected static readonly defaultTemplate: string = 'base'
protected static readonly defaultMcpTemplate: string = 'mcp-gateway'
protected static readonly defaultSandboxTimeoutMs = DEFAULT_SANDBOX_TIMEOUT_MS
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

/**
* Module for interacting with the sandbox filesystem
Expand Down Expand Up @@ -318,7 +316,7 @@ export class Sandbox extends SandboxApi {

const sandboxInfo = await this.createSandbox(
template,
apiOpts?.timeoutMs ?? this.defaultSandboxTimeoutMs,
apiOpts?.timeoutMs,
apiOpts
)

Expand Down Expand Up @@ -434,8 +432,8 @@ export class Sandbox extends SandboxApi {

const results = await this.forkSandbox(
sandboxId,
apiOpts?.timeoutMs ?? this.defaultSandboxTimeoutMs,
apiOpts?.count ?? 1,
apiOpts?.timeoutMs,
apiOpts?.count,
apiOpts
)

Expand Down
Loading
Loading