Skip to main content
Deep Agents Code uses the sandbox as tool pattern: the dcode process (LLM loop, memory, tool dispatch) runs on your machine, but agent tool calls (read_file, write_file, execute, etc.) target the remote sandbox, not your local filesystem. To get files into the sandbox, use a setup script or the provider’s file transfer APIs (see Working with files). For a deeper look at sandbox architecture, integration patterns, and security best practices, see Sandboxes.

Install provider dependency

Included by default when installing deepagents-code. No extra installation needed.

Set provider credentials

Run Deep Agents Code with a sandbox

Sandbox flags and examples

Examples:

Setup scripts

Use --sandbox-setup to run a shell script inside the sandbox after creation. This is useful for cloning repos, installing dependencies, and configuring environment variables.
setup.sh
Deep Agents Code expands ${VAR} references in setup scripts using your local environment variables. Store secrets in a local .env file for the setup script to access.
Sandboxes isolate code execution, but agents remain vulnerable to prompt injection with untrusted inputs. Use human-in-the-loop approval, short-lived secrets, and trusted setup scripts only. See Security considerations for details.