Skip to content

Use with any LLM

This page is for builders of agents and LLM apps who want the code of the model to run in a sandbox. boxfork has no model of its own and never calls one: your app keeps the model, and boxfork gives it a sandbox. Find the row for your model or app, then open its tab.

Modelany APITool kityour loopsandbox$ python3 primes.pysandbox_execrun itexit 0: 9592
The model asks for a tool. The tool kit runs it in a sandbox. The result goes back as the next message. The same tools work with MCP, with tool calls, and with plain code blocks.
Your model or app How it gets a sandbox What boxfork gives
An agent app that speaks MCP, for example Claude Code, Codex or Cursor The app starts boxfork mcp Ten tools over MCP
A model API with tool calls: OpenAI-compatible APIs such as GLM and DeepSeek, Claude, Gemini Your loop sends the tools, and runs each tool call Toolkit.tools() and Toolkit.run_tool_call()
A model without tool calls The model writes code blocks in its text Toolkit.run_code_blocks()

Add the MCP server to the agent app. In Claude Code, use this command:

Terminal window
claude mcp add boxfork -- boxfork mcp

Other MCP clients use the same command, boxfork mcp. The agent gets a sandbox of its own on its first call, so it needs no setup. When the agent disconnects, boxfork mcp removes the sandboxes that the agent started, unless you start it with --keep.

Repeated episodes. To try a task many times from the same start, the agent calls sandbox_snapshot once and keeps the snapshot_id. Before each try, it calls sandbox_reset with that ID:

{"snapshot_id": "snap_d7k2m5xq4w6zr3pa"}

The sandbox gets the files of the snapshot back and keeps its ID, so the agent does not have to find a new sandbox.

Tool What it does
sandbox_create Create a sandbox.
sandbox_exec Run a command and return the output and the exit code.
sandbox_read_file Read a file.
sandbox_write_file Write a file.
sandbox_snapshot Save the files of a sandbox.
sandbox_fork Make copies of a sandbox.
sandbox_reset Put a sandbox back to the files of a snapshot, under the same ID.
sandbox_list List the sandboxes.
sandbox_kill Remove a sandbox.
gpu_list List the GPUs and who has them.

The MCP and tools reference gives each field.

On 5 December 2026, the model z-ai/glm-5.4 did a task through OpenRouter, on a daemon with Podman on a Mac. It wrote /work/primes.py, ran it, forked its sandbox into 2 copies, ran a command in each copy, and killed both copies. The answer was correct: there are 9592 primes below 100000. The ten requests cost USD 0.015. The tutorial gives each tool call.

Two rules decide how long a sandbox lives and what an agent can touch:

  • A sandbox lives while the agent uses it. The session moves the timeout of a sandbox later at each use.
  • One API key opens all sandboxes. So an agent can see and kill the sandboxes of other agents. When it must not touch them, give it a daemon of its own.