Skip to main content

Agent Daytona Sandboxes

The agent runner can create Daytona sandboxes for agent runs. Configure Daytona on the runner service, not on every Agenta container.

Configure the runner

SANDBOX_AGENT_PROVIDER=daytona
DAYTONA_API_KEY=<daytona-api-key>
DAYTONA_API_URL=https://app.daytona.io/api
DAYTONA_TARGET=eu

For Helm:

agentRunner:
provider: daytona
daytona:
apiKey: <daytona-api-key>
apiUrl: https://app.daytona.io/api
target: eu

Optional snapshot

Daytona runs start faster from a prepared snapshot. Agenta ships the recipe, not a prebuilt snapshot:

cd services/runner/sandbox-images/daytona
uv run build_snapshot.py --force

Then configure the snapshot name:

DAYTONA_SNAPSHOT=agenta-sandbox-pi
AGENTA_AGENT_SANDBOX_PI_INSTALLED=false

For Helm:

agentRunner:
daytona:
snapshot: agenta-sandbox-pi
installPi: false

Sandbox lifecycle

Idle Daytona sandboxes move through four states so a resumed session restarts fast while an abandoned one is reaped. Each threshold is idle minutes, measured from the sandbox's last activity and reset on every turn:

  • Stopped (warm) after DAYTONA_AUTOSTOP minutes (default 5). Disk is preserved, restart is fast, and there's no compute billing while stopped.
  • Archived (cold) after DAYTONA_AUTOARCHIVE minutes (default 15). The sandbox moves to cold storage and restores more slowly.
  • Deleted (dead) after DAYTONA_AUTODELETE minutes (default 30). The sandbox is removed. The next turn respawns it and reloads the working directory from durable storage.

Idle sandboxes bill at the stopped or archived rate, not the running rate.

DAYTONA_AUTOSTOP=5
DAYTONA_AUTOARCHIVE=15
DAYTONA_AUTODELETE=30

For Helm:

agentRunner:
daytona:
autostopDelay: 5
autoarchiveDelay: 15
autodeleteDelay: 30

Store endpoint for remote sandboxes

Daytona sandboxes run in the cloud and mount durable storage over the public internet. The store endpoint must be publicly reachable. If you run compose locally, enable the remote compose profile (ngrok tunnel). On Railway and Kubernetes the store endpoint is already public.

See the Store configuration reference.