--- title: 'Setup Sandbox' sidebarTitle: 'Sandbox' description: 'Connect an isolated execution environment for code, files, and shell commands — provisioned only when the agent needs one.' boost: 3 --- The sandbox gives your agent a secure, isolated environment to run code, manipulate files, and execute shell commands — separate from the TrueForge server and your infrastructure. Skills and [Code Mode](/key-features/code-mode) require a sandbox. Configure a provider once under **Settings → Sandbox providers**, optionally define one or more [environments](#environments), then enable the sandbox on each agent that needs it. ## TrueForge's approach There are two common patterns for combining agents with sandboxes: | Pattern | Where the agent runs | Trade-off | | --- | --- | --- | | **Agent in sandbox** | Inside the sandbox image | Sandbox is provisioned even for the simplest request; secrets must live in the sandbox; updates mean rebuilding images | | **Sandbox as tool** | Outside, on the server | Sandbox is provisioned on demand when needed; secrets stay in the harness; sandbox is only for exec/files | TrueForge uses **sandbox as tool**: the agent loop and credentials stay in the harness; the sandbox only runs code, file, and shell operations. That means: - Model and MCP credentials never enter the sandbox. - Conversation state survives a sandbox crash. - A sandbox is created only when the agent actually needs one — simple Q&A and MCP calls incur no sandbox cost. ## Configuring a provider **Daytona is the only sandbox provider supported today.** Support for additional providers is planned. Open **Settings → Sandbox providers**, pick the [Daytona](https://www.daytona.io) preset from the catalog, and paste your API key. Create the Daytona API key with the **`write:sandboxes`**, **`write:snapshots`**, and **`manage:secrets`** scopes. TrueForge builds and clones snapshots for [environments](#environments) and syncs [secrets](#secrets) to Daytona, so saving the provider fails if any of these scopes are missing, even when the key is otherwise valid.