Environments and Sandboxespublic

Last verified 21 Sep 2026

DigitalOcean Harness Runtime combines the functionality of a lightweight microVM, built-in tools like chromium and a coding sandbox needed by agents to do work. The product offers rich lifecycle APIs that persist conversational history and working state across sessions, with pause/resume/fork semantics so that developers can control costs and adapt workflows to the nonlinear quirks of agentic work. See What You Can Build for example use cases.

Environment

An environment is a reusable configuration object that defines what an agent needs to do work. It specifies the agent or framework to run, the sandbox’s compute resources, and the skills, tools, credentials, and permissions available to the agent.

Starting a session from an environment provisions an isolated sandbox using that configuration. The environment defines the setup; the sandbox is the machine where the agent and its code run. You can use the same environment to start multiple sessions, each with its own sandbox. You define an environment in an environment spec or build the equivalent in the Control Panel.

An environment is immutable once created. Changing its adapter, credentials, or permissions requires creating a new environment, keeping each session traceable to the configuration it started with.

What an Environment Declares

Declaration What it sets
agent The adapter, which selects the coding agent or framework and the sandbox image that boots.
size The vCPU and memory allocation of the sandbox.
skills Inline instructions the agent loads, in the Agent Skills (SKILL.md) shape.
secrets and env Credentials and plain configuration. See Secrets and Configuration.
permissions What the agent may do, must ask about, or may never do. See Permission Policies.
tools MCP servers and Action Gateway tools the agent can call.
egress An allowlist of hosts the sandbox may reach. Unrestricted when omitted. See Network Egress.
repos Repositories the agent is meant to work on. A hint, not a checkout; nothing is cloned for the agent.

Environment Configs

Saving an environment so you can start sessions from it repeatedly, without resupplying credentials, gives you an Environment Config. See Use Environment Configs.

The Sandbox

A sandbox is the isolated microVM provisioned for a session. It provides the CPU, memory, filesystem, and toolchain the agent uses to execute code and work with files. Its size and image are determined by the environment. Isolation is enforced by the hypervisor rather than by container namespaces, so a process in one sandbox cannot observe or reach another session, another customer, or the host. Harness Runtime manages its lifecycle, including provisioning, pausing, resuming, and removal when you delete the session.

The environment also defines the credentials available to the agent and, when it sets an egress allowlist, the network destinations the sandbox is confined to. Listing a repository under repos tells the agent which repository it is meant to work on; it does not clone the repository into the sandbox. To harden credentials, egress, and cleanup across adapters, see Secure Sessions.

Sandbox Sizes

A sandbox has a fixed vCPU and memory allocation, chosen through the size field. Size cannot change on a running session, and a session restored from a checkpoint keeps the size of the sandbox the checkpoint came from. For the available values, see the environment spec reference.

Sandbox Images

The sandbox boots from an image that already contains the agent, its dependencies, and the in-sandbox runtime that supervises it. The adapter you choose selects the image, and setting template pins a different one.

Teams that need extra tooling in every sandbox can build a custom image on top of a DigitalOcean base image and reference it from the environment. See Use a Custom Template.

The Workspace

/workspace is the working directory for the agent. Cloned repositories, uploaded files, agent edits, and build artifacts all live there, and it is the default root for filesystem permission rules.

The workspace lasts as long as the sandbox does. It survives pausing and resuming, which freeze and thaw the same machine rather than replacing it, and it is destroyed when you remove the session. To keep work, push it to a repository, download it, or take a checkpoint before you remove the session.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.