Filesystem Sandbox
By default, code you run with Elide has full host file-system access. The filesystem sandbox locks that down to an explicit set of paths, so a script can only read and write what you allow.
Turning it on
bash
elide --sandbox run app.js--sandbox switches the guest to deny-by-default: with no grants, file-system access is denied. Grant access with --allow-read and --allow-write:
bash
elide --allow-read=./data --allow-write=./out run app.js--allow-read and --allow-write both imply --sandbox, so you do not need to pass --sandbox separately when granting.
Grants
| Flag | Effect |
|---|---|
—sandbox | Deny-by-default file-system access. |
—allow-read[=PATHS] | Grant read access. The bare form grants all reads; =PATHS scopes it to specific paths. |
—allow-write[=PATHS] | Grant write access. The bare form grants all writes; =PATHS scopes it to specific paths. |
—fs-audit | Log each file-system access decision (allowed or denied). |
--allow-read and --allow-write are repeatable and comma-scoped — pass the flag multiple times or a comma-separated list of paths.
How it works
The sandbox is enforced by a single host-side policy (FsPolicy) that gates both node:fs and the polyglot guest file system, so one policy governs every language layered on the runtime. The sandbox is filesystem-scoped; host socket and network access are governed separately.
See also
- File System Access — the underlying IOAccess model