> ## Documentation Index
> Fetch the complete documentation index at: https://traceroot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up traceroot in a repository, follow the setup prompt in https://traceroot.ai/docs/getting-started/coding-agents.md.

# Daytona

> Run the traceroot Agent's sandbox on Daytona, with nothing to host yourself

Run the traceroot Agent's sandbox on [Daytona](https://www.daytona.io), a hosted sandbox service. The agent clones your repository into the sandbox, reads the code behind a failing span and runs commands there. With `SANDBOX_PROVIDER=daytona`, each session's sandbox is created in your Daytona account, and the machine that runs traceroot needs no Docker access for it.

> [!NOTE]
>
> This page is for a self-hosted traceroot run from its repository. `docker` stays the default sandbox provider, and nothing changes until you set `SANDBOX_PROVIDER`. See [Self-Hosting](https://traceroot.ai/docs/developer/self-hosting.md) to get traceroot running first.

## Requirements

* traceroot run from its repository with `make dev` or the Docker Compose stack (`make prod`), and a model provider key for the agent.
* A Daytona account and an API key. Daytona's [API keys](https://www.daytona.io/docs/en/api-keys/) page covers creating one.
* Outbound HTTPS from the agent to `app.daytona.io`.

## Set up

Add both settings to `.env` at the root of the repository:

```bash theme={null}
SANDBOX_PROVIDER=daytona
DAYTONA_API_KEY=your-api-key
```

The same two lines work under `make dev` and in the Docker Compose stack. The agent reads them when it starts. Start traceroot, or restart it if it is already running.

## Verify

1. **In the traceroot UI**: open the agent and ask it to run `cat /etc/os-release` in its sandbox. The answer names Ubuntu 24.04.
2. **In the Daytona dashboard**: a sandbox with the label `traceroot.session` appears while the session is active.
3. **In the agent's log**: once the sandbox is set up, the log prints `[DaytonaExecutor] Sandbox ready, workDir: /workspace`. With Docker Compose, read it with:

   ```bash theme={null}
   docker compose -f docker-compose.prod.yml logs -f agent
   ```

## What the agent sets up

The agent creates the sandbox the first time a session needs it.

| Setting | Value |
| - | - |
| Base image | `ubuntu:24.04` |
| Tools installed | Git, jq, curl and CA certificates, on a best-effort basis: a failed install is not reported |
| Workspace | `/workspace`, with `repos`, `traces` and `notes` folders |
| Region | Daytona's `us` target |
| Idle stop | After 15 minutes with no call from the agent, even if a process is still running in the sandbox |
| Lifetime | Ephemeral, so Daytona deletes the sandbox once it stops |

Repository credentials reach `git` through environment variables and never appear in a command line. The agent deletes the sandbox when the session's sandbox is torn down or the agent shuts down.

## Limitations

* The agent connects to Daytona's hosted service at `app.daytona.io` in the `us` target. A self-managed Daytona or another region cannot be set from `.env`.
* A sandbox that stops after 15 idle minutes is deleted, along with the repository clone and notes in it.
* `SANDBOX_IDLE_TTL_MINUTES` and `SANDBOX_RECLAIM_ON_START` apply to the `docker` provider. Daytona stops and deletes its own sandboxes.
* If Daytona takes longer than 60 seconds to create a sandbox, the session's sandbox call fails.

## Next steps

> [card] [Root cause analysis](https://traceroot.ai/docs/ai-agent/root-cause-analysis.md)
>
> What the agent does in its sandbox when a trace has errors.

> [card] [GitHub integration](https://traceroot.ai/docs/ai-agent/github-integration.md)
>
> Connect a repository so the agent can clone it into the sandbox.

> [card] [Self-Hosting](https://traceroot.ai/docs/developer/self-hosting.md)
>
> Run traceroot from its repository.

> [card] [Daytona sandboxes](https://www.daytona.io/docs/en/sandboxes/)
>
> Daytona's docs on how its sandboxes work.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.