Disclosure: I build SpaceApp, a self-hosted workspace for running AI coding CLIs. It is MIT-licensed. This walkthrough uses it, but the idea (give an agent only the folders it needs, and make the reference ones read-only) applies to any setup.
The problem
When an agent works on your project, it often needs to read other code too: a library checkout, an older version to compare against, a shared config repo. If those folders are writable, one wrong edit lands in the wrong repository, and a prompt that says "do not modify" is only a request.
A mount that is read-only does not depend on the agent remembering.
1. Install
You need Node.js 20.11 or newer. The documented installer command works on Linux, macOS and Windows 11:
npx --yes run-spaceapp@latest install When it finishes, it prints a one-time setup token. You use it to create the owner account and connect a provider through its official login flow.
2. Register only the folders you want
The containers see none of your host files until you register a folder:
# the project the agent may change npx --yes run-spaceapp@latest workspace add ~/code/my-project # a repo it may only read npx --yes run-spaceapp@latest workspace add ~/code/reference-lib --read-only Anything you did not register is not mounted at all, so there is nothing to protect with a prompt.
3. If something looks wrong
npx --yes run-spaceapp@latest doctor --fix What this does not do
Containers are not a sandbox against a hostile workload. Read-only mounts protect you from mistakes, not from a malicious program. The security model describes the trust boundaries.
Try it
SpaceApp is at spaceapp.dev. I would like to hear how you keep agents away from folders they should only read.
