Skip to content

Capabilities ​

A Capability grants a host operation permission to access a protected LightVM function. Pass the required values in VMConfig.caps. TypeScript uses Observe by default.

CapabilityNumeric valueProtected operations
Control0run, compile, embedded, function exports, provide, clearing outputs, and bytecode optimization
Observe1inspect, reading outputs, and variable exports
Debug2Benchmarks, reading panic records, and clearing panic records
Unsafe3halt, which stops the VM

unsafeMode (or unsafe_mode in Rust) in disables security checks such as import restrictions and resource quotas for I/O, imports, allocations, calls, and jumps, but does not grant capability permissions. Bounds verification remains enabled. Calling halt still requires the Unsafe capability in VMConfig.caps, even with this mode enabled.

WARNING

Failing to provide the required capabilities will cause protected host operations to fail execution or trigger runtime errors. Always ensure you grant the minimum necessary capability permissions required by your application.