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.
Click Create Template and configure the following fields.
Choose one of three base images:
Expand advanced configuration as needed to set the following capabilities.
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 templates that are no longer needed from the template list.
In addition to the console, you can manage templates through the API. See Sandbox API - Template Management.
Create a Template
Click Create Template and configure the following fields.
Select an Image
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. 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.
| Item | Description |
|---|---|
| File mounts | Initialize local files to a specified directory; 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.
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.