Built-in templates
These templates are automatically registered and built when the control plane starts:| Template | Description | Source |
|---|---|---|
python | Python 3.12 with pip and common packages | github.com/zwrm-eu/templates/python-api |
node | Node.js 22 with npm | github.com/zwrm-eu/templates/web |
go | Go toolchain | github.com/zwrm-eu/templates/go |
Template lifecycle
- Pending — Template record created in database
- Building — Docker image is being built and converted to ext4
- Ready — Image is built and available for sandbox creation
- Failed — Build failed (error stored in
build_errorfield)
Listing templates
- CLI
- API
Creating custom templates
Custom templates are built from a Dockerfile. The Dockerfile defines the complete environment — OS packages, language runtimes, tools, and default configuration.- CLI
- API
--egress-mode—allow_allordeny_alldefault for sandboxes from this template--egress-allow-cidr CIDR— Default allowed outbound CIDR (repeatable; impliesdeny_all)--egress-deny-cidr CIDR— Default denied outbound CIDR (repeatable)--egress-allow-port PORT— Default TCP port restriction for--egress-allow-cidr(repeatable)
Template metadata
Templates can include azwrm-template.toml file in their repository root with metadata:
Build pipeline
The template build pipeline converts a Dockerfile into a Firecracker-bootable ext4 filesystem:- Docker build — Standard
docker buildusing the provided Dockerfile - Container export — Export the built image as a tar archive
- ext4 creation — Create an ext4 filesystem and extract the tar contents into it
- Init injection — Inject init scripts for VM boot (networking, overlayfs setup)
- Daemon injection — Install
zwrm-sandboxd, the in-VM agent daemon that the host communicates with for command execution and file operations - Agent skeleton — Copy
/home/agentto/etc/skel/agent-skel/for user provisioning - Cache — Store the result with a content-addressed cache key
Build caching is content-addressed. The cache key includes the repository URL and commit hash. Rebuilding with no upstream changes is a no-op.
Rebuilding templates
When you update a template’s Dockerfile, rebuild it to create a new version:- CLI
- API
Deleting custom templates
- CLI
- API
Template resolution
When creating a sandbox, thetemplate field is resolved in this order:
- By ID — Exact match on template ID (e.g.,
tmpl_abc123) - By name (org-scoped) — Match on name within the requesting organization’s custom templates
- By name (built-in) — Match on name among built-in templates