mattpocock/sandcastle

Orchestrate sandboxed coding agents in TypeScript with sandcastle.run()

What it solves

Sandcastle solves the problem of safely running AI coding agents by providing a structured way to isolate their actions in secure, temporary environments. It prevents agents from making uncontrolled changes to your main codebase by managing sandboxes and branching strategies automatically.

How it works

You use the sandcastle.run() command to trigger an agent. The library creates an isolated sandbox, executes the agent's tasks, and manages a branching strategy where the agent's work is committed to a separate branch. Once the task is complete, Sandcastle handles merging those changes back into your project.

Who it’s for

It is designed for developers building AI coding agents who need a reliable, provider-agnostic way to orchestrate tasks, run parallel agents, or build automated code review pipelines.

Highlights

  • Provider-agnostic design supporting local OS sandboxes (Bubblewrap, Seatbelt), Docker, Podman, and various cloud providers like E2B, Modal, and Fly.io.
  • Built-in branching strategies to keep agent work separate from main code.
  • Supports parallel execution for multiple agents.
  • Includes tools for structured output, run logging, and lifecycle hooks.

Related

  • Project
  • Project
  • Project
  • Project
  • Project