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

# Daytona

> Run captured command lines in an existing Daytona sandbox.

`DaytonaRuntime` connects to a live [Daytona](https://www.daytona.io)
sandbox by id. Create and size it with Daytona's dashboard, CLI, or SDK, then
boot it from an image or snapshot carrying Mirage and `fuse3`. Mirage only
connects and executes; it never creates, starts, stops, or deletes the sandbox.

See the [Sandbox overview](/python/runtime/sandbox) for the shared image and
how to provision the workspace at matching mount prefixes inside the sandbox.

## Install

```bash theme={null}
pip install mirage-ai[daytona]
```

## Configure

```yaml theme={null}
runtimes:
  - name: daytona
    captures: ["python3", "pip"]
    config:
      sandbox_id: ${DAYTONA_SANDBOX_ID}
      api_key: ${DAYTONA_API_KEY}
  - vfs
```

`api_key` is optional when `DAYTONA_API_KEY` is set. The runtime connects on
the first captured line and reuses that client until the workspace closes.
Closing the workspace releases the client and leaves the sandbox running.

The same configuration in application code is:

```python theme={null}
from mirage.runtime.sandbox.daytona import DaytonaRuntime

runtime = DaytonaRuntime(
    captures=["python3", "pip"],
    config={"sandbox_id": "sandbox-id"},
)
```

Sizing, GPUs, snapshots, networking, and lifecycle controls such as idle-stop
or auto-delete remain Daytona settings. The
[worked Daytona example](https://github.com/strukto-ai/mirage/tree/main/examples/python/runtimes/daytona)
covers snapshot baking, sandbox creation, in-sandbox provisioning, and a full
read/write round trip.

<Warning>
  Mirage timeouts stop waiting but Daytona defaults to no provider-side
  timeout. The remote process can keep running and billing until you stop it.
  See [Resource limits](/python/runtime/sandbox#resource-limits).
</Warning>
