Skip to main content
Sandboxes are in private preview. APIs and features may change as we iterate. Sign up for the waitlist to get access.
Before creating a sandbox, you need a template. Templates define the blueprint for sandbox instances, including the container image, resource allocation, and optional configuration like volumes and auth proxy rules. Template list view

What templates define

SettingDescription
Container imageThe Docker image to use (private registries are supported)
Resource capacityCPU, memory, and storage limits
VolumesPersistent storage to attach (optional)
Auth proxy configRules for injecting secrets into outbound requests (optional) — see Auth proxy

Create a template

from langsmith.sandbox import SandboxClient

client = SandboxClient()

client.create_template(
    name="python-sandbox",
    image="python:3.12-slim",
)
You can also create templates via the REST API with full control over resources and proxy configuration:
curl -X POST "$LANGSMITH_ENDPOINT/api/v2/sandboxes/templates" \
  -H "x-api-key: $LANGSMITH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "python-sandbox",
    "image": "python:3.12-slim",
    "resources": {"cpu": "500m", "memory": "512Mi", "storage": "2Gi"}
  }'

Next steps