Permissions
| Key | Meaning | Enforced as (WASI) |
|---|---|---|
read [paths] |
read files and list folders under these paths | read-only preopened directory |
write [paths] |
create, change and delete files under these paths | read-write preopened directory |
run [patterns] |
start these programs | host function: checked, then spawned with a limited environment |
net [host:port] |
connect to these hosts | host-mediated socket, allow-listed |
env [names] |
read these environment variables | passed in explicitly |
clock, random |
the time, random numbers | handles granted or withheld |
The subset rule
Section titled “The subset rule”Set A is a subtype of set B when everything A allows, B allows too.
write [./src]is smaller thanwrite [.].run ["git status"]is smaller thanrun ["git"].net []is smaller than everything.
A function needing A can be called by anyone who holds B. A call that needs more than the script holds is a compile error, with the line and the fix.