Template Management
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 method | Description |
|---|---|
| Create Harness Template | Create a fully managed template from a Harness image, with built-in agent runtime, tools, and scheduling capabilities |
| Create Basic Template | Create a template from a base image and configure resource specifications and the runtime environment |
Create a Harness Template
Select a Harness type:
| Harness type | Description |
|---|---|
| DeepSeek Harness | DeepSeek'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. |
| OpenClaw | A 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. |
| Codex | OpenAI's open-source coding agent. It understands project code, edits files, runs commands, and helps with feature development, refactoring, bug fixes, and testing. |
| Hermes Agent | Nous 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:
| Field | Description |
|---|---|
| Template name | Required, customizable |
| Model | Required. Select the model used by the Harness |
| API Key | Required. API Key used by the Harness to call the model |
| Resource specification | Required. 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 configuration | Optionally 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:
| Item | Description |
|---|---|
| File mounts | Initialize local files to /home/user/workspace/uploads/; up to 5 files |
| Network configuration | Set access allow-list and deny-list rules |
| Key vault reference | Select an existing key. Multiple templates can reuse the same reference. The key stores only a reference and takes effect when the instance starts |
| Environment variables | Inject 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:
| Image | Description | Use Cases |
|---|---|---|
| Code Interpreter | Lightweight code execution environment, supporting Python / Node.js | Code execution, data analysis, script running |
| Browser | Browser execution environment for UI operations | Web automation, screenshots, UI testing |
| All-in-One | An image integrating multiple runtimes | Tasks requiring multiple languages or combined capabilities |
Basic Configuration
| Field | Description |
|---|---|
| Template name | Required, customizable |
| Resource specification | Required. Select Basic, Standard, or Premium. See Billing for prices and specifications |
Advanced Configuration
Expand advanced configuration as needed to set the following capabilities.
| Item | Description |
|---|---|
| File mounts | Initialize local files to /home/user/workspace/uploads/; up to 5 files |
| Network configuration | Set access allow-list and deny-list rules |
| Environment variables | Inject environment variables as key-value pairs |
| Lifecycle control | Choose 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.