Sandbox Sdk

🏢Official
by cloudflare · vlatest · Repository

Official cloudflare skill for Cloudflare — helps with deploying and managing cloud infrastructure.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add cloudflare-sandbox-sdk npx -- -y @trustedskills/cloudflare-sandbox-sdk
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "cloudflare-sandbox-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/cloudflare-sandbox-sdk"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill enables AI agents to build and manage secure, isolated code execution environments on Cloudflare Workers using the Cloudflare Sandbox SDK. It allows for running shell commands, executing code (including LLM-generated code), managing files within a sandboxed environment, and exposing ports. The skill is particularly useful for situations requiring controlled and reproducible code execution, especially when integrating with AI agents to execute generated code safely.

When to use it

  • Executing LLM-Generated Code: Safely run Python or JavaScript code generated by an AI agent without risking the underlying system.
  • Running Shell Scripts: Execute shell commands and scripts within a controlled environment for tasks like version checks or simple automation.
  • Developing Isolated Applications: Build secure, isolated applications on Cloudflare Workers that require specific dependencies or environments.
  • Reproducible Code Execution: Ensure consistent results by running code in a pre-defined and isolated sandbox.

Key capabilities

  • Code Execution (Interpreter): Executes code snippets using runCode() with support for Python and JavaScript/TypeScript. State persists within the context of execution.
  • Command Execution: Runs shell commands and scripts via exec().
  • File Management: Creates directories, writes files, reads files, and lists files within the sandbox environment.
  • Port Exposure: Exposes ports for applications running inside the sandbox.
  • Sandbox Creation & Destruction: Creates and destroys sandboxed environments as needed.

Example prompts

  • "Run 'python --version' in the sandbox."
  • "Execute this Python code: import pandas as pd; data = [1,2,3]; print(sum(data))"
  • "Create a directory called 'my_project' and write a file named 'hello.py' with the content 'print('Hello from Sandbox!')'"

Tips & gotchas

  • Docker Requirement: Local development requires Docker to be installed and functioning correctly (docker info must succeed).
  • Configuration Required: A wrangler.jsonc file is required, following a specific structure (do not modify it).
  • Explicit Contexts for Production: For production environments, create explicit code contexts to manage state effectively.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
cloudflare
Installs
41

🏢 Official

Published by the company or team that built the technology.