sandbox-execution
Use when the user asks to sandbox agent code, run untrusted code from an LLM, gVisor (runsc), Firecracker microVMs, Kata Containers, durable execution with…
от j4flmao★ 47 звёзд на GitHub
Установить sandbox-execution в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Sandbox Execution
Purpose
This skill provides the complete architectural and operational knowledge required to build production-grade sandboxed execution environments for AI agent systems. Agents operating in unrestricted host environments pose catastrophic risks—arbitrary code execution, filesystem corruption, network exfiltration, and runaway resource consumption. This skill addresses every layer of the isolation stack: from lightweight namespace-based sandboxing through hardware-virtualized microVMs, from ephemeral stateless containers to durable execution frameworks that survive process crashes.
The skill covers the full lifecycle of a sandboxed agent runtime: provisioning an isolated workspace, enforcing filesystem mount policies, applying network segmentation, imposing CPU/memory/disk quotas, persisting and restoring agent state via snapshots, and enabling fork-based speculative execution. It treats the sandbox itself as a composable tool that agents can invoke, configure, and tear down programmatically.
Core Principles
Defense in Depth: Never rely on a single isolation boundary. Layer namespace isolation, seccomp filters, capability dropping, and hypervisor-level separation to create multiple independent containment rings.
Least Privilege by Default: Every sandbox starts with zero capabilities, no network access, a read-only root filesystem, and no access to host devices. Access is granted explicitly and auditably through policy declarations.
Durability over Ephemerality: Agent work products must survive sandbox restarts, host reboots, and infrastructure failures. Durable execution frameworks (Temporal, Restate) persist workflow progress and replay it after a crash; side-effecting steps (activities) are retried at-least-once, so they must be idempotent.
Snapshot-Fork-Merge Execution: Complex reasoning tasks benefit from checkpoint-and-branch execution models. Snapshots capture full sandbox state; forks create parallel exploration branches; merges reconcile results.
Observable Resource Boundaries: Every resource limit must be measurable, alertable, and enforceable. Silent OOM kills and unbounded CPU usage destroy reproducibility and cost predictability.
Agent Protocol
Triggers
- Agent requests code execution in an untrusted environment
- Workflow requires durable execution guarantees (crash recovery, retries)
- Multi-agent system needs workspace isolation between agents
- Task requires speculative execution via snapshot-fork patterns
- Production deployment mandates resource quota enforcement
Input Context Required
- Execution environment specification (language runtime, dependencies)
- Isolation level requirement (namespace, gVisor, microVM, bare-metal VM)
- Resource budget (CPU cores, memory MB, disk MB, max wall-clock seconds)
- Network policy (deny-all, allow-list, egress-only)
- State persistence requirements (ephemeral, checkpoint interval, full snapshot)
Output Artifact
- Sandbox configuration manifest (JSON/YAML)
- Execution trace with resource utilization metrics
- Snapshot artifacts (filesystem diff, memory state, execution cursor)
- Cleanup confirmation with resource deallocation proof
Response Formats
{
"sandbox_id": "sbx-a1b2c3d4",
"isolation_level": "microvm",
"status": "running",
"resource_allocation": {
"cpu_cores": 2,
"memory_mb": 1024,
"disk_mb": 4096,
"max_wall_clock_s": 300
},
"network_policy": "egress-allow-list",
"allowed_egress": ["pypi.org:443", "files.pythonhosted.org:443"],
"filesystem_mounts": [
{"host": "/data/workspace/agent-7", "guest": "/workspace", "mode": "rw"},
{"host": "/data/shared/models", "guest": "/models", "mode": "ro"}
],
"snapshot": {
"enabled": true,
"interval_s": 60,
"last_snapshot_id": "snap-x9y8z7",
"storage_backend": "s3://snapshots/sbx-a1b2c3d4/"
},
"execution_trace": {
"start_time": "2026-06-04T09:00:00Z",
"elapsed_s": 42.7,
"cpu_seconds_used": 31.2,
"peak_memory_mb": 612,
"disk_written_mb": 87.3
}
}
Decision Matrix
START: Agent requests execution environment
│
├─ Is code trusted and from verified source?
│ ├─ YES → Use lightweight namespace sandbox (cgroup + seccomp)
│ │ ├─ Needs network? → Apply egress-only allow-list policy
│ │ └─ No network → Apply deny-all network policy
│ │
│ └─ NO → Is execution latency-critical (<100ms boot)?
│ ├─ YES → Use gVisor (runsc); systrap platform by default, KVM on bare metal
│ │ └─ Apply read-only rootfs + dropped capabilities
│ │
│ └─ NO → Is maximum isolation required?
│ ├─ YES → Use Firecracker microVM
│ │ ├─ Needs GPU? → Use Kata Containers with GPU passthrough
│ │ └─ No GPU → Standard Firecracker with virtio-net
│ │
│ └─ NO → Use Kata Containers with default runtime
│
├─ Does workflow need crash recovery?
│ ├─
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/durable-execution-frameworks.md
- references/filesystem-sandboxing.md
- references/microvm-isolation.md
- references/network-isolation-policies.md
- references/resource-quota-enforcement.md
- references/sandbox-as-tool-pattern.md
- references/state-persistence-snapshots.md
- references/workspace-isolation.md
FAQ
Что делает скилл sandbox-execution?
Use when the user asks to sandbox agent code, run untrusted code from an LLM, gVisor (runsc), Firecracker microVMs, Kata Containers, durable execution with Temporal, or sandbox snapshot and fork. Produces a sandbox config with isolation level, network and resource limits, plus a durable-execution design. Not for container image hardening (use security-container-security).
Как установить скилл sandbox-execution?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sandbox-execution запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…