Open it to the public
By default every agent runs as the server’s OS user, so accounts separate people who trust each other (see the trust model). To take accounts from people you don’t know, turn on the sandbox and hand out invite codes.
What the sandbox does
Section titled “What the sandbox does”With Fuseraft:Sandbox:Enabled, every fuseraft process a non-admin starts (chats, sessions,
scheduled jobs, and the server’s own queries for them) runs in bubblewrap.
Inside it:
- Files. The system is read-only. The only writable places are the account’s fuseraft home
and its workspace roots, with a private
/tmp. Other accounts’ homes, the data directory and the server’s files aren’t there at all. - Processes. It has its own process list and can’t see or signal anything outside.
- Environment. It gets only what fuseraft needs: its home, its proxy, the account’s own model keys. None of the server’s environment, so secrets set there stay out of reach.
- Network. It has no network of its own. HTTPS goes through the server’s egress proxy, which connects only to allowed hosts on port 443, and never to this machine or a private network (cloud metadata included), whatever a name resolves to. Plain HTTP is refused.
The server also changes how it treats sandboxed accounts:
- Their model profiles and API keys are kept in the data directory instead of their fuseraft home, where their agents can write. Each person brings their own key, and only their own agents see it.
- MCP servers added with a token are left out of their processes, so they can’t read the token. Token-free servers still work if their host is allowed.
- Each account may run
Fuseraft:Sandbox:MaxRunningchats and sessions at once (2 by default). - One file can’t grow past
Fuseraft:Sandbox:MaxFileSizeMb(1024 by default).
Admins aren’t sandboxed. Keep admin accounts for people who look after the server.
Requirements
Section titled “Requirements”-
Linux with unprivileged user namespaces, which most distributions allow.
-
bubblewrapandsocat:Terminal window sudo apt-get install -y bubblewrap socat # Debian, Ubuntusudo dnf install -y bubblewrap socat # Fedora -
On Ubuntu 23.10 and later, AppArmor can stop unprivileged programs from creating user namespaces. If the startup check fails there, let
bwrapcreate them with a profile in/etc/apparmor.d/bwrap, thensudo systemctl reload apparmor:abi <abi/4.0>,include <tunables/global>profile bwrap /usr/bin/bwrap flags=(unconfined) {userns,include if exists <local/bwrap>} -
Run fuseraft-web as a service, not in the container image: bubblewrap can’t create namespaces inside an unprivileged container.
When the sandbox is on, the server checks at startup that a test sandbox starts and has no network, and refuses to start if not, so non-admins never run unsandboxed by mistake.
Turn it on
Section titled “Turn it on”In appsettings.json or the environment:
{ "Fuseraft": { "Sandbox": { "Enabled": true } }}The log shows the proxy and its allowed hosts at startup:
Sandbox egress proxy listening on /tmp/fuseraft-web-fuseraft-web/egress/proxy.sock; allowed hosts: api.anthropic.com, …Allowed hosts
Section titled “Allowed hosts”By default agents can reach the model providers fuseraft knows (Anthropic, OpenAI, xAI, Google, Mistral, DeepSeek, Groq, Together, OpenRouter) and the public git hosts (GitHub, GitLab, Bitbucket), so people can clone and push their repositories over HTTPS. Git over SSH isn’t available.
Add more in Fuseraft:Sandbox:AllowedHosts; *.example.com allows its subdomains:
"Sandbox": { "Enabled": true, "AllowedHosts": ["registry.npmjs.org", "pypi.org", "files.pythonhosted.org", "*.example.com"]}Set UseDefaultHosts to false to allow only your own list. Refused connections are logged as
Sandbox egress refused: <host>:<port>, which shows what people are trying to reach.
Invite codes
Section titled “Invite codes”Admins make codes on the Users page, or from a shell:
fuseraft-web invites add --uses 5 --days 7 --note "workshop" # prints the code oncefuseraft-web invites listfuseraft-web invites revoke <id>Someone with a code creates an account at /signup (the sign-in page links there while a code
is usable). The Users page shows a link with the code filled in. Accounts made this way are
never admins. Only a hash of each code is kept, so it can’t be shown again; make a new one instead.
What’s still shared
Section titled “What’s still shared”The sandbox keeps people’s files and secrets apart. It doesn’t divide the machine’s capacity:
-
CPU, memory and disk are shared. Cap the service as a whole so a busy account can’t take the machine down, with these lines under
[Service]in the unit file:MemoryMax=75%TasksMax=2048CPUQuota=180%Keep an eye on the data directory’s disk use; workspaces have no quota.
-
/etcis visible read-only. Don’t keep secrets in files the service user can read under/etc: anEnvironmentFile=owned by root with mode 600 is read by systemd, not by the service. -
The server’s own address. Every account’s traffic leaves from the server’s IP address, so sites they reach see you. The allowed-hosts list is what limits that.