The sandbox

A sandbox for your code and the assistant’s, at the size you set

Try a package, a script from the internet or a change the assistant suggests without letting it near the rest of your computer: in a folder of its own, with only the memory and room on the disk you give it.

The sandbox box: a tick box to run the terminal and the assistant’s commands in the sandbox, sliders for the room on the disk and the memory, 2 GB each, its folder, the ways of installing packages this computer has, and Copy the project in and Empty the sandbox
The sandbox box: turn it on, set its size, and see what can be installed in it.

Running code means trusting it. A package pulls in fifty more; a script found online writes to your home folder; a command the assistant suggests fills the disk with a cache. The sandbox in Scriptorium Coder is a walled-off place for all of that: a folder in the project where commands run, keep their files, and stop at the limits you set.

Turn it on

Press Sandbox at the top of the terminal. Tick Run the terminal and the assistant’s commands in the sandbox, and from then on every command, yours and the assistant’s, runs in the project’s Sandbox/work folder and cannot cd out of it. The programs it starts keep their home, their temporary files and their caches (npm, pip, Python, Go, Cargo, NuGet, Gradle and the rest) inside Sandbox/, not in yours.

Its size is yours to set

  • Room on the disk, from 100 MB to 200 GB.
  • Memory for its commands together, from 256 MB to 64 GB.

Each has a slider whose steps grow with the size, or type the number in MB or GB. The disk is measured while commands run and after every file written there; at the limit the commands are stopped, the terminal says why, and nothing more is written into it. On Windows the memory limit holds for every process a command starts.

Packages, inside it

What you or the assistant install with the sandbox on stays in it. npm installs go to the sandbox’s own folder, even npm install -g; yarn, pnpm, gem, cargo, go install, dotnet tools, composer, deno and bun put what they install under Sandbox/, and their programs come first on the sandbox’s PATH. pip installs into the sandbox’s own Python environment, Sandbox/.venv, made with your computer’s Python when the sandbox is first turned on, or with Make the Python environment. The box lists which ways of installing your computer has.

Try the project without touching it

Copy the project in brings the project’s files into the sandbox, without Git’s folder, node_modules or what the project ignores, so you can try a change there and leave the real files alone. Empty the sandbox deletes everything in it, after asking. Git leaves Sandbox/ alone: new projects ignore it, and an older project’s .gitignore gains the line when the sandbox is first turned on.

For the assistant too

The assistant is told when the sandbox is on, where its commands run and within what limits. It may turn the sandbox on and copy the project in when it wants to try code walled off; turning it off, emptying it and its sizes are yours. Every command it wants to run is still shown to you first, and asked about every time.

What the assistant remembers

Since the same version, the assistant’s memory is kept in the project, in Conversations/MEMORY.md, beside its conversations: a file you can read and change like any other.