Installation
Set your API key
SandboxClient() reads this key from the environment, so no further configuration is required.
Create a sandbox backend
Create a LangSmith sandbox withSandboxClient, then wrap it in LangSmithSandbox to run it as a Deep Agents backend.
Use with Deep Agents
Pass the backend to create_deep_agent along with a chat model such as ChatAnthropic, then invoke the agent. Thetry/finally block deletes the sandbox when the try block finishes or an error occurs.
Clean up
Delete sandboxes when you are done, since they consume resources until deleted.- Sandboxes in Deep Agents: lifecycle, scoping, and a comparison of sandbox providers.
- LangSmith Sandboxes: snapshots, service URLs, the auth proxy, and the SDK reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

