SPAWNBOX

◐ Runs today on a plain sandbox · template coming

Give your agent a whole desktop.Watch it work from your browser.

Add a desktop to the agent's template. The agent clicks, types and takes screenshots. You watch the same screen in your browser through a private link. You can build this today from a plain sandbox. A ready-made desktop template and a guide are coming.

The desktop in this example

  • Debian
  • Xfce
  • Xvfb
  • noVNC
  • xdotool
YOUR AGENTSANDBOXDISPLAY=:1SPAWNBOX APIKEYS · SITE RULESYOUR SERVERTEMPLATECOMING
FIG. 06 · ONE REQUEST, THERE AND BACK
0102

Follow one request.

Each step shows the call, the reply and the lines it adds to the activity log. You can read the whole log withGET /v1/sandboxes/$S/events.

Every step except the last one uses features that work today. The last step, marked PLANNED, is the tested, ready-made template and guide that are coming.

  1. SPAWNBOX API

    Make a template with a desktop

    A virtual screen, a small desktop, a VNC server, a web viewer for VNC, and tools to click and take screenshots. Wait until the build is ready before the next step.

    REQUEST
    POST /v1/templates
    
    {"name": "desktop",
     "setup": ["apt-get update && apt-get install -y xvfb xfce4 x11vnc novnc websockify xdotool imagemagick"],
     "resources": {"vcpus": 2, "memory_mib": 4096}}
  2. SPAWNBOX API

    Start the desktop as services

    Spawnbox keeps each part running. The web viewer is private: only a request with your API key or a session token can open it.

    REQUEST
    POST /v1/sandboxes
    
    {"template": "desktop", "services": [
      {"name": "screen", "command": ["sh", "-c",
        "Xvfb :1 -screen 0 1280x800x24 & DISPLAY=:1 startxfce4"]},
      {"name": "vnc", "command": ["x11vnc", "-display", ":1",
        "-forever", "-shared", "-rfbport", "5900"]},
      {"name": "viewer", "command": ["websockify", "--web",
        "/usr/share/novnc", "6080", "localhost:5900"],
       "port": 6080, "access": "private",
       "health": {"tcp": true}}]}
    • service.startedscreen
    • service.startedvnc
    • service.startedviewer
  3. IN THE SANDBOX

    The agent clicks and looks

    Each action is one command on the desktop. A screenshot goes to a file that your app reads and sends to the model.

    REQUEST
    POST /v1/sandboxes/$S/exec
    
    {"cmd": "xdotool mousemove 640 400 click 1 && import -window root s.png",
     "env": {"DISPLAY": ":1"}}
    • exec.startedxdotool mousemove …
    • exec.finishedexit 0
  4. YOUR APP

    You watch it live

    Make a short-lived session token for this sandbox, and open the private viewer link with it. The token works for 15 minutes at most. It opens only the viewer port of this sandbox, and no other API calls.

    REQUEST
    POST /v1/sandboxes/$S/session-tokens
    
    {"ttl_s": 900, "audience": "preview", "port": 6080}
    OPEN
    <viewer url>/vnc.html?spawnbox_session=<token>
    • sandbox.session_token_created
  5. SPAWNBOX APIPLANNED

    Coming: a ready-made desktop template

    A tested desktop template with a browser and a web viewer, and a step-by-step guide.

0202

Good to know.