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
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
UseTemplate.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.
- Python
- TypeScript
Build with options
- Python
- TypeScript
TemplateBase model
TemplateBase describes a template configuration before it is built.
Copy files into a template
UseCopyItem to embed files from the host into the template image at build time.
CopyItem model
Start background build
Usebuild_in_background() to start a build without waiting, then poll the status.
- Python
Check build status
- Python
BuildInfo model
TemplateBuildStatus enum
Use a custom template
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.