Skip to content

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

Set A is a subtype of set B when everything A allows, B allows too.

  • write [./src] is smaller than write [.].
  • run ["git status"] is smaller than run ["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.