Skip to content

Modal Sandboxes & Software Factory

Toolkit for provisioning, managing, and snapshotting isolated cloud execution environments on Modal with OpenSSH, Cloudflare Tunnel ingress, and integrated AI developer tooling.


Architecture Overview

flowchart TD
    subgraph Client["Control Surfaces"]
        CLI["modal-sandbox CLI"]
        WebUI["Web Dashboard & REST API<br/>(sandbox/function.py)"]
    end

    subgraph ModalCloud["Modal Cloud Infrastructure"]
        Runner["Unified Sandbox Runner<br/>(sandbox/launcher.py)"]

        subgraph Sandbox["Modal Sandbox Environment"]
            direction TB
            Runtime["Runtime: Standard Container or Linux VM (Docker)"]
            Workspace["Workspace (/root/<name>)<br/>Git Repository & Python Virtual Environment"]

            subgraph Services["Network Ingress & Services"]
                SSH["OpenSSH Server (Port 2222)"]
                Tunnel["Cloudflare Ingress (Port 3000)"]
                AgentTools["AI Dev Tooling:<br/>T3 Code (3775), OpenCode (4096),<br/>Antigravity Daemon, Herdr, Pi Agent"]
            end
        end

        Volume["Persistent Modal Volumes<br/>(t3code-usage-v1, Gradle Caches)"]
        Snapshots["Filesystem Snapshots<br/>(modal.Image Copy-on-Write)"]
    end

    CLI --> Runner
    WebUI --> Runner
    Runner --> Sandbox
    Sandbox -.-> Volume
    Sandbox -.-> Snapshots

Key Capabilities

  • Zero-Config Standalone Sandboxes: Launch disposable cloud development instances in seconds with modal-sandbox --name <sandbox-name>, requiring only a standard Modal account.
  • Dual Runtimes: Choose between lightweight standard container sandboxes and full Linux VM sandboxes (--vm) equipped with Docker-in-Docker and custom kernel privileges.
  • Hermetic Ingress: Automatic Cloudflare Tunnel provisioned on port 3000 alongside OpenSSH on port 2222 with zero-friction SSH config registration (ssh <sandbox-name>).
  • Filesystem Snapshotting: Instant copy-on-write image capture (modal-sandbox --snapshot <id>) and resumption (modal-sandbox --from-snapshot <image-id>).
  • Integrated AI Developer Tooling: Turnkey provisioning for T3 Code, Antigravity ACP, OpenCode Go, Pi Agent, Herdr, and Playwright-ready headless Chrome.
  • Serverless Web Control Plane: Deploy a lightweight FastAPI control plane on Modal (modal deploy sandbox/function.py) providing a unified web dashboard and REST API.

Quick Navigation