digitalocean-labs avatar

app-platform-sandbox

Create and manage isolated container sandboxes for AI agent code execution. Use when you need epheme

作者 digitalocean-labs|オープンソース

Sandbox Skill

Create and manage isolated container environments on DigitalOcean App Platform for AI agent code execution and testing workflows.

What This Skill Does

  • Creates ephemeral, single-use sandbox containers for running untrusted code
  • Manages hot pools of pre-warmed sandboxes for instant acquisition (~50ms vs ~30s cold start)
  • Provides SDK patterns for AI agent workflows (code interpreters, iterative development)

When to Use This Skill

Use sandbox when you need to:

  • Execute untrusted code in isolation (AI code interpreters)
  • Run long-running or stateful agent workflows
  • Test in isolated environments before production

NOT for debugging existing apps — use the troubleshooting skill for that.

Quick Start

from do_app_sandbox import Sandbox

# Create a sandbox
sandbox = Sandbox.create(image="python")
result = sandbox.exec("python3 -c 'print(2+2)'")
print(result.stdout)  # 4
sandbox.delete()

Key Decisions

DecisionChoiceRationale
SDK over CLIPython SDK onlyAI agents use programmatic access
Hot pool defaultSandboxManagerEliminates 30s cold start for agents
Image choicepython, nodePre-built at ghcr.io/bikramkgupta

Files

  • SKILL.md — Full documentation with decision trees and patterns
  • reference/cold-sandbox.md — Single sandbox creation patterns
  • reference/hot-pool.md — SandboxManager for pre-warmed pools
  • reference/use-cases.md — AI agent and testing patterns
  • reference/positioning.md — When to use sandbox vs Lambda

Integration

  • ← troubleshooting: Different use case (debug existing vs create new)
  • → designer: Can include sandbox-compatible images in app specs