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

# Using Novita Sandbox with Omnara

> Create a Novita machine pool in Omnara so agents provision a Novita sandbox when they need a machine, run commands in it, and release it.

[Omnara](https://www.omnara.com) is an open-source hosted agent platform. After you connect Novita Sandbox, Omnara creates a Novita sandbox whenever an agent needs a machine, runs the agent's commands inside the sandbox, and deletes the sandbox once the machine is released.

This article explains how to create a Novita machine pool in Omnara and let an agent use it.

## How it works

1. You create a Novita machine pool in Omnara and fill in the Novita API Key and template.
2. When an agent starts or calls `create_machine`, Omnara creates a sandbox from that template through the Novita API.
3. Omnara starts its daemon `omnarad` in the sandbox. The daemon connects back to Omnara on its own, and the agent's commands are then sent down that connection and executed in the sandbox.
4. When the machine is released or the agent is archived, Omnara deletes the corresponding sandbox.

Sandboxes are created in long-running mode and are not reclaimed by a timeout while the agent holds them. The current version does not support idle sleep.

## Prerequisites

* An Omnara account: [Omnara Cloud](https://app.omnara.com) or a self-hosted instance.
* A Novita account.
* If Omnara is self-hosted: the instance must have a public HTTPS address that the Novita network can reach (`OMNARA_PUBLIC_URL`). The daemon downloads the install script from that address and establishes the connection, so an instance that only listens on `localhost` cannot use any cloud sandbox.

## Setup

### Create a Novita API Key

Create an API Key on the [Key Management](https://novita.ai/settings/key-management) page in the Novita console.

### Choose a template

The template determines each machine's system environment, CPU and memory.

**Use the `base` template**

Novita's `base` template works as-is: 2 vCPU, 1 GB memory, and Debian 12. Commands run as the `user` account, and the home directory is `/home/user`.

**Use a custom template**

A custom template must meet the following conditions for Omnara to install and start the daemon in it:

* The runtime user has a writable `HOME` (or sets `OMNARA_HOME`).
* A POSIX shell and common tools: `curl`, `base64`, `sha256sum` or `shasum`.
* Outbound access to the Omnara API (HTTPS and WebSocket).

Example Dockerfile:

```dockerfile theme={"system"}
FROM debian:bookworm-slim
RUN apt-get update \
 && apt-get install -y --no-install-recommends ca-certificates curl coreutils \
 && rm -rf /var/lib/apt/lists/*
```

Build it with the Novita CLI and specify the size:

```bash CLI icon="terminal" theme={"system"}
novita template create my-agent --dockerfile ./Dockerfile --cpu-count 2 --memory-mb 1024
```

For how templates are built, see Novita's [template build documentation](https://docs.novita.ai/guides/sandbox-template-build-operations.md). Before choosing a size, confirm your account tier's vCPU and memory quota.

### Save the API Key in Omnara

Save the Novita API Key as an organization-level secret.

On the dashboard, open **Organization → Secrets** in Omnara, create a new secret, and paste the API Key. You can also create it inline by clicking **New secret** in the next step when you create the machine pool.

![Save the Novita API Key as an organization secret in Omnara](https://mintcdn.com/novitaai/rdrsW6u6lS9UiDgw/images/sandbox/sandbox-integrations-omnara-1.jpg?fit=max\&auto=format\&n=rdrsW6u6lS9UiDgw\&q=85\&s=a13868f1b4b96ca70824ac8ebc43d0b8)

### Create a Novita machine pool

On the dashboard:

1. Select **All projects** in the project switcher, open **Machines**, click **New pool**, and choose **Novita**.
2. Select the API Key secret from the previous step.
3. Enter the template name or template ID, for example `base`.
4. Enter the per-machine CPU and memory limits and the total pool capacity. The limits must be no smaller than the template's size.

The dashboard cannot set `domain` or the working directory; use the API when you need them.

![Create a Novita machine pool in Omnara](https://mintcdn.com/novitaai/rdrsW6u6lS9UiDgw/images/sandbox/sandbox-integrations-omnara-2.jpg?fit=max\&auto=format\&n=rdrsW6u6lS9UiDgw\&q=85\&s=ee266b331e8bc5bb6262a3ae2c9259d2)

**API field reference**

| Field | Required | Description |
| - | - | - |
| `provider` | Yes | Fixed to `novita` |
| `provider_auth_secret_id` | Yes | The secret created above |
| `default_machine_provider_options.template` | Yes | Template name or template ID, such as `base` |
| `default_machine_provider_options.startup_script` | No | Script that runs on each new machine before the daemon starts, up to 64 KB |
| `default_cwd` | No | Default working directory for commands. Set it to `/home/user` when you use the `base` template |
| `provider_config.domain` | No | Novita API domain, used to select the region. Defaults to `us-phx-1.sandbox.novita.ai`; the old region `us-virginia-1` uses `sandbox.novita.ai` |
| `provider_config.allowed_templates` | No | Template allowlist that restricts which templates projects and agents can override to |
| `max_machine_cpu`, `max_machine_memory_mb` | Yes | Per-machine limits. They must be no smaller than the template's size |
| `max_total_cpu`, `max_total_memory_mb`, `max_total_machines` | Yes | Total pool capacity |

CPU and memory are determined by the template, so `default_machine_cpu` and `default_machine_memory_mb` can be left empty.

### Grant the machine pool to a project

Machine pools belong to the organization, and a project can use one only after it is granted access.

On the dashboard, add the project grant in the machine pool's details.

## Step 6: Use it in the agent configuration

Reference the machine pool by name in `machine_sources` in `agent.yaml`:

```yaml theme={"system"}
version: v1
instruction: |
  You are an engineering assistant. Use your machine to run commands.
model:
  provider_config: <your model provider config name>
  name: <your model name>
machine_sources:
  - machine_pool_name: novita-pool
```

The same setting in the Omnara dashboard, under **Machine sources**:

![Point an Omnara agent at the Novita machine pool](https://mintcdn.com/novitaai/rdrsW6u6lS9UiDgw/images/sandbox/sandbox-integrations-omnara-3.jpg?fit=max\&auto=format\&n=rdrsW6u6lS9UiDgw\&q=85\&s=a5ce7186ed3ea93951041eba0ef22e4b)

After the agent starts, Omnara creates a sandbox on Novita. Once the machine changes from `provisioning` to `online` in Omnara, the agent can execute commands in it. You can see the sandbox in the Novita console or with `novita sandbox list`; it carries `omnara-machine` metadata.

![The agent reports the environment of its Novita sandbox](https://mintcdn.com/novitaai/rdrsW6u6lS9UiDgw/images/sandbox/sandbox-integrations-omnara-4.jpg?fit=max\&auto=format\&n=rdrsW6u6lS9UiDgw\&q=85\&s=0068a858969cab369e5998bcb8f7603c)

## Related links

* [Omnara machine pools documentation](https://docs.omnara.com/machines/pools)
* [Omnara Novita provider documentation](https://docs.omnara.com/machines/providers/novita)
* [Omnara self-hosting: public access](https://docs.omnara.com/self-hosting/deployment#exposing-the-deployment-publicly)
* [Novita template builds](https://docs.novita.ai/guides/sandbox-template-build-operations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.