Docs / Models and sandbox / The sandbox
The sandbox
A run uses two containers. Both have no network, a read-only root and no capabilities, and the host is the only trusted part.
The trust boundary#
A run reads a file that may be hostile and lets a language model act on it, so the sandbox assumes the sample, the agents and the tools' output are hostile. The host process is the only trusted part. It holds the model's key, the board and the reports.
What every container gets#
| Setting | Value |
|---|---|
--network none | the only network the code will build; a profile that asks for another one is refused |
--read-only | the root file system cannot be written; only the tmpfs folders below can |
--cap-drop ALL | no Linux capabilities |
--security-opt no-new-privileges | a process cannot gain privileges |
--user | the uid and gid of the host user, not root; each agent role then runs as its own uid |
--memory, --cpus, --pids-limit | limits on memory (swap included), processors and processes |
--tmpfs | /tmp, /home/agent and the working folder, with nosuid and nodev, and sizes set per run |
--init --rm | the container removes itself when it ends |
What each container can reach#
| Container | Mounted | Mode |
|---|---|---|
| tools | /in: the run's input folder, with the sample | read-only |
| tools | /ag: the folder where the tool server puts its socket | read-write |
| tools | /skills/rea-reverse-engineering | read-only |
| agents | /in, /prep (the prepared files), /cfg (the agent's settings) and /skills/* | read-only |
| agents | /tools-sock: the tool server's socket folder | read-only |
| agents | /run/proxy: the folder with the model socket | read-only |
The tools container has no model socket. A socket in a read-only mount still connects, so the proxy mount is the folder and not the file. Each agent role also gets a private tmpfs for its working folder and its home, owned by its own uid and readable by no other, so one role cannot plant files in another's folders. The two containers never mount the Docker socket, and neither holds a key.
No network, and the checks before and during a run#
Before a run starts, a throwaway container with --network none must show no interface besides loopback and must fail to connect to a public address. The result is kept for 60 seconds, or 8 seconds after a failure. A check that gives no clear answer counts as a failure, so a run does not start until it can run.
After each container starts, SwarmLabRE inspects it and stops the run when one of these holds:
- the root file system is writable;
- capabilities are kept;
- new privileges are allowed;
- the container is privileged;
- it has a network other than none;
- the Docker socket is mounted;
- the proxy socket folder is writable;
- there is no memory limit;
- there is no process limit;
- it runs as root.
It also stops the run when the inspect output contains the model's key.
How the model reaches the agents#
pi talks to 127.0.0.1:8801 inside the agents container. A forwarder script, sock-fwd.js, listens on loopback only and connects to one fixed path, /run/proxy/model.sock. That is the gate's socket on the host, in a folder only the owner can enter, and the gate drops a connection from any other uid. The gate adds the key. Use a real model lists what else the gate changes.
What comes back#
Files a container can write are untrusted. SwarmLabRE reads the tools container's output as a tar stream and never extracts it, with at most 64 MiB and 400 files. It resolves paths inside the container, opens files with O_NOFOLLOW and caps every size it reads. An agent's output is read as text. A finding is taken only from a line that carries that task's own nonce, which a string inside the sample cannot forge. What an agent writes is cleaned, capped and shown as text. The board says how a post becomes a finding.
What the sandbox does not do#
- Docker is not a perfect boundary. A flaw in the kernel or the container runtime could let a process leave a container. Run SwarmLabRE on a machine and an account where that would be survivable.
- No check in the repository involves real malware, so how Ghidra, jadx and the agents behave on hostile files from the wild is not verified.
- The tool socket binds only some tools to the sample. The Android tools accept only the pinned sample path; others that take a path, such as
inspect_artifact, are allowed but not bound, so a steered agent could point one at another file inside the tools container. - A call citation is attributed by text. An agent that can run shell commands can print another role's call id, and SwarmLabRE cannot tell that from a call of its own.
The Security page holds the whole threat model. SECURITY.md says how to report a problem.