Capability matrix

std is always available; capability imports require both a build that includes the capability and host enablement.

For script-facing imports and operations, see capabilities.md.

ImportNativeWASI CLIBrowser engineHost setup / defaultOperations and security implications
cap:fsCompiled by defaultNative directory mounts are unavailable in the current WASI engine; virtual drivers remain host-definedNo built-in browser filesystem driverEnable fs and register a directory or virtual mount; no usable mount by defaultRead/write/list/delete under named mounts. Reject absolute and traversal paths; driver and symlink/race policy remain host responsibility.
cap:httpCompiled by defaultDepends on host HTTP handlerNo browser fetch handler is supplied automaticallyEnable http; register HTTP handlerOutbound HTTP through host callback. Host must set redirect, DNS, private-address, timeout, and response-size policy.
cap:netCompiled by defaultListen unsupported (no WASI accept/bind); dial depends on socket host supportNo browser socket handler is supplied automaticallyEnable net=dial, net=listen, or net=dial,listen (bare net = dial only, unchanged from before scopes existed); register net handlers; policy APIs can add rulesRaw networking, scoped: dial (outbound) and listen (inbound, via net.listen/Listener.accept) are independent authorities with independent policy lists. Dial has no native rules by default (all destinations allowed — restrict for untrusted code); listen defaults to deny-all (a host must add an explicit allow rule before any bind succeeds).
cap:envCompiled by defaultEnvironment depends on WASI runtimeNot supplied by SDKEnable env (CLI: --cap env) and provide compatible host environmentRead-only environment access. Use env.get(name) to pass selected host variables to scripts, or env.list() only when broad exposure is intended. Allowlist names; inherited environment can contain secrets.

The compiler rejects an unavailable capability import. A capability name alone does not grant OS authority: the concrete handlers and mounts determine what a script can do. host:* modules are not capabilities; they are explicit host callbacks and must be reviewed as authority grants.