Our AI coding sandbox left the home folder readable
How we left an AI coding agent’s box open, and a checklist for boxing one in on Linux.
This page is for people who let an AI coding agent work alone on a Linux computer. It tells how our own sandbox left files open, then lists what we would do instead. It is a checklist, not a ready-made tool: for the commands, use bubblewrap's own guide and manual.
Our sandbox had a gap
In the Five Moves Second Test, run overnight on 22 to 23 November 2026 (US Eastern time), AI coding agents worked alone on small programming jobs. A coding agent is an AI that reads files and runs commands on a computer to get a job done. Each session was meant to see only its own project folder, so each ran in a sandbox: a walled-off box on the computer. Our study manager, an AI agent that ran the test for us, built the box with bubblewrap, a common Linux tool for this. The gap was ours, not the tested models'.
The box started with this line. It is what we ran, not advice:
bwrap --ro-bind / /
It means: show the box the whole disk, read-only (it can look, but not change). The computer's usual file permissions still applied, and the box let the agent write only to its project, its output folder and the coding tool's own files. The box then covered a few folders: the temporary folder /tmp, the other drives under /mnt, and the folder that held the test run. It did not cover the rest of the home folder. In there were the task files for every task, the scoring script, our run scripts, records of practice runs, the coding tools' saved sessions, and some of Grant's own files that had nothing to do with the test. Nothing in the request told the models to stay inside their folder.
One of the seven tested models, Gemini 3.8 Flash, made tool calls naming places outside its project folder in 86 of its 288 main sessions and 7 of its 32 spare sessions (extra tasks used to check the test before the main run). Some calls only listed folders. Others read the description of its own task, the scoring script and our run scripts. In 13 main sessions and 1 spare session it searched other tools' saved sessions. It also listed and read some of Grant's unrelated files. The records show no such calls by the other six models, apart from their own temporary folder and, once, a check of where a standard program was installed. The warning about Gemini 3.8 Flash gives the full account of that model's actions.
How we missed it
The test's planned leak check searched what the agents wrote, not what their tools handed back to them, so it found nothing. The study manager found the gap after the main run by searching every tool call for a place outside the session's folder. Even that search first missed one session that listed the whole disk; a later recount found it.
The repair still missed things
For a rerun of that one model, the box covered the whole home folder and put back only what its coding tool, OpenCode, needed: the program, its settings and download cache, read-only; two fresh, empty folders for its saved data and state, with the sign-in file alone inside, read-only; and the project and output folders. In the records of the 146 rerun sessions that finished, none held another version's instructions, the task-definition files, the scoring script or a key.
But it was still a list of things to cover, and the list was short. The system log /var/log/syslog, a file where the computer records what happens on it, stayed readable, as did /opt, /media, /run/user and /srv. Our log held lines from the kernel (the core of the operating system) that included other sessions' command lines: the tool, the model's name, the session's folder name and its one-sentence request. Of the 146 rerun sessions that finished, 3 read the log. Two main sessions were shown lines about other sessions; the third, a spare session, was shown none. The log had been just as readable in the first box, for all seven models; no session of the other six went there.
Grant stopped the rerun at 114 of 288 main sessions, after he had seen the first run's results. His reasons were the time it still needed and that a model with this many problems is not a good test subject. The published finding uses the other six models; the results page explains.
Both times we wrote a list of what to cover, and both times it missed something. You cannot list everything an agent should not see. You can list the few things it needs.
The checklist
This is what we would do now. We are not offering a ready-made tool, and we have not tested a full box with a real agent. Bubblewrap's guide and manual give the commands.
- Start from an empty box. Add only what the tool needs to run, read-only where you can. Name each folder you add; never start from the whole disk.
- Leave the network off unless the model needs it. A model hosted online needs a connection to its maker. If you can, keep the agent offline and let a small helper outside the box make that one connection, hold the key and block the agent's own web tools. If you share the computer's network with the box instead, the agent can reach the internet, your home or office network, services on your own computer and other programs' network sockets, and it can send out anything it can read.
- Give it a throwaway copy of only the files the job needs. Leave out hidden files, keys and Git history unless the job needs them. Check what changed before you use anything from the copy.
- Use a fresh, empty folder for the tool's saved sessions each time, so one session cannot read another's, and delete it afterwards. Give each session a fresh project too, and keep earlier sessions' outputs and logs out of reach.
- Use a key made for this job only. The agent can read and copy any sign-in file you give it, read-only or not. Give the key the least access the provider allows and a spending limit, cancel it when you are done, and never put a key on a command line.
- Start with no settings. Programs inherit environment variables (named settings, which can hold keys) from whatever starts them. Clear them and add back only the few the tool needs. Also make sure the agent does not inherit open files or connections it should not have.
- Never run the agent as root, the administrator account. A separate account just for the agent is better still.
- Give the box its own list of running programs, so it cannot see yours. Have whatever starts the box stop the whole job when it ends or times out, and test that a harmless background program stops too.
- Set limits from outside the box: time, memory, number of programs and disk space. Bubblewrap sets none by itself, and it shares the computer's kernel, so it is a wall, not a vault. The disk limit should cover every place the job can write. If you set a spending limit with the model's maker, check that reaching it actually stops requests; an alert alone does not.
- Before any real run, test the same box with harmless files. Have a test session list what it can see, and compare that with what you expect: which folders are in the box, what is in them and where it can write, readable files outside the project, sockets and network connections. Put a fake private file outside the project and check that the agent cannot read it. Anything you did not add is a gap, and a check that did not finish is not a pass.
- After a run, read what the tools returned to the agent, not only what it wrote. Search every tool call for places outside the project, counting from the folder each call started in, and note any reply that is missing or cut short. Keep those records private, because they hold whatever the agent saw.
The network we left on
We left the network on in both boxes because the models were hosted online. In five sessions, two in the first run and three in the repaired box, Gemini 3.8 Flash wrote a small program that searched the web for words from its task. Our check of the raw records found DuckDuckGo used in all five and Google in four. The three rerun sessions are flagged web_or_network in the published list of rerun sessions (flash2_sessions_outside_access.csv in the study's data); the warning page has the full account.
Those searches went out from inside the box. A box with no network of its own could not have sent them straight out. A model hosted online still needs some way out, and one tighter design gives the box no network and a single connection to a small program outside it that passes on only the requests the job needs to the model maker, and holds the key itself. Our Letta Code page shows a box built in that spirit for a local model. Even then, whatever the coding tool sends to the model maker still goes, including what its tools read. We have not tested this for this kind of run.