# Omnigent on Daytona [Daytona](https://www.daytona.io) sandboxes give you disposable cloud machines for running Omnigent hosts, two ways: - **CLI-launched**: `omnigent sandbox create` / `connect` provisions a sandbox from your terminal, ships your local checkout into it, and registers it as a host with your server. - **Server-managed**: the server provisions a sandbox automatically when a session is created with `"host_type": "managed"` and terminates it when the session is deleted. Sandboxes boot from the official prebaked host image, so startup is seconds once Daytona has cached the image as an internal snapshot — the very first launch from a given image takes a few minutes while Daytona pulls and snapshots it. > This directory also contains the source of the **free-tier egress > relay** (`wrangler.toml`, `src/index.js`) — a Cloudflare Worker that > lets Daytona Tier 1/2 sandboxes reach your server through Daytona's > egress firewall. See > [Free-tier relay setup](#free-tier-relay-setup-tier-12). It is NOT > a server deploy target. ## Prerequisites ```bash pip install 'omnigent[daytona]' # installs the daytona SDK extra ``` > [!IMPORTANT] > **Egress on Daytona is allowlisted, which shapes how you run hosts > (CLI-launched and managed alike).** Daytona > [Tier 1/2 organizations](https://www.daytona.io/docs/en/limits/) > permit outbound traffic only to a > [fixed allowlist](https://www.daytona.io/docs/en/network-limits) of > public domains (git hosts, package managers, the major AI provider > APIs) that org admins **cannot modify**. Two consequences: > > 1. The in-sandbox host's dial-back to your Omnigent `server_url` is > blocked unless that URL is on the allowlist — otherwise the > launch times out with "managed host did not come online". > 2. The agent's LLM calls only work against an **allowlisted model > endpoint** (`api.openai.com`, `api.anthropic.com`, …). A private > or gateway endpoint is blocked the same way. > > **Two ways to satisfy this:** > > - **Tier 3+** (a $500 *usage top-up* — prepaid sandbox credit, not a > fee) lifts the egress restriction entirely: point `server_url` at > your real server and use any model endpoint, no relay. Best for > teams already on Daytona; cleanest security posture (end-to-end > TLS, no middlebox). > - **Free tier (Tier 1/2) via an allowlisted relay** — `*.workers.dev` > passes the firewall, so a tiny Cloudflare Worker that reverse- > proxies to your server lets the dial-back through; route any > non-allowlisted model endpoint through a second Worker the same > way. **Verified working end-to-end on Tier 1.** This inserts a > TLS-terminating middlebox, so read > [Security considerations](#security-considerations) first. See > [Free-tier relay setup](#free-tier-relay-setup-tier-12) below. > > If you're evaluating cloud sandboxes from scratch and don't want to > run a relay, [Modal](../modal/README.md#sandboxes-for-runner-hosts) > has full egress on its entry tier. Create an API key in the [Daytona dashboard](https://app.daytona.io) (Dashboard → Keys) and make it available where the launcher runs — your shell for the CLI flow, the **server** process for managed sandboxes: ```bash export DAYTONA_API_KEY=dtn_… # Optional: a non-default API endpoint or target region # export DAYTONA_API_URL=https://app.daytona.io/api # export DAYTONA_TARGET=us ``` ## CLI-launched sandboxes Provision a sandbox and ship your local checkout into it: ```bash omnigent sandbox create --provider daytona ``` This pulls the host image, builds wheels from your local checkout, and overlays them on top — so the sandbox runs *your* code, not whatever the image was built from. Then register it as a host with your server: ```bash omnigent sandbox connect --provider daytona \ --sandbox-id \ --server https://your-host ``` `connect` runs `omnigent host` inside the sandbox (over a PTY session) and holds the connection open in your terminal — Ctrl-C tears it down. New sessions targeting that host now run in the sandbox. Running multiple sandboxes against one server? Pass a unique `--host-name