Configs2026年6月2日·1 分钟阅读

Sandcastle — Orchestrate Sandboxed Coding Agents in TypeScript

A TypeScript library for running coding agents in isolated sandboxes with a simple sandcastle.run() API, handling environment setup, execution, and cleanup automatically.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Sandcastle Overview
直接安装命令
npx -y tokrepo@latest install e84b35b7-5e7d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Sandcastle provides a clean TypeScript API for spawning coding agents in isolated sandboxes. Each sandcastle.run() call creates a fresh environment, executes the agent task, and returns structured output. It handles the complexity of containerization, filesystem isolation, and resource limits so developers can focus on orchestration logic.

What Sandcastle Does

  • Runs coding agents in isolated containers with a single function call
  • Manages environment provisioning, execution, and teardown automatically
  • Provides structured output including generated code, test results, and logs
  • Supports parallel execution of multiple sandboxed agents
  • Enforces resource limits (CPU, memory, network, time) per sandbox

Architecture Overview

Sandcastle uses a TypeScript orchestrator that communicates with a local container runtime (Docker or compatible). Each sandcastle.run() call provisions a minimal container with the requested language toolchain, mounts the task context, invokes the agent, and streams output. The orchestrator manages a pool of warm containers for fast startup. Results are returned as typed TypeScript objects with code, stdout, stderr, and exit status.

Self-Hosting & Configuration

  • Requires Node.js 18+ and Docker installed locally
  • Configure default resource limits in sandcastle.config.ts
  • Pre-built container images available for Python, TypeScript, Go, and Rust
  • Custom images can be specified per task for specialized toolchains
  • No cloud services required; everything runs on your machine

Key Features

  • One-function API: sandcastle.run() handles the entire lifecycle
  • Type-safe TypeScript SDK with full IntelliSense support
  • Warm container pool for sub-second sandbox startup
  • Parallel execution with configurable concurrency limits
  • Built-in timeout and resource enforcement per sandbox

Comparison with Similar Tools

  • E2B — cloud-hosted sandboxes with per-minute billing; Sandcastle is local and free
  • microsandbox — microVM-based; Sandcastle uses containers for faster startup
  • Docker SDK — low-level container API; Sandcastle provides agent-specific abstractions
  • Daytona — full dev environments; Sandcastle is lightweight, single-task focused

FAQ

Q: How fast is sandbox startup? A: With warm containers, startup is under 500ms. Cold starts take 2-3 seconds depending on the base image size.

Q: Can agents access the network? A: Network access is disabled by default. You can opt in per task with network: true in the run configuration.

Q: What happens if an agent hangs? A: Each sandbox has a configurable timeout (default 60 seconds). Exceeding it terminates the container and returns a timeout error.

Q: Can I run multiple agents in parallel? A: Yes, Sandcastle supports concurrent execution. Set concurrency in the config to control how many sandboxes run simultaneously.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产