Skip to main content
A template is the rootfs image used when a sandbox boots. Declaw ships a small set of curated built-in templates for the most common workloads, and you can build your own when you need a different runtime, custom packages, or project files baked in. If you don’t pass template, sandboxes use base — a minimal Ubuntu 22.04 image with shell utilities only.

Built-in templates

Built-in templates are versioned with the platform — you don’t need to build them. They are referenced by name (template="python", etc.) and pull a pre-published rootfs image from the Declaw blob store.

How to choose

  • Need to run a one-off shell command or your own statically-linked binary? → base
  • Running Python code, especially with requests / pandas / numpy? → python
  • Running a TypeScript or Node.js script? → node
  • Running an LLM-driven agent (LangChain, CrewAI, AutoGen, LlamaIndex, OpenAI Agents, MCP)? → ai-agent
If your workload needs something not in the list above (a different language runtime, a heavy ML framework like torch, project files baked in, etc.) — build a custom template. See Build a custom template below.

Worked examples

Each built-in template has a runnable cookbook example you can copy:

base — shell tools

Run git, curl, and jq end-to-end inside a fresh sandbox.

python — pandas analysis

Pipe a CSV through pandas and read back JSON results.

node — TypeScript script

Compile a .ts file with tsc and run the output with Node.js 20.

ai-agent — frameworks check

Boot an agent sandbox and verify the major LLM-framework SDKs import.

ai-agent — KYC with CrewAI

Fintech: four-agent CrewAI KYC pipeline with PII + injection defense.

ai-agent — prior auth with LangGraph

Health-tech: LangGraph workflow with PHI redact + rehydrate around GPT-4.1.

Build a custom template

Use Template.build() when none of the built-ins fit — most commonly when you need additional Python packages, project files copied in, or a different base image.

Build with options

TemplateBase model

TemplateBase describes a template configuration before it is built.

Copy files into a template

Use CopyItem to embed files from the host into the template image at build time.

CopyItem model

Start background build

Use build_in_background() to start a build without waiting, then poll the status.

Check build status

BuildInfo model

TemplateBuildStatus enum

Use a custom template

Or by template ID:

Async template operations

Template builds run on the server. Build time depends on the packages being installed and typically takes 1–5 minutes. Use build_in_background() for large builds to avoid blocking your process.