Expand description
WASM tool execution sandbox and built-in tool catalog.
Provides types and configuration for running tools inside isolated WASM sandboxes with fuel metering, memory limits, and host filesystem isolation.
§K3 Tool Lifecycle
Tools go through: Build -> Deploy -> Execute -> Version -> Revoke.
This module provides the execution runtime and tool catalog;
the lifecycle management is in crate::tree_manager.
§Feature Gate
This module is compiled unconditionally, but the actual
Wasmtime runtime integration requires the wasm-sandbox
feature flag. Without it, WasmToolRunner::new returns
a runner that rejects all tool loads with WasmError::RuntimeUnavailable.
§Security
Each tool execution gets its own isolated store:
- No host filesystem access (unless WASI explicitly enabled)
- No network access
- CPU bounded by fuel metering
- Memory bounded by configurable cap
- Wall-clock timeout as safety net
Structs§
- Agent
Inspect Tool - Built-in
agent.inspecttool. - Agent
List Tool - Built-in
agent.listtool. - Agent
Resume Tool - Built-in
agent.resumetool. - Agent
Send Tool - Built-in
agent.sendtool. - Agent
Spawn Tool - Built-in
agent.spawntool. - Agent
Stop Tool - Built-in
agent.stoptool. - Agent
Suspend Tool - Built-in
agent.suspendtool. - Builtin
Tool Spec - Specification of a built-in kernel tool.
- Certificate
- A signing certificate in the CA chain.
- Compiled
Module Cache - Compiled module cache with LRU eviction.
- Deployed
Tool - A tool with its spec and version history.
- FsCopy
Tool - Built-in
fs.copytool. - FsCreate
DirTool - Built-in
fs.create_dirtool. - FsExists
Tool - Built-in
fs.existstool. - FsGlob
Tool - Built-in
fs.globtool. - FsMove
Tool - Built-in
fs.movetool. - FsRead
DirTool - Built-in
fs.read_dirtool. - FsRead
File Tool - Built-in
fs.read_filetool. - FsRemove
Tool - Built-in
fs.removetool. - FsStat
Tool - Built-in
fs.stattool. - FsWrite
File Tool - Built-in
fs.write_filetool. - IpcSend
Tool - Built-in
ipc.sendtool. - IpcSubscribe
Tool - Built-in
ipc.subscribetool. - Sandbox
Config - Filesystem sandbox configuration for built-in tools.
- Sandbox
Decision - Result of evaluating the multi-layer sandbox stack.
- Shell
Command - A shell command to be executed in the sandbox.
- Shell
Exec Tool - Built-in
shell.exectool wrappingexecute_shell. - Shell
Pipeline - A shell pipeline compiled into a chain-linked WASM tool spec.
- Shell
Result - Result of a shell command execution.
- SysChain
Query Tool - Built-in
sys.chain.querytool. - SysChain
Status Tool - Built-in
sys.chain.statustool. - SysCron
AddTool - Built-in
sys.cron.addtool. - SysCron
List Tool - Built-in
sys.cron.listtool. - SysCron
Remove Tool - Built-in
sys.cron.removetool. - SysEnv
GetTool - Built-in
sys.env.gettool. - SysService
Health Tool - Built-in
sys.service.healthtool. - SysService
List Tool - Built-in
sys.service.listtool. - SysTree
Inspect Tool - Built-in
sys.tree.inspecttool. - SysTree
Read Tool - Built-in
sys.tree.readtool. - Tool
Registry - Registry of available tools for dispatch.
- Tool
Signature - A cryptographic signature binding a tool definition to a signer identity.
- Tool
State - Per-execution state for a WASM tool.
- Tool
Version - A deployed version of a tool.
- Wasm
Sandbox Config - Configuration for the WASM sandbox.
- Wasm
Tool - A loaded WASM tool module.
- Wasm
Tool Result - Result of a WASM tool execution.
- Wasm
Tool Runner - WASM tool runner.
- Wasm
Validation - Validation result for a WASM module.
Enums§
- Backend
Selection - Backend selection for tool execution.
- Sandbox
Layer - Which sandbox layer denied (or allowed) access.
- Tool
Category - Category of a built-in kernel tool.
- Tool
Error - Tool execution errors.
- Tool
Signing Authority - Tool signing authority – identifies who signed a tool module.
- Wasi
FsScope - WASI filesystem access scope for a tool.
- Wasm
Error - WASM runner errors.
Traits§
- Builtin
Tool - Trait for built-in kernel tools.
Functions§
- builtin_
tool_ catalog - Return the complete catalog of 27 built-in kernel tools.
- compute_
module_ hash - Compute SHA-256 hash of WASM module bytes.
- execute_
shell - Execute a shell command and return the result.
- verify_
tool_ signature - Verify a tool’s Ed25519 signature against a public key.