sandbox-sdk

sandbox-sdk is a skill for Claude Code, Codex from d-padmanabhan/agent-engineering-handbook. It costs 66 tokens per session (1,347 once invoked), scanned C, a copy of sandbox-sdk, MIT.

A guide to running code and commands inside isolated sandbox environments on Cloudflare Workers.

In plain words
What is it for?
Use it to build AI code runners, code interpreters, CI/CD systems, and interactive development environments with commands, files, previews, and sandbox lifecycles.
Why use it?
Isolation limits the damage that untrusted code could cause to the host application or other users.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build AI code runners, code interpreters, CI/CD systems, and interactive development environments with commands, files, previews, and sandbox lifecycles.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add d-padmanabhan/agent-engineering-handbook --skill sandbox-sdk
Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sandbox-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk/github.svg)](https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk)
Your own site
<a href="https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk"><img src="https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sandbox-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk"><img src="https://agentmods.dev/badge/skills/d-padmanabhan/agent-engineering-handbook/sandbox-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.01347
Opus 5 $0.00033 $0.00674
Sonnet 5 $0.00013 $0.00269
Haiku 4.5 $0.00007 $0.00135

Measured 6d ago against content hash 3d66b1b7e854, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

sandbox-sdk scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
Origin

This is a copy

100% identical to sandbox-sdk — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/sandbox-sdk/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cloudflare Sandbox SDK

Build secure, isolated code execution environments on Cloudflare Workers.

FIRST: Verify Installation

npm install @cloudflare/sandbox
docker info  # Must succeed - Docker required for local dev

Retrieval Sources

Your knowledge of the Sandbox SDK may be outdated. Prefer retrieval over pre-training for any Sandbox SDK task.

Resource URL
Docs https://developers.cloudflare.com/sandbox/
API Reference https://developers.cloudflare.com/sandbox/api/
Examples https://github.com/cloudflare/sandbox-sdk/tree/main/examples
Get Started https://developers.cloudflare.com/sandbox/get-started/

When implementing features, fetch the relevant doc page or example first.

Required Configuration

wrangler.jsonc (exact - do not modify structure):

{
  "containers": [{
    "class_name": "Sandbox",
    "image": "./Dockerfile",
    "instance_type": "lite",
    "max_instances": 1
  }],
  "durable_objects": {
    "bindings": [{ "class_name": "Sandbox", "name": "Sandbox" }]
  },
  "migrations": [{ "new_sqlite_classes": ["Sandbox"], "tag": "v1" }]
}

Worker entry - must re-export Sandbox class:

import { getSandbox } from '@cloudflare/sandbox';
export { Sandbox } from '@cloudflare/sandbox';  // Required export

Quick Reference

Task Method
Get sandbox getSandbox(env.Sandbox, 'user-123')
Run command await sandbox.exec('python script.py')
Run code (interpreter) await sandbox.runCode(code, { language: 'python' })
Write file await sandbox.writeFile('/workspace/app.py', content)
Read file await sandbox.readFile('/workspace/app.py')
Create directory await sandbox.mkdir('/workspace/src', { recursive: true })
List files await sandbox.listFiles('/workspace')
Expose port await sandbox.exposePort(8080)
Destroy await sandbox.destroy()

Core Patterns

Execute Commands

Read the full file on GitHub · 178 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 178 lines · 66 tokens per session scan C 3d66b1b7e854

Subscribe to this mod's changes

sandbox-sdk is a skill published in the GitHub repository d-padmanabhan/agent-engineering-handbook (17 stars, last pushed 3d ago), licensed MIT. It adds 66 tokens to every session and 1,347 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to sandbox-sdk, differing in 10 lines, and is treated as a copy.

Related

Other skills, from other repositories

azd-deployment

Deploy containerized frontend + backend applications to Azure Container Apps with remote builds, managed identity, and idempotent infrastructure.

sickn33/agentic-awesome-skills · 29 tokens

openshell-cli

Guide agents through using the OpenShell CLI (openshell) for sandbox management, gateway registration, provider configuration and refresh, policy iteration, settings, service exposure, BYOC workflows, and inference routing. Covers basic through advanced multi-step workflows. Trigger keywords - openshell, sandbox…

NVIDIA/OpenShell · 127 tokens

langbot-deploy

Deploy and configure a LangBot instance — Docker / Docker Compose, Kubernetes, the config.yaml model, the Box sandbox runtime, the plugin runtime, and the global API key. Use when installing, deploying, upgrading, or configuring LangBot in production or self-hosted environments. Triggers on "deploy langbot", "langbot…

langbot-app/LangBot · 104 tokens

compute-env-setup

Set up a compute environment on a remote provider so Claude Science jobs can run there. Covers direct SSH/conda hosts, Slurm clusters, container-via-bridge runners, and managed-API providers (Modal, GCP, RunPod). Use when standing up a new provider, porting an env to a different backend, adding a tool that needs its…

UnicomAI/wanwu · 134 tokens

azure-cloud-migrate

Assess and migrate cross-cloud workloads to Azure with reports and code conversion. Supports Lambda→Functions, Beanstalk/Heroku/App Engine→App Service, Fargate/Kubernetes/Cloud Run/Spring Boot→Container Apps. WHEN: migrate Lambda to Functions, AWS to Azure, migrate Beanstalk, migrate Heroku, migrate App Engine, Cloud…

microsoft/skills · 106 tokens

atmos-helmfile

Helmfile orchestration: sync/apply/destroy/diff, Kubernetes deployments, varfile generation, EKS integration, source management.

cloudposse/atmos · 33 tokens