Template Management

Updated at:

A template defines the base image or Harness type, resource specification, file mounts, network policy, environment variables, and lifecycle of a sandbox. Multiple isolated instances can be created from a template.

A template is a prerequisite for creating sandbox instances. One template can create multiple instances, and instances inherit the runtime configuration of the template. Manage all templates in Harness Agent > My Templates.

Templates are either basic templates or Harness templates:

  • Basic templates are created from one of three base images: Code Interpreter, Browser, or All-in-One.
  • Harness templates are created from Harness images and include fully managed runtimes such as DeepSeek Harness, OpenClaw, Codex, and Hermes Agent.

Create a Template

In Harness Agent > My Templates, click Create Template and choose a creation method:

Creation methodDescription
Create Harness TemplateCreate a fully managed template from a Harness image, with built-in agent runtime, tools, and scheduling capabilities
Create Basic TemplateCreate a template from a base image and configure resource specifications and the runtime environment

Create a Harness Template

Select a Harness type:

Harness typeDescription
DeepSeek HarnessDeepSeek's open-source general-purpose agent for office and coding tasks. It supports creating plugins and extending capabilities through conversation, and turns daily requests into reusable tools.
OpenClawA self-hostable, always-on open-source personal assistant. It accepts tasks from chat apps, operates browsers, reads and writes files, runs commands, and handles scheduled tasks.
CodexOpenAI's open-source coding agent. It understands project code, edits files, runs commands, and helps with feature development, refactoring, bug fixes, and testing.
Hermes AgentNous Research's open-source personal agent with cross-session memory and skill accumulation. It turns task experience into reusable skills and improves over time.

Configure the following fields:

FieldDescription
Template nameRequired, customizable
ModelRequired. Select the model used by the Harness
API KeyRequired. API Key used by the Harness to call the model
Resource specificationRequired. Select Basic, Standard, or Premium. See Billing for prices and specifications
Agent Infra (optional)Connect to internal or third-party services over MCP. Agent Infra requires a Model Studio API Key
Advanced configurationOptionally configure file mounts, network, key vault reference, and environment variables

Harness templates include the following capabilities:

  • Skill learning loop: Create skills from experience and improve them automatically during use.
  • Built-in tools: Terminal, browser, files, Python RPC, and other tools.
  • Multi-platform messaging: Telegram, Discord, Slack, WhatsApp, Signal, and more.
  • Scheduled automation: A built-in Cron scheduler with natural language task definitions.
  • Sandbox preinstalled tools: Shell, Browser, File, VNC, VSCode Server.

Advanced configuration:

ItemDescription
File mountsInitialize local files to /home/user/workspace/uploads/; up to 5 files
Network configurationSet access allow-list and deny-list rules
Key vault referenceSelect an existing key. Multiple templates can reuse the same reference. The key stores only a reference and takes effect when the instance starts
Environment variablesInject environment variables as key-value pairs

NoteHarness templates cannot be created through the API at this time. Create them in the console.

Create a Basic Template

Choose one of three 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

Basic Configuration

FieldDescription
Template nameRequired, customizable
Resource specificationRequired. Select Basic, Standard, or Premium. See Billing for prices and specifications

Advanced Configuration

Expand advanced configuration as needed to set the following capabilities.

ItemDescription
File mountsInitialize local files to /home/user/workspace/uploads/; up to 5 files
Network configurationSet access allow-list and deny-list rules
Environment variablesInject environment variables as key-value pairs
Lifecycle controlChoose either idle timeout or maximum lifetime, up to 7 days
  • Idle timeout (seconds): Automatically hibernate after the request timeout with no state resume; released after up to 7 days.
  • Maximum lifetime (seconds): An instance runs for up to 7 days after it is first created or resumed.

NoteWhen creating a template through the API, mntConfig.mountPath must start with /home/user/workspace/uploads/. If the path is outside this directory, the API accepts the configuration but the file does not appear in the instance. See File upload.

Click Create when done. After creation, the template appears in the list.

View and Edit Templates

In the template list, click a template to view its basic information and edit configurations such as resource specification, network policy, and environment variables. The template version increments after each update.

Delete a Template

Delete templates that are no longer needed from the template list.

NoteA template cannot be deleted while it still has running or paused instances. Release those instances first—see Manage and Use Instances.

Manage Templates via API

In addition to the console, you can manage basic templates through the API. Harness templates cannot be created through the API at this time. See Sandbox API - Template Management.