Allow and deny hosts for one sandbox; the rules go with it. Hosts are checked as the sbx CLI checks them, before anything is sent.
Global policy
Rules, checks of a host against the policy, the activity log, profiles.
Secrets
Custom secrets and credentials of services, pushed to one sandbox and injected by its proxy; the credentials the daemon withholds, named at creation and on each push.
Proxied keys
An API key of the program, written by the proxy in place of the placeholder the sandbox holds, in the requests to its hosts only, whatever the daemon authorizes; its value never comes back to Python. The sandbox can still use it, through the placeholder, while it lives.
SandboxSpec holds all a sandbox receives but its name and the values of its keys: its kit and mixins, workspace and mounts, host and HTTP rules, API keys, MCP servers, variables and resources; its JSON form serves a program in another language.
Checks
The spec checked against the rules of a launch and the kit policy of the daemon, and its keys against their values, before anything is created.
Launch
One call forges the kit, creates the sandbox, applies its rules, pushes its keys and starts it; the Lease it returns owns the sandbox until it is shut down, and its Report says what the launch did, never the value of a key.
List, inspect, pull with progress, load, export to a file or as a stream of chunks (export_stream), remove.
Events and prompts
The event stream and the approval prompts, as typed async streams.
SSH
A byte tunnel to the SSH server of a sandbox, and fastsandbox ssh-proxy for the SSH client of the system.
MCP gateway
The gateway mode, the gateway of a sandbox, servers loaded and unloaded.
Daemon
Health, settings, log levels, disk usage, diagnostics, the resources of a sandbox.
Kits
Kits named as sbx create names them; packages forged without the sbx CLI, or compiled by it when asked, and kept in memory or in a directory, reused while they suit the daemon and made again when a mixin changes; mixins forged over a compiled or saved package (KitForge.forge_over, forge_over_base); packages assembled by hand, a creation request and its images held in memory (KitPackage.in_memory); mixins read from their directories or written in Python, MCP servers of three kinds for claude, copilot and opencode included, their arguments checked; kits added to a running sandbox.
Errors
One hierarchy under SandboxError, a class per kind of failure, typed attributes.
@app.task states the kit, the network rules, the deadline ("10m"), the environment, the CPUs and the memory of the sandbox of each run, which is launched from the spec they describe.
Validation
The parameters are the inputs, validated before the sandbox is created; the return annotation validates the result.
Host paths
A directory of the host as the workspace, a private Git clone of it, more mounts, or a copy of its contents.
Injection
Context, Sandbox, Client and AgentRunner by annotation; Depends, generators included.
Lifespan and state
What runs around the application, and the state it shares with its runs.
Running
await app.run(...), app.run_sync(...), fastsandbox.run(...), several runs at once, progress.
Command line
fastsandbox tasks and fastsandbox run, the inputs as options; info, kits compile, ssh-proxy.
Claude Code, Codex, Copilot, Cursor, Devin, Docker Agent, Droid, Kiro and OpenCode, by the name of their kit, with the profiles of docker-sandbox-kit: the keys each takes and how it runs one prompt without a terminal.
Credentials
Read from the environment of the host, as the profile of the agent names them, and given to the proxy of the sandbox of the run only: the sandbox holds a placeholder.
Running modes
Unattended (ctx.agent.prompt), streamed step by step (ctx.agent.stream), or interactive (ctx.agent.session).
Network
The kit of the agent declares the hosts it needs; the host rules of the task apply from the creation of the sandbox, its HTTP rules before its start; both add to the global policy of the daemon.
Tools
MCP servers registered in Claude Code, Copilot or OpenCode by the task (mcp=[...]): a server of the host, whose token is drawn for each run, a remote one, or a program started in the sandbox; or servers loaded into the MCP gateway of its sandbox.