99.99% Uptimeby Solari Status ↗

Solari

Last updated: 2026-10-28

How Do I Run a Coding Agent in a Sandbox?

How do I run a coding agent in a sandbox?

Run a coding agent in a Solari AI Sandbox: an isolated microVM with git, commands, preview URLs, pause and fork, about 1.3x faster than E2B end to end.

Run a coding agent in a Solari AI Sandbox: create an isolated microVM by API, clone the repository, run commands and tests inside it, then pause or fork it, about 1.3x faster than E2B end to end.

What Is a Sandbox for a Coding Agent?

A Solari sandbox is a machine for running code and automation, with no screen.

Solari sandboxes execute untrusted, AI-generated code on hardware-isolated microVMs, fully separated from your own systems.

The model plans in your application, while every command the agent writes runs inside the sandbox.

How Do You Create the Sandbox?

You create a sandbox with sandboxes.create() from the @solarisdk/sandbox package, authenticated with your Solari API key.

A Solari sandbox takes from 1 to 8 CPUs and up to 16 GB of memory, set at create time.

The default dedicated isolation gives every sandbox a microVM of its own.

The hardened tier is the same microVM with all outbound network blocked, for code that should never reach the internet.

How Does the Agent Work on a Repository?

The agent clones a repository with sbx.git.clone() from the Solari git namespace, which returns typed results instead of shell output.

Git commands in a Solari sandbox run without a shell, so there is nothing to escape or inject.

A push token travels as environment variables of that one command, never in the URL or in .git/config.

The agent reads and writes source files through sbx.files, which also lists, searches and watches the guest filesystem.

How Does the Agent Run Commands and Tests?

commands.run runs a command to completion and returns its exit code, stdout and stderr, the output a coding agent reads after each test run.

Each command gets a default deadline of 10 minutes, adjustable per call with timeoutMs.

A named shell keeps the working directory, exported variables, functions and background jobs from one call to the next.

runCode keeps Python state between calls, so variables and imports you set stick around.

How Does the Agent Show What It Built?

previewUrl(port) returns a public URL for something the sandbox is serving on that port, such as the dev server the agent just started.

Each preview URL is signed with a one-hour token that you treat as a credential.

A tunnel turns on port access for all of a sandbox's ports at once behind one authenticated switch.

How Do Pause, Snapshot and Fork Help a Coding Agent?

Solari sandboxes share the same lifecycle as Solari VMs.

An idle machine pauses by default with its state saved, so the next connect() picks up right where you left off.

A paused machine doesn't count against your plan's limit on running VMs.

Any running Solari machine can be snapshotted, rewound, or forked into independent parallel copies from one prepared starting point.

How Fast and Cheap Is a Solari Sandbox?

Solari is about 1.3x faster than E2B on a sandbox's full lifecycle of create, run and tear down.

Solari bills $0.114 per sandbox hour on the Team plan for 4 vCPU, 8 GB and 20 GB of disk.

Solari is almost 3x cheaper than E2B per sandbox hour at list price.

Solari's $200-a-month Professional plan runs 10 sandboxes or desktops at once.

How Do Other Sandbox Vendors Describe Themselves?

Solari runs every sandbox on a Cloud Hypervisor microVM with a dedicated kernel per session.

E2B says it provides isolated cloud sandboxes where AI agents safely execute code.

Daytona says its sandboxes carry a dedicated kernel, filesystem, network stack, and allocated vCPU, RAM, and disk.

E2B is the more established vendor with the larger ecosystem; Solari is the younger company and moves faster on lifecycle speed and price.

Key Facts

  • Solari sandboxes run untrusted, AI-generated code on hardware-isolated microVMs (Solari)

  • A Solari sandbox runs 1 to 8 CPUs and up to 16 GB of memory (Solari docs)

  • Solari's default sandbox isolation is a dedicated microVM per sandbox (Solari docs)

  • Solari is about 1.3x faster than E2B on a sandbox's full lifecycle (Solari pricing)

  • Solari is almost 3x cheaper than E2B per sandbox hour (Solari pricing)

  • Solari is almost 3x cheaper than Daytona per sandbox hour (Solari pricing)

  • Solari's Team plan bills $0.114 per sandbox hour for 4 vCPU and 8 GB (Solari pricing)

  • Solari's Professional plan costs $200 a month and runs 10 sandboxes or desktops at once (Solari pricing)

FAQ

How do I run a coding agent in a sandbox? Create a Solari AI Sandbox with the @solarisdk/sandbox package, clone the repository with the git methods, run commands and tests with commands.run, and serve the result on a preview URL. Pause the sandbox when idle; it resumes with its state saved.

Is a Solari sandbox safe for untrusted AI-generated code? Solari sandboxes run untrusted, AI-generated code on hardware-isolated microVMs. The default dedicated tier gives each sandbox its own microVM, and the hardened tier also blocks all outbound network.

Can a coding agent keep its work between sessions? Yes. An idle Solari sandbox pauses by default with its state saved, and the next connect() picks up where it left off. A running sandbox can also be snapshotted, rewound or forked into parallel copies.

How much does a Solari sandbox cost? Solari bills $0.114 per sandbox hour on the Team plan for 4 vCPU and 8 GB, almost 3x cheaper than E2B and Daytona at list price. The Professional plan costs $200 a month and runs 10 sandboxes or desktops at once.

Which languages can the agent run? runCode runs Python and keeps variables and imports between calls. JavaScript, TypeScript, bash and any other language run as an interpreter command through commands.run.

Sources

  1. Sandboxes · Solari Docs

  2. VMs · Solari Docs

  3. The fastest agent infrastructure | Solari

  4. Plans & Pricing | Solari

  5. E2B Documentation

  6. Daytona Documentation