# Sandboxes

URL: https://docs.domainruntime.dev/docs/environments/sandboxes
Status: Planned
Reviewed: 2026-09-22



<div className="docs-note">
  **Planned.**

   Sandboxes run on our infrastructure today for internal tests (measured on 2026-09-19: ready in 22–33 s, about USD 0.10 per sandbox-hour). Self-service access comes with the platform SDK. Today's SDK exposes them as 

  `up`

  , 

  `pull`

  , 

  `run`

  , 

  `status`

   and 

  `down`

  ; the shape below is the one we are converging on.
</div>

A sandbox runs the whole stack for one environment on its own isolated machine: the runtime, your action code and dataset processing, talking over localhost. It is bound to an existing development environment and uses that environment's data; its files go to the same storage as every environment.

Use one to give an agent a place to run your domain, to preview a branch, or to run end-to-end tests against a dedicated test environment.

## From code [#from-code]

```ts
import { init } from "@domainruntime/platform";
import domain from "../src/domain";

const platform = init({ serviceKey: process.env.DOMAIN_SERVICE_KEY! });

const sandbox = await platform.sandboxes.create({ env: "dev-orders-e2e-4k2m9x1p" });
try {
  await sandbox.pushDomain(domain);
  const { orderId } = await sandbox.actions.run("orders.place", { orderId: crypto.randomUUID(), total: 10 });
  const { data } = await sandbox.query({ orders_order: { $: { where: { id: orderId } } } });
  expect(data.orders_order).toHaveLength(1);
} finally {
  await sandbox.destroy();
}
```

## From the CLI [#from-the-cli]

```bash
druntime sandbox up
druntime sandbox pull dev-orders-e2e-4k2m9x1p --domain=src/domain.ts
druntime sandbox run orders.place --input='{"orderId":"…","total":10}'
druntime sandbox down
```

## Limits [#limits]

|                                       |                                                      |
| ------------------------------------- | ---------------------------------------------------- |
| Concurrent sandboxes per organization | set by your plan                                     |
| Maximum lifetime                      | 7.9 hours                                            |
| Network                               | outbound internet is available from your action code |
| Workflows                             | not available inside a sandbox yet                   |
