The sandboxed transport
Run every work loop in a separate isolated process instead of inside the workspace process. How to turn it on and off, what the instance judges per tool call, the limit on concurrent runs, what changes on your machine, and how to verify it on your instance.
What it is
A work loop, the thing that runs when an actor is given a goal and tools, can run in one of two places.
in_processruns it inside the workspace process, sharing memory with the provider credential, the operator's bearer and the store. It is the operator's default on their own machine.sandboxedruns it as a separate process with no network access, no view of the instance's home directory, limits on memory, processes, files and CPU time, and one short-lived credential. It can reach only a small set of endpoints on a local socket; everything else answers 404.
The workspace checks each isolation layer before the run is allowed to begin. A run it cannot isolate is refused rather than started, and it never receives a credential.
The transport works on hosted instances and on your own machine alike. On a hosted instance each worker runs as a separate unprivileged user.
Which runs are sandboxed
The transport is decided per run, at start, by the tier of the principal the run is for:
| principal | default | config key |
|---|---|---|
| the operator | in_process | work_loop_transport |
| every other tier (Trial, Paid, Team) | sandboxed | work_loop_transport_members |
Both keys are one config record on th_engine_config, live for the next run to start. There is no restart, so you can turn the sandbox off with one write if it causes a problem.
# The operator's own runs, sandboxed too (written through the records API, as in Store bounds: set actor and clock)
curl -X POST http://127.0.0.1:9100/v1/records \
-H "Authorization: Bearer $SPL_TOKEN" -H 'content-type: application/json' \
-d '{"thread":"th_engine_config","actor":"<your member id>","act":"LEARN","clock":<next clock>,
"body":{"kind":"core.engine.config.v1","topic":"work_loop_transport","transport":"sandboxed"}}'
# The rollback for everyone else: members back in process (not recommended on a hosted instance)
curl -X POST http://127.0.0.1:9100/v1/records \
-H "Authorization: Bearer $SPL_TOKEN" -H 'content-type: application/json' \
-d '{"thread":"th_engine_config","actor":"<your member id>","act":"LEARN","clock":<next clock>,
"body":{"kind":"core.engine.config.v1","topic":"work_loop_transport_members","transport":"in_process"}}'Check what the running service took, not only what was written:
curl -s -H "Authorization: Bearer $ADMIN" localhost:9100/v1/engine/health | jq .work_loop{ "transport": "in_process", "member_transport": "sandboxed", "admission_capacity": 16, "admission_available": 16 }An unrecognised value for the operator's key reads as in_process, and for the members' key as sandboxed: a typo moves nobody into a transport they were not already in. Before starting a run, POST /v1/work/loop/preview reports the transport a start would take for that principal.
Runs already in flight keep the transport they started under. Flipping a value stops new runs taking the old transport; it does not reach into one already running. To stop that one:
# At the next step boundary: the run's next tool call is answered with a stop verdict
# and the run ends with a cancelled outcome; its worker process is reaped.
curl -s -X POST -H "Authorization: Bearer $ADMIN" -H 'content-type: application/json' \
localhost:9100/v1/runs/$THREAD/events -d '{"type":"stop"}'File tools in the sandbox
The instance's built-in file tools (read_file, write_file, list_dir, search) are not available to a separate process. A sandboxed run whose tier grants them starts anyway: the four are withheld and the run says so. The run's anchor and its row at GET /v1/runs/{thread} carry narrowed, the list of granted tools the transport withheld, and the model is told the same in its opening. Nothing is dropped silently.
Every tool call is judged by the instance
A sandboxed worker holds no permission rules. Before it runs any tool it asks the instance, which checks your live permission rules the same way an in-process run would, and writes its judgment as a core.work.tool_verdict.v1 record before answering. The answer is one of these, checked in order:
| layer | meaning | what to change |
|---|---|---|
stop | the run was stopped; this call is refused and the run ends | nothing, it is what you asked for |
grant | the tool is not in this run's reach | the caller's tool grant, or the tier |
clamp | the tool is on the run's own forbidden list | the run's own request |
rule | a live permission rule denied it | spl config add-permission-rule |
allow | nothing objected | nothing |
Because the rules are checked on every call, a rule written while a run is going is honoured by that run's next tool call, with no restart:
spl config add-permission-rule --name stop-that --action deny --priority 100 \
--expression 'resource == "tool:bash"'The verdict is written by the instance, and so is the run's outcome. The run credential cannot write either kind, so a run cannot declare that it was allowed to act or that it succeeded. The outcome's success is also checked against what the tools did: a run whose every call failed is not a success whatever its final answer says, and the outcome carries tool_calls_ok and tool_calls_failed so a reader has the evidence beside the verdict.
Observations after a tool call
The permission rules above run before a tool call. After one returns, the instance may add an observation: a note about the run, shown to the model on its next turn beside the tool's own result.
Three observations are built in:
- An actor calling the same tool with identical arguments three times in a row is told so, and told to change something or stop. Calls that were denied count too.
- An actor whose second read of the same thread comes back empty is told it has already looked.
- A tool call that arrives on a reply cut off by the output limit is never run, because cut-off arguments can look complete and still be wrong.
Each one is a core.work.observation.v1 record on the run's thread, naming the rule that fired and the exact text the actor was shown, so you can always ask afterwards why a run changed course:
spl thread records $THREAD -o json | jq -r '
.data[] | select(.body.kind == "core.work.observation.v1") |
"\(.body.rule): \(.body.text)"'Observations can only add notes, never suppress one. They work on both transports.
To read what a run was allowed to do, walk its thread:
spl thread records $THREAD -o json | jq -r '
.data[] | select(.body.kind | test("tool_(call|verdict|result)")) |
"\(.sequence) \(.body.kind) \(.body.tool // .body.fulfills) \(.body.decision // .body.status // "")"'Limit on concurrent runs
The number of concurrent sandboxed runs is limited by the host's memory. A slot is taken before a worker starts, so a full instance refuses a new run without starting anything. A start past the ceiling answers HTTP 503 with the code ADMISSION_CEILING, and /v1/engine/health reports the limit and how much of it is free.
What changes on your machine
- A second socket. The workspace binds
~/.syncro/run/spl-worker.sockbeside the operator socket. The operator socket still grants same-user trust; the worker socket requires a bearer on every request. - The workspace process is protected. A same-user shell cannot read its memory or environment.
readlink /proc/<pid>/exeneedssudo, and the process writes no core dump. This is intended. - Find workers in the log, not the process table. The workspace logs each worker's process id when it starts it. Do not use
pgrep -f 'spl loop-worker'; it matches the shell that issued it.
journalctl --user -u spl-serve -n 200 | grep 'running sandboxed'- Upgrades are stop, install, start. A worker is started from the workspace's own binary, so replacing the binary under a running workspace does not change already-running workers, and a live copy over the running binary is refused (
Text file busy). See In-place upgrades.
What a run is confined by
A sandboxed run has no network, sees only an empty read-only home directory with the worker socket in it, cannot use system calls for mounting, tracing or loading modules, and has limits on memory, file size, processes and CPU time. Its credential covers only its own thread and the kinds of record a run may write. It can see that other processes exist but cannot touch them.
Verify it on your instance
Start one small run through the work loop endpoint (POST /v1/work/loop) as a non-operator, or as the operator with work_loop_transport set to sandboxed, and watch it finish. The goal records a note and stops.
curl -s -X POST -H "Authorization: Bearer $ADMIN" -H 'content-type: application/json' \
localhost:9100/v1/work/loop \
-d '{"goal":"Record a note whose text is exactly: transport-check . Use the record_note tool with only the text argument. Then stop.",
"max_turns":3,"budget_usd":0.05}'If you leave budget_usd out, a sandboxed run is minted with its tier's per-run default ceiling, because the inference broker refuses a credential with no ceiling; the run row's budget_usd shows the ceiling the credential actually holds. An in-process run with no budget stays unbounded.
The response carries the run's thread. Poll it until it is finished:
curl -s -H "Authorization: Bearer $ADMIN" localhost:9100/v1/runs/$THREAD | jq .state
# "done"Then read the outcome record on the thread and check three things: transport is sandboxed, tool_calls_ok is at least 1, and the note is there. On an instance with a data plane the run row also carries narrowed naming the file tools the transport withheld.
spl thread records $THREAD -o json | jq '.data[] | select(.body.kind == "core.work.loop_outcome.v1" or .body.kind == "core.work.note.v1") | .body'If the outcome says stopped_short and its summary names the worker socket or the inference relay, upgrade the instance and run again.
What is on by default
Every run for a principal other than the operator is sandboxed. The operator's own runs are in process unless work_loop_transport says otherwise. Both are per instance and both are one config record to move.
Host tools (bash and the filesystem set) run on the operator's own machine only, where the operator is already the trust boundary; no transport setting extends them to anyone else.
See also
- Security model for the threat model and what a run cannot do
- Operator runbook for the upgrade sequence
Security model: secrets at rest, threat model, operator discipline
What spl serve protects against (default-secure auth + filesystem permissions) and what it does NOT (host compromise, cloud-sync of identity dirs). Read before deploying to a multi-tenant or shared-storage environment.
Account sign-in for your instance
Let people who hold a hosted account come back to your instance by signing in, by declaring which verifier your instance trusts. Hosted instances get this from provisioning; self-hosted instances opt in.