Sandfort / Migration guide

Migrating from Runloop to Sandfort

Runloop’s documentation says "Runloop is winding down its services" and that transition support for existing customers continues through November 13, 2026 at 11:59 PM PT. Runloop’s own transition page lists guides for four other platforms (the OpenAI Agents API, Tensorlake, Modal and Freestyle) and describes them as preliminary. Sandfort is not one of them.

Published: 2026-11-25Sandfort 0.1.0sandfort-sdk 0.1.0b83

This guide is for teams that ran an agent loop against Runloop devboxes and want to evaluate Sandfort as a place to run the same kind of workload. It does three things. It maps Runloop concepts to Sandfort concepts, citing Runloop’s documentation for each Runloop term (see Sources) and the repository for each Sandfort term. It gives a working Python example against the real SDK. It lists the differences you should know before you decide.

It is a concept map and not a tested migration. Runloop’s SDK, your agent code and your images are yours to port. This guide does not describe an automatic import path, and none exists in the Sandfort repository.

Sandfort is a self-hosted sandbox server for running AI-generated code: a REST API, a Python SDK and a CLI over isolated Docker-backed sandboxes. It is pre-1.0 (version 0.1.0, released as v0.1.0-beta.N tags) and source-available.

Concept map

Runloop terms are taken from Runloop’s public documentation (URLs and check dates in the Sources section). Sandfort terms are taken from the code in sdk/python/src/sandfort_sdk/, cli/src/sandfort_cli/, README.md and docs/ in the repository.

RunloopSandfortWhat to know
DevboxSandbox. In the Docker driver it is a container named sf-<sbx_id>. Create with client.create_sandbox(...), delete with sbx.delete()Runloop describes devboxes as isolated with virtual machine technology. A Sandfort sandbox is a container, with gvisor and microvm (Kata Containers) as optional tiers. See What is different.
devbox.shutdown()sbx.delete() or client.delete(sandbox_id). Using the Sandbox handle in a with block deletes it on exit
devbox.suspend() / resume() (disk state kept, in-memory state not, processes must be restarted)sbx.stop() / sbx.start(wait=True). A stopped sandbox keeps its files. A command running at stop time is cut short and reports sandbox_stopped with exit code 137Both models keep files and drop running processes. Sandfort keeps the same sandbox id.
keep_alive_time_seconds (fixed maximum lifetime, default 1 hour) and lifecycle.after_idleauto_stop_minutes (default 15, measured from the last activity, a negative value means never) and auto_delete_minutes (default -1, applies to stopped sandboxes)Sandfort has no fixed maximum lifetime. Auto-stop is an idle timer. Units are minutes, not seconds.
devbox.cmd.execsbx.process_exec(argv=[...]) or sbx.process_exec("shell string"). Returns exit_code, stdout, stderr, timed_out and truncated. sbx.code_run("python", code) runs codeprocess_exec takes cwd, env, timeout_s and stdin.
Execution logsAsync commands in a session with run_async=True, then sbx.process.follow_logs(session_id, command_id) (SSE) or get_command_logs
Named shells (keep working directory and exported variables, reattach by name)Sessions: sbx.process.create_session(cwd=..., env=...) and execute_session_command(session.id, "cd src")Shell state such as cd persists between calls. Sessions are addressed by the id that create_session returns, not by a name.
devbox.file.write / upload / read / downloadsbx.fs.upload_file(path, data), sbx.fs.read_bytes(path), sbx.fs.download_file(path) (streamed), download_dir (tar), plus list_dir, stat, mkdir, move, deleteNo chmod, search, find or replace in the filesystem API. Use process_exec for those.
Code mounts (a repository on the devbox)sbx.git.clone(url, path, credential=...), then status, add, commit, push, pullCredentials go through a temporary askpass helper that is removed afterwards. No branch or checkout operations in the git API. Use process_exec.
Blueprint (template image, from a Dockerfile)Image spec. In Python, Image.debian_slim() or Image.from_image(ref) with pip_install, apt_install, add_file, env and workdir, built with client.snapshots.build(spec, name=...). A public registry image is registered with client.snapshots.register(ref)The builder takes a declarative spec. The SDK documents no Dockerfile input. Builds are cached by spec_hash and have an SSE build log.
Devbox snapshot (disk state, start new devboxes from it)Snapshot. client.snapshots.create_from_sandbox(sandbox_id, name, wait=True) commits a running sandbox. New sandboxes start from it with create_sandbox(snapshot=name_or_id)The state is pending until the commit finishes, then ready. A ready snapshot can be exported as a docker save tar with client.export_snapshot(...).
Tunnel (https://{port}-{key}.tunnel.runloop.ai, open or authenticated, one per devbox)Preview URL. sbx.preview(port, ttl_seconds=...) returns url, token, port and expires_at. CLI: sandfort previewPreview goes through the Sandfort proxy. Runloop tunnel auth modes do not map one to one. Check the preview token model before you expose a service.
SSH (rli devbox ssh)No SSH. Interactive access is a PTY: sbx.pty.create() in the SDK, sandfort shell in the CLI, and a web terminalThe feature map has no SSH endpoint, so tools that need an SSH hostname (editors, scp, port forwarding) do not carry over.
Network policies (allowed_hostnames, can be updated while devboxes run)Per-sandbox egress_allowlist at create, block_network=True, and client.set_egress_allowlist(sandbox_id, entries) to replace the list laterSee Egress. It is a proxy-based allowlist, not a firewall.
Storage objects and mountsNamed volumes: client.volumes.create(name), mounted at create with VolumeMount(volume_id, "/data", read_only=...)Volumes are the nearest concept, not an equivalent of storage objects.
Axons, BenchmarksNo counterpart in the Sandfort feature mapRunloop’s Tensorlake transition guide says there is no like-for-like substitute for Axons and that the Benchmark product has been discontinued. Plan that work outside Sandfort.

Quickstart

You need a Sandfort server and an API key. To run your own server on a Docker host, follow the Quickstart in the repository README.md (Python 3.12, a local Docker daemon, sandfort.admin_cli bootstrap prints the sf_ key once). To evaluate without installing a server, see Where to start.

Install the Python SDK from PyPI (current release 0.1.0b83). It requires Python 3.12 or newer:

bash
pip install --pre sandfort-sdk

Create a client, run a command, delete the sandbox. This is the example from the repository README.md:

python
from sandfort_sdk import Client

client = Client(base_url="http://127.0.0.1:8000", api_key="sf_...")

sbx = client.create_sandbox(name="hello", snapshot="python:3.12-slim", wait=True)
result = sbx.process_exec(argv=["python3", "-c", "print(21 * 2)"])
print(result.exit_code, result.stdout.strip())  # 0 42
client.stop(sbx.id)
client.delete(sbx.id)

The same shape as a Runloop agent loop

This second example uses the pieces from the concept map: an image spec in place of a blueprint, a snapshot name in place of a blueprint name, a session in place of a named shell, file upload, and a preview URL. Every call below exists in sdk/python/src/sandfort_sdk/, and the example runs end to end against a local server with a real Docker daemon.

python
import os

from sandfort_sdk import Client, Image

client = Client(base_url=os.environ["SANDFORT_URL"], api_key=os.environ["SANDFORT_API_KEY"])

# Blueprint equivalent: a declarative image spec, built once and cached by spec_hash.
spec = Image.debian_slim().pip_install("pytest").apt_install("git")
snap = client.snapshots.build(spec, name="agent-base")
if snap.state != "ready":
    with client.snapshots.follow_build_logs(snap.id) as logs:
        for event in logs:
            if event.is_final and not event.succeeded:
                raise RuntimeError(event.reason)

# Devbox equivalent. Leaving the with block deletes the sandbox.
with client.create_sandbox(
    name="work",
    snapshot="agent-base",
    labels={"purpose": "migration-test"},
    auto_stop_minutes=30,
    wait=True,
) as sbx:
    sbx.fs.upload_file("/tmp/test_math.py", b"def test_add():\n    assert 1 + 1 == 2\n")

    # Named shell equivalent: a session keeps its working directory between calls.
    session = sbx.process.create_session(cwd="/tmp")
    sbx.process.execute_session_command(session.id, "python3 -m pytest -q test_math.py")

    # One-off command with a result.
    result = sbx.process_exec(argv=["python3", "--version"])
    print(result.exit_code, result.stdout.strip())

    # Tunnel equivalent: a preview URL for a port inside the sandbox.
    preview = sbx.preview(8000, ttl_seconds=600)
    print(preview.url, preview.expires_at)

Egress

Runloop network policies restrict outbound traffic to a list of hostnames and can be updated while devboxes run. Sandfort has a per-sandbox allowlist whose entries are hostnames, leading-dot domains (.example.com admits the domain and its subdomains) and CIDR ranges. You set it at create and can replace it later:

python
sbx = client.create_sandbox(name="locked", egress_allowlist=["pypi.org"], wait=True)
client.set_egress_allowlist(sbx.id, ["pypi.org", "files.pythonhosted.org"])

Read these conditions before you rely on it:

  • Replacement is one PATCH to /v1/sandboxes/{id}. The server stores the list at once and the egress proxy picks it up within its cache window, so the change takes effect after that delay. [] blocks every connection.
  • A CIDR entry must be written as a canonical network address, with a prefix of at least /8 for IPv4 or /32 for IPv6, and must be entirely global address space. Loopback, private, shared, link-local, multicast, reserved, documentation and translation ranges are refused. A target given as an IP literal passes only through a CIDR rule.
  • It works only on a sandbox created with a non-empty allowlist. A sandbox created without one or with [] cannot gain one, and an older sandbox needs a reset first. Otherwise the call raises InvalidState. An operator policy can also refuse it with Forbidden.
  • The allowlist is enforced by a CONNECT proxy. Software that ignores the proxy variables gets no network. The operator must run the egress proxy (python -m sandfort.egress.proxy), and a create with an allowlist is refused without it. Allowed ports default to 443 and 80 (SANDFORT_EGRESS_ALLOWED_PORTS). On the container tier DNS is a side channel, unless the operator sets up the DNS sink (SANDFORT_EGRESS_DNS_SINK_ADDRESS and SANDFORT_EGRESS_DNS_SINK_LISTEN, see docs/operations.md), which answers every query from those sandboxes REFUSED. It is not a firewall.
  • In jobs mode (which multi-node deployments require) allowlisted creates work and are placed only on nodes that run the egress stack; sandbox reset is unavailable there, so the egress token is never refreshed and a sandbox that outlives the token’s lifetime loses egress.
  • set_egress_allowlist is in sandfort-sdk 0.1.0b83 on PyPI. The call is one PATCH to /v1/sandboxes/{id}, so the server you run must include that route. The CLI equivalents are sandfort sandbox egress set <id> and sandfort sandbox egress show <id>.

What is different

These are the points that change a decision. Several of them are limits and they are stated here on purpose.

Production is self-hosted. Sandfort runs on hosts you operate: one Python process and SQLite for a laptop, Postgres and a Kubernetes kit for a cluster. The hosted instance is an invite-only beta for evaluation and design partners. It is shared, runs on modest hardware, has no SLA, must not hold production secrets or sensitive data, and may be upgraded with downtime. It is not a managed service. If you used Runloop as a hosted service, the equivalent Sandfort step is running the server yourself.

Isolation is container-based by default. Runloop’s documentation describes devboxes as isolated with virtual machine technology. Sandfort offers three tiers per sandbox. container (runc) shares the host kernel. gvisor (runsc) puts a user-space kernel between the sandbox and the host, which is not a hardware boundary, and it carries an overhead on spawn-heavy and small-file-heavy work, measured in docs/isolation-tiers.md. microvm (Kata Containers) gives each sandbox its own guest kernel and needs KVM. A deployment offers only container unless the operator maps the other tiers to runtimes. The Firecracker driver in the repository is a skeleton tested against a mock agent and is not offered. If your threat model requires microVM isolation in production, Sandfort is not a fit today.

Stop and start keep files, not processes. This matches what Runloop documents for suspend and resume. A stopped Sandfort sandbox keeps its files and the same id, and a command running at stop time is cut short. A sandbox can also stop because it hit a memory or process limit, and then stop_cause and the command’s stop_reason tell you why. Code contexts (persistent Python kernels) lose their state on stop, reset and delete.

A sandbox lives on one node. Multi-node placement exists, but there is no rescheduling and no live migration. Multi-node needs jobs mode, which refuses creates that mount volumes and has no sandbox reset.

Docker socket. Server processes on sandbox nodes mount /var/run/docker.sock, which gives control of the node. Use dedicated nodes. The socket is never mounted into a sandbox.

The TypeScript SDK is a subset. The Python SDK is the complete client. The TypeScript SDK (@sandfort/sdk, ESM only, Node 20.3 or newer) has no jobs, org quota, members, SSO or SCIM client. There are no SDKs for other languages. Use the REST API for those. The exported OpenAPI spec (openapi/sandfort.v1.json) leaves out the PTY WebSocket, /v1/nodes and the SCIM routes.

Toolbox scope. Filesystem: no chmod, search, find or replace. Git: no branch or checkout. Use process_exec for those. No SSH.

Pre-1.0, no production references. Version 0.1.0, built October to November 2026, no certifications (no SOC 2, no ISO 27001) and no production references.

License. The server is FSL-1.1-Apache-2.0. Self-hosting, internal use and modification are permitted. Making the software available as a competing commercial product or service is not. Each version converts to Apache-2.0 two years after it is made available. It is source-available, not open source, until it converts. The Python SDK, the TypeScript SDK and the CLI are Apache-2.0.

Governance is part of the same package. If your reason for moving is control over who ran what, Sandfort writes a per-org hash-chained audit log, with audit-verify and audit-export admin commands. The chain is tamper-evident, not immutable. Without SANDFORT_AUDIT_CHAIN_KEY it is an unkeyed hash that anyone who can write the database can recompute, so set the key for any deployment where that matters. API keys start with sf_, carry scopes, and the plaintext is shown once.

Where to start

  • Repository README.md. The server Quickstart, the feature table and the Limits section. Read Limits first.
  • Docs. The API reference, the quickstart and the isolation tiers page are at https://docs.sandfort.dev/.
  • Hosted evaluation instance. If you want to try the API before you install anything, write to office@sandfort.dev. Access is invite-only, best effort, with no SLA. Terms are in docs/beta-terms.md. When you move to your own hosts, the agent code stays the same and only base_url in Client changes.

Sources

Runloop facts come from Runloop’s public documentation. Pages marked 2026-11-25 were re-read on that date. The others were checked on 2026-11-24. Runloop may change or remove these pages, so re-read them before you rely on them.