Skip to main content
Agents often want to write or execute code when doing their job. A sandbox gives a Managed Deep Agent an isolated filesystem and shell for working with files, running code, and executing commands.
Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.

Project structure

Keep the agent entry point at the project root and the sandbox declaration under sandbox/:

Configure a sandbox

mda init scaffolds a sandbox declaration. Managed Deep Agents enables the sandbox only while the sandbox/ directory is present. Delete the directory to opt out, such as for an agent that only needs its prompt, memory, and tools. Managed Deep Agents currently supports LangSmith sandboxes:
sandbox/index.ts
LangSmith uses its default sandbox template unless you set a custom template or snapshot. Set only one creation source. Use templateName or snapshotId to set the creation source.

Choose a scope

An agent-scoped sandbox lets threads read and modify the same files. Use it only for intentionally shared state.
Use idleTtlSeconds to control when an idle sandbox can be reclaimed. Use defaultTimeout to bound each command.

How the agent use the sandbox

The agent uses filesystem tools such as ls, read_file, write_file, edit_file, glob, and grep, and runs shell commands with execute. Use instructions.md to specify where the agent should work and what it must not modify.

Sandbox lifecycle

Managed Deep Agents owns sandbox naming, reuse, recovery, and cleanup. Deleting the deployment with mda delete also deletes the managed sandboxes associated with it. For platform-level lifecycle details, see Sandboxes.