sandbox-sdk
Skill1 starsChanged 46 days agoMITView on GitHub
Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
- Deletes or force-pushes
- Installs packages
20 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- artivilla/agent-skillsword for word, first seen Nov 8, 2026
- opencoredev/sandbox-sdktheir own version, first seen Nov 3, 2026
- jjsizemore/jjskillsword for word, first seen Nov 1, 2026
- adrienlupo/Claude-code-configword for word, first seen Oct 30, 2026
- meowdiocre/meowpiedited, first seen Oct 27, 2026
- aksharahegde/stateful-browser-agentword for word, first seen Oct 13, 2026
Used with
Projects with it also use grill-with-docs, grilling and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillgrill-with-docs
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
Also in 3 projects that use this
GoogleSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 3 projects that use this
Other versions20 projects use a version of this.
Word for word · 14
- openai/plugins★ 7.8k100% same
- kevyder/banrepco_mcp★ 9100% same
- adrienlupo/Claude-code-config★ 3100% same
- GTMify/claude-skills-starter★ 2100% same
- altrwork/skills★ 1100% same
- birdmanmandbir/skills★ 1100% same
- jjsizemore/jjskills★ 1100% same
- LukaGiorgadze/opencto★ 1100% same
- snissn/skills★ 1100% same
- aksharahegde/stateful-browser-agent★ 0100% same
4 more not listed
Edited · 3
- d-padmanabhan/agent-engineering-handbook★ 17100% same
- meowdiocre/meowpi★ 392% same
- vteetime/cloudflare-skills-for-hermes★ 095% same
Wrote their own version · 3
- swyxio/skills★ 194same name
- opencoredev/sandbox-sdk★ 108same name
- langgenius/mosoo-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository81 other files it gives its agents.
- accessibility-action-planSkill
- accessibility-auditSkill
- accessibility-finding-explainerSkill
- accessibility-report-summarySkill
- agent-config-authoringSkill
- agents-sdkSkill
- ai-ux-patternsSkill
- alt-text-generatorSkill
- anti-ai-copySkill
- aria-usage-reviewSkill
- astro-architectureSkill
- astro-client-scriptsSkill
- astro-component-a11y-reviewSkill
- before-after-accessibility-commsSkill
- bfsg-risk-language-softenerSkill
- biomeSkill
- blog-from-transcriptSkill
- brand-voice-dnaSkill
- case-study-from-auditSkill
- client-email-after-auditSkill
- cloudflare-email-serviceSkill
- cloudflare-one-migrationsSkill
- cloudflare-oneSkill
- cloudflareSkill
- complexity-judgmentSkill
- component-doc-writerSkill
- content-clarity-a11y-checkSkill
- content-qaSkill
- conversation-retrospectiveSkill
- darkmodeSkill
- deep-researchSkill
- design-directionsSkill
- design-systemsSkill
- durable-objectsSkill
- faq-from-issuesSkill
- form-accessibility-reviewSkill
- frontend-designSkill
- handoffSkill
- i18nSkill
- image-to-webpSkill
- keyboard-navigation-reviewSkill
- knowledge-baseSkill
- landing-and-site-builderSkill
- landingpage-from-briefingSkill
- lighthouse-axe-result-explainerSkill
- linkedin-post-from-contentSkill
- llm-councilSkill
- local-business-seoSkill
- mcp-builderSkill
- mdx-contentSkill
- motion-designSkill
- native-html-uiSkill
- newsletter-from-auditSkill
- overlay-tool-risk-explainerSkill
- playwrightSkill
- post-auditSkill
- remotionSkill
- sandbox-migrate-to-nextSkill
- sandbox-nextSkill
- sandbox-stableSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
When implementing features, fetch the relevant doc page or example first.
- Distinctive: line 49
Worker entry: - must re-export Sandbox class:
- Very specific: line 82
Use runCode() for executing LLM-generated code with rich outputs:
- Distinctive: line 118
Add dependencies by extending the Dockerfile:
- Distinctive: line 135
Keep images lean - affects cold start time.
- Very specific: line 164
Use destroy() to immediately free resources
- Distinctive: line 171
Don't hardcode sandbox IDs for multi-user: - use user/session identifiers
- Very specific: line 172
Don't forget cleanup: - call destroy() for temporary sandboxes
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 devRetrieval Sources
Your knowledge of the Sandbox SDK may be outdated. Prefer retrieval over pre-training for any Sandbox SDK task.
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 exportQuick 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
const sandbox = getSandbox(env.Sandbox, 'user-123');
const result = await sandbox.exec('python --version');
// result: { stdout, stderr, exitCode, success }Code Interpreter (Recommended for AI)
Use runCode() for executing LLM-generated code with rich outputs:
const ctx = await sandbox.createCodeContext({ language: 'python' });
await sandbox.runCode('import pandas as pd; data = [1,2,3]', { context: ctx });
const result = await sandbox.runCode('sum(data)', { context: ctx });
// result.results[0].text = "6"Languages: python, javascript, typescript
State persists within context. Create explicit contexts for production.
File Operations
await sandbox.mkdir('/workspace/project', { recursive: true });
await sandbox.writeFile('/workspace/project/main.py', code);
const file = await sandbox.readFile('/workspace/project/main.py');
const files = await sandbox.listFiles('/workspace/project');When to Use What
| Need | Use | Why |
| Shell commands, scripts | exec() | Direct control, streaming |
| LLM-generated code | runCode() | Rich outputs, state persistence |
| Build/test pipelines | exec() | Exit codes, stderr capture |
| Data analysis | runCode() | Charts, tables, pandas |
Extending the Dockerfile
Base image (docker.io/cloudflare/sandbox:0.7.0) includes Python 3.11, Node.js 20, and common tools.
Add dependencies by extending the Dockerfile:
FROM docker.io/cloudflare/sandbox:0.7.0
# Python packages
RUN pip install requests beautifulsoup4
# Node packages (global)
RUN npm install -g typescript
# System packages
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
EXPOSE 8080 # Required for local dev port exposureKeep images lean - affects cold start time.
Preview URLs (Port Exposure)
Expose HTTP services running in sandboxes:
const { url } = await sandbox.exposePort(8080);
// Returns preview URL for the serviceProduction requirement: Preview URLs need a custom domain with wildcard DNS (*.yourdomain.com). The .workers.dev domain does not support preview URL subdomains.
See: https://developers.cloudflare.com/sandbox/guides/expose-services/
OpenAI Agents SDK Integration
The SDK provides helpers for OpenAI Agents at @cloudflare/sandbox/openai:
import { Shell, Editor } from '@cloudflare/sandbox/openai';See examples/openai-agents for complete integration pattern.
Sandbox Lifecycle
getSandbox()returns immediately - container starts lazily on first operation- Containers sleep after 10 minutes of inactivity (configurable via
sleepAfter) - Use
destroy()to immediately free resources - Same
sandboxIdalways returns same sandbox instance
Anti-Patterns
- Don't use internal clients (
CommandClient,FileClient) - usesandbox.*methods - Don't skip the Sandbox export - Worker won't deploy without
export { Sandbox } - Don't hardcode sandbox IDs for multi-user - use user/session identifiers
- Don't forget cleanup - call
destroy()for temporary sandboxes
Detailed References
- references/api-quick-ref.md - Full API with options and return types
- references/examples.md - Example index with use cases
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

