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

DAYTONA_SNAPSHOT is shared with the custom-code evaluators; the recipe bakes python3 and ts-node so one snapshot serves both. Use the DAYTONA_SNAPSHOT_AGENT / DAYTONA_SNAPSHOT_CODE overrides when they must diverge.

For Helm:

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

Sandbox lifecycle

Daytona sandboxes move through three states:

  • Running while a turn executes and during the live warm window after a clean turn.
  • Stopped warm after DAYTONA_AUTOSTOP idle minutes (default 15). Daytona preserves the disk and does not bill compute. Restart is cheap, and the harness session reloads natively on the same instance.
  • Deleted after DAYTONA_AUTODELETE idle minutes (default 30). The sandbox is removed. The next turn creates a fresh sandbox and reloads the working directory from durable storage.

Archived no longer exists in this ladder. Restoring an archived sandbox was slower than creating a fresh one, so the runner no longer sets an archive interval.

DAYTONA_AUTOSTOP=15
DAYTONA_AUTODELETE=30

For Helm:

agentRunner:
daytona:
autostopDelay: 15
autodeleteDelay: 30

Warm sessions between turns

AGENTA_RUNNER_DAYTONA_SESSION_IDLE_TTL_MS controls how long a Daytona sandbox stays running with its live session after a clean turn. The default is 120000 milliseconds (two minutes). Set it to 0 to stop sandboxes after each turn. There is no separate enabled flag.

AGENTA_RUNNER_DAYTONA_SESSION_MAX_WARM limits how many idle sandboxes may stay running between turns. The default is 20. This cap bounds idle spend only. It never blocks active turns. Overflow sandboxes park in the stopped state.

A running idle sandbox bills compute for at most the configured window. A stopped sandbox bills only for disk.

For Helm, set agentRunner.daytona.sessionIdleTtlMs and agentRunner.daytona.sessionMaxWarm.

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 with-tunnel compose profile (ngrok tunnel). On Railway and Kubernetes the store endpoint is already public.

See the Store configuration reference.