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_clientSandboxClientupdate_sandbox
Method●Since v0.6

update_sandbox

Copy
update_sandbox(
  self,
  name: str,
  *,
  new_name: Optional[str] =
View source on GitHub
None
,
idle_ttl_seconds
:
Optional
[
int
]
=
None
,
delete_after_stop_seconds
:
Optional
[
int
]
=
None
,
proxy_config
:
Optional
[
SandboxProxyConfig
]
=
None
,
run_config
:
Optional
[
Union
[
RunConfig
,
dict
[
str
,
Any
]
]
]
=
None
,
headers
:
RequestHeaders
=
None
)
->
Sandbox

Parameters

NameTypeDescription
name*str

Current sandbox name.

new_nameOptional[str]
Default:None

New display name.

idle_ttl_secondsOptional[int]
Default:None
delete_after_stop_secondsOptional[int]
Default:None
proxy_configOptional[SandboxProxyConfig]
Default:None
run_configOptional[Union[RunConfig, dict[str, Any]]]
Default:None

Update a sandbox's properties.

Idle timeout in seconds. Must be a multiple of 60. 0 disables idle-stop. None leaves the existing value unchanged.

Seconds after entering stopped before deletion. Must be a multiple of 60. 0 disables stop-anchored deletion. None leaves the existing value unchanged.

Replacement proxy configuration, forwarded to the server as-is (same shape as create_sandbox). Rules replace the existing set rather than merging into it, so include every rule the sandbox should keep. Opaque header values carry over from the current config, so rotating one credential does not mean re-supplying secrets that can no longer be read. The sandbox must be ready; start a stopped one first.

Merge into the sandbox's stored run configuration: user and work_dir replace, env_vars merge. Takes effect for subsequent commands; commands already running are unaffected, and a stopped sandbox picks it up on its next start. Omitting it leaves the stored value untouched.