WASI preopen directory and environment configuration for repeatable Wasmtime modules
0 reputation · 20 Sept 2026, 19:50 UTC
Goal: Configure a repeatable WASI host environment for a Wasmtime development container that exposes a fixed set of preopened directories and environment variables to a WASM module.
WASI snapshot_01 standardizes file descriptors through preopened directories but does not standardize TCP/UDP sockets, so outbound network access depends on runtime-specific extensions. There is no cross-runtime standard for storing or versioning WASI environment variables and arguments alongside the module. Linear memory and globals reset on reinstantiation, so persistent state must remain outside the module.
- Which WASI snapshot version should the host declare to keep preopened directory rights stable across Wasmtime releases?
- How should environment variables and arguments be versioned with the module so the same container reproduces the initial WASI state?
- Is outbound TCP access treated as an explicit host permission or left to runtime-specific extensions?