LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithsandbox_clientSandboxClientcreate_sandbox
Method●Since v0.6

create_sandbox

Copy
create_sandbox(
  self,
  snapshot_id: Optional[str] = None,
  *,
  snapshot_name:
View source on GitHub
Optional
[
str
]
=
None
,
name
:
Optional
[
str
]
=
None
,
timeout
:
int
=
30
,
wait_for_ready
:
bool
=
True
,
idle_ttl_seconds
:
Optional
[
int
]
=
None
,
delete_after_stop_seconds
:
Optional
[
int
]
=
None
,
vcpus
:
Optional
[
int
]
=
None
,
mem_bytes
:
Optional
[
int
]
=
None
,
fs_capacity_bytes
:
Optional
[
int
]
=
None
,
mount_config
:
Optional
[
SandboxMountConfig
]
=
None
,
proxy_config
:
Optional
[
SandboxProxyConfig
]
=
None
,
headers
:
RequestHeaders
=
None
)
->
Sandbox

Parameters

NameTypeDescription
snapshot_idOptional[str]
Default:None

Optional snapshot ID to boot from. Mutually exclusive with snapshot_name.

snapshot_nameOptional[str]
Default:None

Snapshot name to boot from. Resolved server-side to a snapshot owned by the caller's tenant. Mutually exclusive with snapshot_id.

nameOptional[str]
Default:None
timeoutint
Default:30
wait_for_readybool
Default:True
idle_ttl_secondsOptional[int]
Default:None
delete_after_stop_secondsOptional[int]
Default:None
vcpusOptional[int]
Default:None
mem_bytesOptional[int]
Default:None
fs_capacity_bytesOptional[int]
Default:None
mount_configOptional[SandboxMountConfig]
Default:None
proxy_configOptional[SandboxProxyConfig]
Default:None

Create a new Sandbox.

The sandbox is NOT automatically deleted. Use delete_sandbox() for cleanup, or use sandbox() for automatic cleanup with a context manager.

Optional sandbox name (auto-generated if not provided).

Timeout in seconds when waiting for ready (only used when wait_for_ready=True).

If True (default), block until sandbox is ready. If False, return immediately with status "provisioning". Use get_sandbox_status() or wait_for_sandbox() to poll for readiness.

Idle timeout in seconds. The launcher automatically stops the sandbox after this duration of inactivity. Must be a multiple of 60. 0 explicitly disables the idle stop. When omitted (None), the server applies a default of 600 seconds (10 minutes).

Seconds after the sandbox enters the stopped state before it (and its filesystem clone) are permanently deleted. Must be a multiple of 60. 0 disables stop-anchored deletion (manual cleanup required). When omitted (None), the server applies its configured default.

Number of vCPUs.

Memory in bytes.

Root filesystem capacity in bytes.

Mount configuration forwarded to the server as mount_config. The backend expands mount auth into runtime proxy rules. Explicit AWS/GCP proxy rules in proxy_config conflict with mount auth for the same provider.

Per-sandbox proxy configuration forwarded to the server as-is. Shape matches the backend proxy_config field: {"rules": [...], "no_proxy": [...], "access_control": {"allow_list": [...]}} or {"access_control": {"deny_list": [...]}}. Use access_control.allow_list to restrict outbound HTTPS to a set of host patterns (exact domains, globs like *.example.com, IPs, CIDRs, or ~regex). Use proxy_config with provider rule helpers such as aws_auth to let the proxy sign supported AWS HTTPS requests on the sandbox's behalf.