Skip to main content
How-to Guide

Template Management

A template defines the base image, 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 Sandbox > My Templates.

Create a Template

Click Create Template and configure the following fields.

Select an Image

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. Spec 1 (1 Core / 2 GB, recommended) or Spec 2 (4 Core / 8 GB)

Advanced Configuration

Expand advanced configuration as needed to set the following capabilities.
ItemDescription
File mountsInitialize local files to a specified directory; 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.
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.
A 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 templates through the API. See Sandbox API - Template Management.