/workspace, and that mount is a directory on the
host. A microVM runtime copies files in and out over an agent channel; here, writing a file is a
host write and reading one back is a host read.
Measured against a microVM runtime on the same machine: 7× faster to place 200 files, 49×
faster to read them back.
/workspace prefix — /src/main.js and
/workspace/src/main.js are the same file. Parent directories are created for you on write.
It is just a directory
box.workspaceDir is the host path, and everything you already know works on it:
sandboxes.workspaceDir(name) gives the same path for a sandbox that does not exist yet, which
is how you can stage files before the first create().
The workspace outlives the container
Stopping a sandbox keeps its workspace. So does retiring one at its maximum lifetime. The nextcreate() gets a fresh container over the same directory — a new process on a warm cache.
Only remove() deletes it, and it deletes it unconditionally.
Traversal is refused, not normalised
/workspace/../../../etc/x normalises back
inside the workspace directory on some inputs, so a containment check alone passes and the
caller silently gets a different file from the one it named.
So a path containing a .. segment is rejected before normalising, and the normalised result is
checked for containment afterwards as well. A path that tried to leave is a bug or an attack;
either way the honest answer is no, not a quietly different file.
hostPath() applies the same rule, and is public so you can resolve a path yourself under the
same guarantee: