Reference
Run sandboxes on Daytona
Run review sandboxes on your own Daytona account instead of Cloudflare Containers, in hybrid or full mode.
Reference
Run review sandboxes on your own Daytona account instead of Cloudflare Containers, in hybrid or full mode.
By default each review runs in a Cloudflare container. You can run sandboxes on Daytona instead, with your own Daytona API key. The Workers, D1, R2 and the workflow stay on Cloudflare either way.
The choice is per deployment:
SANDBOX_PROVIDER | DAYTONA_API_KEY | Sandboxes run on |
|---|---|---|
| empty (default) | not set | Cloudflare |
| empty (default) | set | Daytona |
cloudflare | any | Cloudflare |
daytona | set | Daytona |
This page is about the deployment's own Daytona key. On a deployment with a review limit, users can also save their own key, which runs just their reviews on Daytona: see Your users' own Daytona keys.
Daytona has two modes, set with DAYTONA_MODE.
| Mode | Daytona tier | Checkout and scanners | AI review |
|---|---|---|---|
hybrid (default) | Any | Daytona | Cloudflare container, behind Outbound |
full | Tier 3 or 4 | Daytona | Daytona |
Hybrid works on every Daytona tier. Checkout and scanners do not run the repository's code and never hold a secret, so they can run under Daytona's default network rules. The AI review moves to a Cloudflare container only for its own step, with the same locked-down egress as a Cloudflare-only deployment. A repository with AI reviewer set to None never starts a Cloudflare container.
Full runs the whole review on Daytona. It needs a Tier 3 or 4 organization, because only those tiers can change a sandbox's network allowlist while it runs. On Tier 1 and 2, every sandbox can reach a fixed list of services that includes GitHub and other hosts, so a prompt-injected agent could send code out. Full mode would not be safe there.
Create an API key in the Daytona dashboard under API Keys. Hybrid needs the sandbox permissions. Full mode also needs manage:secrets.
Build and push the snapshot. Sandboxes start from a snapshot of engine/container/Dockerfile, the same image Cloudflare runs. With Docker running and the Daytona CLI signed in (daytona login):
engine/scripts/daytona-snapshot.shIt prints the snapshot name, for example openvscan-sandbox-202611271200. Each sandbox gets 2 vCPU, 4 GB of memory and 10 GB of disk. Override them with DAYTONA_CPU, DAYTONA_MEMORY and DAYTONA_DISK.
Configure the engine. In engine/wrangler.jsonc, set DAYTONA_SNAPSHOT to the snapshot name. Set DAYTONA_MODE to full for full mode. Then add the key:
cd engine
npx wrangler secret put DAYTONA_API_KEYDeploy with pnpm run deploy, and open a pull request to check that a review runs.
Rebuild the snapshot whenever you change the Dockerfile or upgrade OpenVScan, and update DAYTONA_SNAPSHOT. Hybrid deployments still deploy the Cloudflare container for the AI step, so Docker is still needed to deploy.
openvscan-<review id>, created as root from the snapshot. The engine deletes it when the review ends, fails or is cancelled. As a backstop, Daytona stops it after 30 idle minutes, deletes it when it stops, and deletes it 3 hours after creation in any case.codeload.github.com URL. For a private repository the URL holds a token that works only for that archive and expires within minutes. No GitHub token enters the sandbox, and the checkout has no .git directory.api.osv.dev isn't on it; the run log says so and the other scanners still run.In full mode the agent's credential is a Daytona secret. The sandbox holds only Daytona's placeholder, and Daytona's egress proxy swaps in the real value on requests to the model API's hosts and nowhere else. The secret is created when the AI review starts and deleted as soon as it stops.
| Credential | Secret sent to, and the only hosts reachable |
|---|---|
| Claude | api.anthropic.com |
| OpenAI API key | api.openai.com |
| ChatGPT login | chatgpt.com |
| Codex access token | chatgpt.com, auth.openai.com |
| Cursor | *.cursor.sh |
Compared with Outbound on Cloudflare:
Outbound allows only the Codex endpoints on chatgpt.com and refuses Cursor's sign-in endpoints. On Daytona the agent can reach any path on those hosts with your credential, but it still cannot reach any other host.sk-ant-api, or a token's header and claims without its signature. Neither works on its own.When FREE_REVIEWS_PER_WEEK is set, Settings → Review limit lets each user save a Daytona API key. Reviews of the repositories they connected then run in hybrid mode on their key, whatever the deployment's own provider: checkout and scanners in their Daytona organization, the AI step in the deployment's Cloudflare container. They don't count toward the limit.
The key needs the write:snapshots, write:sandboxes and delete:sandboxes permissions. When it is saved, the engine creates a snapshot named openvscan-sandbox-<tag> in the user's organization from the public image in USER_SANDBOX_IMAGE. That takes a few minutes; a review that starts before it is ready waits for it, up to 20 minutes. A new image tag gets a new snapshot, so an engine upgrade rebuilds it on the next review.
The image is built and pushed to GitHub Container Registry by .github/workflows/sandbox-image.yml whenever engine/container/ changes, tagged with the first 12 characters of git rev-parse HEAD:engine/container. pnpm run deploy in engine/ (scripts/deploy.sh) sets USER_SANDBOX_IMAGE to the same tag, so build the image before you deploy a container change. After the first push, make the openvscan-sandbox package public in GitHub's package settings, or Daytona can't pull it. Set SANDBOX_IMAGE_REPO to deploy with an image from another registry.
If Daytona refuses the key, it isn't saved. If the snapshot fails, the user sees the reason and a Try again button, and their reviews use the hosted sandboxes until it works. On Daytona's Tier 1 and 2 the network allowlist leaves out api.osv.dev, so OSV-Scanner reports an error in these reviews.
Daytona bills each sandbox per second of vCPU, memory and disk. A review that scans for five minutes on the default size costs about one or two US cents of Daytona usage. In hybrid mode, Cloudflare bills only the AI step's container time. Check Daytona's pricing page for current rates.
With DEV_ROUTES=true and DAYTONA_API_KEY in engine/.dev.vars, run the scanners on Daytona against a public repository:
curl -X POST localhost:8787/__dev/daytona -d '{"repo":"octocat/Hello-World"}'The sandbox is deleted afterwards unless you pass "keep":"true".