Run the Sleigh server on a single high-resource machine, then let multiple Agents use the Sleigh client to get sandboxes with strong filesystem state and elastic memory expansion.
Sleigh is for teams that want cloud-sandbox-like capabilities but already have a high-resource local server, want to avoid cloud lock-in, or need to keep data in-network.
- Session-level sandbox isolation
- Elastic controls for resource-volatile workloads
- Command execution (async + sync wait)
- Snapshot and rollback
- Strong filesystem state for long-running tasks
- Read/write APIs for AI coding loops
- Read-only host-path mount for safe dataset/code reuse
- Environment-zone directory copy for fast runtime bootstrap
- Memory pressure observation and expansion controls
- OTEL observability support
Sleigh is open-source and self-hosted. It runs on your own infrastructure.
Good fit:
- Individuals or small teams with an existing Linux server
- Teams needing long-running, high-resource, or stateful Agent execution
- Teams wanting more predictable cost on owned hardware
Probably not a fit:
- You only want fully managed SaaS and do not want to run server components
- Your workload is lightweight and cloud sandbox costs are negligible
| Dimension | Sleigh (self-hosted) | Typical cloud sandbox |
|---|---|---|
| Deployment | Your own server | Vendor-managed |
| Lock-in risk | Lower (open source) | Usually higher |
| Product usage fee | No fee | Usually usage-based |
| Control | Full control | Constrained by platform |
- Linux host
systemdavailable- Docker installed and running
git,bash, and network access for dependencies/images
git clone git@github.com:Patheia0122/Sleigh.git
cd Sleigh
./install_server.shThe installer builds the server binary and starts sleigh.service.
sudo systemctl status sleigh.service
curl -sS http://127.0.0.1:10122/healthzpip install sleigh-sdk- Create session token:
TOKEN=$(curl -sS -X POST http://127.0.0.1:10122/sessions/token | python3 -c "import sys,json;print(json.load(sys.stdin)['session_token'])")- Create sandbox:
SANDBOX_ID=$(curl -sS -X POST http://127.0.0.1:10122/sandboxes \
-H "Content-Type: application/json" \
-d "{\"session_token\":\"$TOKEN\",\"image\":\"python:3.11-slim\"}" \
| python3 -c "import sys,json;print(json.load(sys.stdin)['sandbox_id'])")- Execute command:
curl -sS -X POST "http://127.0.0.1:10122/sandboxes/$SANDBOX_ID/exec" \
-H "Content-Type: application/json" \
-d "{\"session_token\":\"$TOKEN\",\"command\":\"python -V\",\"wait\":true}"from sleigh_sdk import SleighClient
client = SleighClient(base_url="http://127.0.0.1:10122")
token = client.create_session_token()["session_token"]
sandbox_id = client.create_sandbox(session_token=token, image="python:3.11-slim")["sandbox_id"]
result = client.exec_command(
session_token=token,
sandbox_id=sandbox_id,
command="python -V",
wait=True,
)
print(result)- Run coding Agent tasks in isolated containers
- Add checkpoint/rollback for long Agent workflows
- Serve multiple Agents from one local high-resource server
- Keep sensitive workloads inside your own network boundary
- Run memory-heavy tasks (for example, metagenomic alignment in computational biology, where a single task may consume hundreds of GBs or even 1TB of memory)
- Mount large reference datasets as read-only into multiple sandboxes to avoid accidental host data mutation
- Copy prebuilt toolchain/environment templates from environment zone into sandbox to shorten cold start
Core control-plane endpoints exposed by the Sleigh server.
POST /sessions/token: issue session tokenPOST /sandboxes: create sandboxGET /sandboxes: list session sandboxesPOST /sandboxes/{id}/exec: execute commandPOST /webhooks/exec/subscribe: subscribe exec completion webhook callbackPOST /workflow/run: ordered multi-step workflow executionPOST /sandboxes/{id}/snapshots: create snapshotPOST /sandboxes/{id}/rollback: rollback snapshotPOST /sandboxes/{id}/ops/read: read operation (allowlisted commands)POST /sandboxes/{id}/ops/code/write: AI coding endpoint with formatting/lint checks and optional build verificationPOST /sandboxes/{id}/environment/copy: copy environment-zone directory into sandbox
- Server runs on host machine (
systemd) - Sandboxes run in Docker containers
- Protected endpoints require
session_token
pip install sleigh-sdk
pip install "sleigh-sdk[langchain]"
pip install "sleigh-sdk[mcp]"Sleigh SDK is designed to expose runtime capabilities directly as a LangChain Tool for Agents. That means Agents do not need to orchestrate raw HTTP calls manually. They can use one unified tool interface for sandbox lifecycle, command execution, read/write coding, and workflows.
Benefits:
- Tool semantics cover core operations (create/exec/read/write/rollback/workflow)
- Parameter validation before dispatch reduces Agent ambiguity
- Agent-friendly action design (including explicit code_write actions)
- MCP adapter is available when your platform prefers MCP transport
Minimal LangChain Tool example:
from sleigh_sdk import SleighLangChainClient
client = SleighLangChainClient(base_url="http://127.0.0.1:10122")
tool = client.as_langchain_tool()
# Inject `tool` into your Agent tool list.More complete Agent-friendly example:
examples/langchain_sleigh_runtime_tool.py
build_languagein code_write is optional; if the server lacks the required image, it will pull first and increase latency.- Exec webhook callbacks are HMAC signed (
X-Timestamp,X-Signature) with server-sideWEBHOOK_HMAC_SECRET. JSON body is{"status":"ok|err|timeout","payload":{...}}wherepayloadincludesexec_id,sandbox_id,exec_status,command, timestamps, and optionalexit_code/error. Longcommand/errorstrings are truncated (tail kept). - You can pass
webhook_urlonPOST /sandboxes/{id}/execto subscribe in one shot (no separateexec_idround-trip), or usePOST /webhooks/exec/subscribeafterexecreturns. - Mount mode is read-only (
ro) by design. - Environment copy is guarded by allowlisted root boundaries.
- Mount and environment-copy host source paths must already exist on the server; missing paths return
404(no auto-create on the host — Docker bind mounts would otherwise create empty dirs). GET /mounts/workspacesvsGET /environments/workspacesresponses includezone_kind,agent_guidance, and expandedsuggested_next_actionsso Agents use mount_path after the mount list and copy_environment after the environment list (not the other way around).- Requires Linux host
- Currently Docker runtime only
- Sandboxes share host kernel
- Full API reference:
docs/api_reference.md - SDK docs:
sdks/python_sdk/README.md - LangChain example:
examples/langchain_sleigh_runtime_tool.py - MCP stdio example:
examples/mcp_sleigh_runtime_server.py
