The sandbox API you’d use in the cloud,
running on infrastructure you control.
Exec, files, git, terminals and snapshots for the code your agent writes, with quotas and a tamper-evident audit chain. Try it on our hosted beta. Run it on your own hosts. Same API.
Hosted beta: an invite-only, shared evaluation instance with no SLA and best-effort support. It may be upgraded with downtime; do not send production secrets. In production, Sandfort runs self-hosted.
16653 tests collected91 HTTP operationsgates 1–10 passcreate p50 107 ms laptop / 248 ms beta VM, one run each, not an SLOhow measured
Everything one turn of the loop needs.
An agent needs more than one exec call. It stages files, clones a repo, keeps a process alive, reads why a run stopped and starts the next attempt from clean. Each of those is one SDK call.
sbx = client.create_sandbox(snapshot="python:3.12", wait=True) r = sbx.process_exec(argv=["python", "-m", "pytest", "-q"], cwd="/work/app", timeout_s=300) if r.ok: # exit 0, no stop_reason, not timed out, not truncated next_step = "commit" elif r.stop_reason == "timeout": next_step = "tell the model the tests hung" elif r.stop_reason == "output_limit": next_step = "ask for a narrower test run" else: next_step = r.stderr # traceback goes back to the model
sbx = client.create_sandbox(snapshot="python:3.12", wait=True) # has git; the -slim image does not sbx.git.clone("https://github.com/acme/app.git", "/work/app") sbx.fs.upload_file("/work/app/fix.py", patch_bytes) sbx.git.add("/work/app") c = sbx.git.commit("/work/app", "agent: fix failing test") names = [e.name for e in sbx.fs.list_dir("/work/app").entries] # clone and push need outbound network from the sandbox
with sbx.process.start("python -m http.server 8000") as server: print(sbx.preview(8000).url) # show a human what the agent built page = server.logs() # leaving the with block kills the command
snap = client.snapshots.create_from_sandbox(sbx.id, name="deps-installed") # pending until the commit finishes, then ready for attempt in candidate_patches: sbx.reset() # same id and tier, fresh filesystem sbx.fs.upload_file("/work/solution.py", attempt) score = sbx.process_exec(argv=["python", "/work/grade.py"]).exit_code
$ sandfort shell sbx_… /work # ls app /work # exit 3 $ echo $? 3 # the remote exit code
Why a run ended
Every exec result can carry a stop_reason, so the agent tells a hung test from a full output buffer from a sandbox that was reset under it.
| stop_reason | what happened |
|---|---|
| timeout | The command ran past timeout_s (default 60 s, up to 3600 s). |
| output_limit | Output passed the size cap and the command was stopped. |
| sandbox_stopped | The sandbox stopped during the run, for example after a limit overrun on the gvisor or microvm tier. |
| killed | The command was killed. |
| sandbox_deleted | The sandbox was deleted while the command ran. |
| sandbox_reset | The sandbox was reset while the command ran. |
The Python SDK resends 429, 503 and dropped connections on requests that are safe to repeat; create_sandbox(idempotency_key=...) makes a retried create return the first sandbox. Every 409 carries a machine-readable details.reason.
One API. Pick the client.
The REST API and the Python SDK are in every evaluation package. The TypeScript SDK, the CLI and the MCP server are in the repository: sdk/typescript/, cli/ and mcp_server/.
91 HTTP operations on 70 paths in the exported OpenAPI spec. Browse the API reference.
from sandfort_sdk import Client client = Client(base_url=URL, api_key=KEY) sbx = client.create_sandbox(snapshot="python:3.12-slim", wait=True) run = sbx.code_run("python", "print(21 * 2)") print(run.exit_code, run.stdout.strip()) # 0 42 sbx.delete() # sync Client and async AsyncClient
import { SandfortClient } from "@sandfort/sdk"; const client = new SandfortClient({ baseUrl: URL, apiKey: KEY }); const sbx = await client.createSandbox({ snapshot: "python:3.12-slim" }); const run = await sbx.codeRun("python", "print(21 * 2)"); console.log(run.exitCode, run.stdout.trim()); // 0 42 // Node 20 or newer, no runtime dependencies
$ sandfort login --base-url "$URL" --api-key "$KEY" $ sandfort sandbox create first --wait $ sandfort exec first python -c "print(21 * 2)" 42 $ sandfort cp ./hello.txt first:/tmp/hello.txt $ sandfort cmd start first -- sh -c 'sleep 30; echo done' $ sandfort shell first # interactive PTY
{ "mcpServers": { "sandfort": {
"command": "python",
"args": ["sandfort_mcp.py"],
"env": { "SANDFORT_BASE_URL": "<url>", "SANDFORT_API_KEY": "<key>" }
} } }
# tools any MCP client gets:
# create_sandbox run_code run_command create_snapshot
# upload_text_file download_text_file list_sandboxes delete_sandbox$ curl -s "$URL/v1/sandboxes" -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -d '{"snapshot": "python:3.12-slim", "isolation": "gvisor"}' $ curl -s "$URL/v1/sandboxes/$ID/toolbox/process/execute" \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"command": "python3 -c \"print(21 * 2)\""}'
Try it on ours. Run it on yours. Same API.
Start on the hosted beta with nothing to install. Move to your own hosts when it matters. Your agent code stays the same: you change base_url and use a key from your own server.
from sandfort_sdk import Client client = Client(base_url="https://<beta endpoint>", api_key=KEY) sbx = client.create_sandbox(name="first", wait=True) run = sbx.code_run("python", "print(21 * 2)") # everything below the client line is unchanged
| aspect | Hosted beta | Self-hosted |
|---|---|---|
| who runs it | The maintainer | You |
| you install | The SDK: a Python wheel; TypeScript SDK, CLI and MCP server are in the repository | The server, on your Docker host or node |
| code runs | On a shared evaluation VM | On your hosts; code and data stay on your infrastructure |
| isolation | container, gvisor (default), microvm | container by default; gvisor and microvm where installed |
| limits | Rate limits per key; per sandbox at most 4000 millicores, 8192 MiB, 20 GiB | Per-organization quotas you set |
| terms | Invite-only, 2–3 design partners, no SLA, downtime possible, no production secrets; the shared instance is not a benchmark target | Source-available (FSL-1.1-Apache-2.0), version 0.1.0 |
Assume the code is hostile. Choose the boundary per sandbox.
Nobody on your team wrote or reviewed what the model generated. Pick the isolation tier on each create with one field, isolation; GET /v1/isolation lists the tiers a server offers.
Namespaces, cgroups, a seccomp profile and reduced capabilities. Fastest for spawn-heavy and small-file work.
Shares the host kernel. With an egress allowlist on this tier, DNS is a side channel.
A kernel in user space handles system calls, so the host kernel sees a small, filtered surface.
A user-space kernel, not a hardware boundary. Spawn-heavy and small-file work runs about 3× to 9× slower; large writes count toward memory; a limit overrun can stop the whole sandbox.
Each sandbox gets its own guest kernel in a lightweight VM, behind the same Docker driver and the same API.
Needs KVM; a create takes seconds, not milliseconds. On the hosted beta it runs on the evaluation instance’s nested KVM.
- privilege
- All capabilities dropped except seven,
no-new-privileges; host seccomp on the container tier - resources
pids_limit, CPU, memory and disk caps; disk size enforced per sandbox on all three beta tiers- network
- Per sandbox: open, an allowlist through the egress proxy, or
block_networkwith no network and no DNS. The metadata address is blocked. - secrets
SANDFORT_variables never reach a sandbox- docker
- The socket is never mounted into a sandbox
- host
- The
prodenvironment refuses to start on a weakly isolated host
Illustrative transcript on the container tier. The fork bomb fills its own sandbox up to the process limit; reset() clears it. Under gvisor or microvm a limit overrun can stop the whole sandbox instead: exit 137, stop_reason sandbox_stopped, files kept.
We do not claim stronger isolation than VM-based sandbox products. These controls reduce the risk of an escape; they do not remove it.
A sandbox platform your security team can audit.
Audit, access control, quotas and usage ship in the same package, and are written in the same transaction as the state change they describe.
Tamper-evident audit chain
A per-organization hash chain over every mutating call; denied requests are recorded as request.denied. Export it as NDJSON with hashes and verify it over REST with audit:read. sandfort audit verify-head checks an export file against the signed head and exits 3 on a break, so cron or CI can run it. Governance reference.
Tamper-evident, not immutable. Reads are not audited.
Roles and scoped keys
Roles admin, developer, viewer map to scopes. Admins change roles and remove members through PATCH and DELETE on /v1/org/members; the last admin cannot be removed. API keys are stored as salted hashes and shown once; a key cannot grant scopes it does not hold.
Keys limited by label
A key limited to up to 8 label pairs sees only matching sandboxes; everything else answers 404. One key per team or per customer.
Snapshots, volumes, usage and audit stay organization-wide.
OIDC SSO and SCIM
OIDC identity tokens are exchanged for short-lived sessions. SCIM 2.0 provisions users when it is enabled in configuration; it is off by default.
SSO signs in to one configured organization. SCIM covers Users only: no groups, bulk or etag.
Quotas, usage, webhooks
Per-organization quotas, reserved again on start so stop and start cannot bypass the cap. Usage grouped by sandbox or label for chargeback. Signed webhooks with redelivery, https only in prod.
Usage meters allocated resources; it is not billing.
SSO, SCIM and per-organization quotas are self-hosted configuration; the hosted beta uses API keys, and there are no certifications such as SOC 2 or ISO 27001.
From one Docker host to your cluster.
The same package runs as one process on a laptop or as separate api and worker roles on your nodes.
One process, local Dockerone host
A Python process and the Docker daemon. SQLite for development, Postgres for production. The container and gvisor tiers need no KVM.
Per-sandbox disk limits need XFS project quota; Docker Desktop does not enforce them.
A dedicated sandbox nodeone-node kubernetes kit
deploy/k8s/ runs one pod with API, workers and preview proxy on a node labelled for sandboxes. deploy/node-setup.sh prepares Docker storage, gVisor and optional Kata.
Replicas fixed at 1. No published container image yet: build deploy/Dockerfile.
Placement and cross-node routingmulti-node
A node registry places sandboxes; a request that reaches the wrong node is forwarded to the node that owns the sandbox.
Needs jobs mode, a shared database and a private network: the hop is plain HTTP with an HMAC route token. Jobs mode refuses volume mounts and egress allowlists on create and has no reset.
No built-in TLS: terminate it in front of the API. /metrics has no authentication: keep it inside the cluster.
What it does not do yet.
Better you read it here than find it in week two of an evaluation.
- Every tier is a trade-off.
containershares the host kernel;gvisoris not a hardware boundary;microvmneeds KVM and starts in seconds. - Docker socket on sandbox nodes.The server mounts it, and it grants control of the node. Use dedicated nodes.
- A sandbox lives on one node.Multi-node needs jobs mode, a shared database and a private network.
- SSO into one organization; SCIM Users only. There are no SCIM groups, bulk operations or etags.
- No built-in TLS;
/metricsis unauthenticated.Put both behind your own proxy and network policy. - The console and web terminal load their terminal library from a public CDN.Self-host it if nothing may load from outside.
- Version 0.1.0, beta.Releases are git tags
v0.1.0-beta.Nwith signed wheels and a signed checksum file; see how releases are built and verified. Built from October 2026. - No production references and no certifications yet.The design partners are the first users.
Questions we get first.
Doesn’t a hosted beta contradict “the code stays on your hosts”?
The beta is for evaluation only: no production secrets and no sensitive data. In production Sandfort runs self-hosted on your infrastructure, and that stays the default.
Is it open source?
It is source-available under FSL-1.1-Apache-2.0: self-hosting and changes are allowed, running a competing service is not. Each version becomes Apache-2.0 two years after release.
What does it cost?
There are no prices yet. Pilots for a small number of design partners are free; the commercial model is decided after the pilots.
Which languages can the agent run?
code_run takes Python, JavaScript, TypeScript and bash; process_exec runs anything installed in the image. Build images from a declarative spec, cached by spec hash.
How were the numbers on this page measured?
Tests: 16653 collected by pytest --collect-only -q on 2026-11-22; collected, not a pass count. HTTP operations: counted in the exported OpenAPI spec on 2026-11-22, including /healthz and /readyz, excluding the PTY WebSocket, /metrics, the preview proxy and the web terminal. Gates 1–5 ran on real Docker; gates 6–10 ran locally on 2026-11-01 and 2026-11-02; The first fully green CI run was on 2026-11-03.
Latency: examples/benchmark.py, 20 creates waiting for started and 50 short commands in one sandbox, alpine:3.20 pre-pulled. Laptop, 2026-11-01, macOS arm64, Docker 29.8.2: create p50 107 ms (p95 145), exec p50 18 ms (p95 25). Linux, 2026-11-03, a 6-vCPU KubeVirt VM on a shared Hetzner host with nested virtualization, Ubuntu 24.04, Docker 29.9.2: create p50 248 ms (p95 323), exec p50 52 ms (p95 60); isolation tier of that run not recorded. One run per host; not an SLO. Run the script on your own host.
Looking for 2–3 design partners.
Tell us what your agent runs and where it has to run. We reply by email.
Teams building AI coding agents
Your agent needs exec, files, git and a terminal. Your customers need the code to stay on your side.
Platform and DevEx teams
You answer to security and compliance and need auditable, multi-tenant execution in your own cluster.
What the pilot looks like
- Runs on the hosted beta or on your infrastructure. Same API and SDK on both.
- On the beta you get an https endpoint, a key through a one-time secret link and the Python SDK wheel.
- Free for the pilot. The commercial model is decided after the pilots.
- In return: feedback sessions and the right to name you as a reference.
- Best-effort support, directly with the maintainer. No SLA.