Overview

Updated at:

Harness Agent is a secure cloud sandbox provided by Bailian. It gives AI agents an isolated environment for code execution, browser operations, and file processing, and is compatible with the E2B SDK/API protocol.

Harness Agent provides isolated cloud environments for AI agents. Each instance has dedicated compute resources, a file system, and network isolation, where you can execute code, run commands, operate a browser, and read/write files. It is compatible with the E2B SDK/API protocol.

Core Concepts

ConceptDescription
TemplateThe runtime configuration of a sandbox, including the base image or Harness type, resource specification, file mounts, network policy, environment variables, and lifecycle. Referenced by templateCode once created; a template can create multiple instances.
Harness templateA fully managed template created from a Harness image, with runtimes such as DeepSeek Harness, OpenClaw, Codex, and Hermes Agent. You can create Harness templates only in the console.
SandboxA running instance launched from a template, with a dedicated runtime environment and network isolation. Referenced by sandboxID once created.
ImageA base image with a preinstalled runtime. Three images are available: Code Interpreter, Browser, and All-in-One.

Base Images

Base images are used to create basic templates. Harness templates use the runtime determined by the selected Harness type and do not use these base images.

ImageDescriptionUse Cases
Code InterpreterLightweight code execution environment, supporting Python / Node.jsCode execution, data analysis, script running
BrowserBrowser execution environment for UI operationsWeb automation, screenshots, UI testing
All-in-OneAn image integrating multiple runtimesTasks requiring multiple languages or combined capabilities

Instance Lifecycle

  • Create: Launch an instance from a template; it enters the running state.
  • Pause: Pause an idle instance, preserving the file system and memory state.
  • Resume: Connect to a paused instance and continue from where it was paused.
  • Release: Release an instance and reclaim resources when no longer needed.

NoteThe idle timeout and maximum lifetime of an instance are set in the template's lifecycle configuration, up to 7 days.

Access Methods

  • Console: Create a template and generate an API Key on the Quick Start page to go from creation to invocation within minutes.
  • E2B SDK: Use the official E2B SDK with the Bailian sandbox endpoint and API Key. See Manage and Use Instances.
  • API: Manage instances and basic templates through the E2B-compatible REST API. See Sandbox API.

Sharing the same console section with Harness Agent, Pro-code applications let you build modular Agents in full Python code with AgentScope and AgentScope-Runtime, deployed as cloud API services. The two products are independent; see Pro-code application.

Next Steps