How Plugins Work
Compilation to WebAssembly
Your plugin source code (Rust, Python, TypeScript, etc.) is compiled to WASI Preview 2 WebAssembly, a standards-based binary format that runs on any platform.Secure Sandbox Execution
Plugins execute in Wasmtime, a WebAssembly runtime that provides:- Process isolation - Plugins cannot access host system
- Resource limits - Memory, CPU, and execution time constraints
- Permission gates - Explicit allow/deny for network, filesystem, environment
- Zero trust - Everything denied by default
Plugin Package Format (.npack)
Plugins are distributed as.npack files, which are gzip-compressed tar archives containing:
Required Files
plugin.wasm- The compiled WebAssembly module
- Contains your plugin’s tools and business logic
- Compiled to WASI Preview 2 target
Optional Files
noorle.yaml- Plugin metadata (name, description, author, tags)
- Runtime profile selection
- Security permissions (network, filesystem, environment)
- Resource limits (memory, timeout)
- Component Model World Interface definition
- Documents your plugin’s exported functions and their signatures
- Enables introspection and discovery
- Environment variables for your plugin
- Encrypted at rest, visible only to your plugin
- Not included in source control
Component Model Integration
Noorle plugins use the WebAssembly Component Model, a standardization effort that defines:- Tools as exported functions with typed parameters and return values
- Resources as opaque handles managed by the host
- Host functions that plugins can import (I/O, networking, etc.)
Capability Integration
Plugins integrate with Noorle’s unified capability system:Tool Definition
Tools are the main interface your plugin exposes. Each tool:- Has a name - Used to invoke the tool (
my_plugin_my_tool) - Takes inputs - JSON Schema-defined parameters
- Returns output - JSON or structured data
- Is discoverable - Listed via the tools/list MCP method
Execution Flow
When a tool is invoked:Version Management
Plugins support multiple versions:- Active version - The version currently used by agents/gateways
- Previous versions - Available for rollback or A/B testing
- Version history - Audit trail of all deployments
Key Concepts
| Concept | Description |
|---|---|
| Tool | Exported function from your plugin with inputs and outputs |
| Capability | Abstraction representing a plugin, builtin, or connector |
| Sandbox | Wasmtime runtime with strict resource and permission boundaries |
| Permission | Allow/deny rules for network, filesystem, environment access |
| Component Model | W3C standard for WebAssembly module composition |
| WASI Preview 2 | Standard system interface for WebAssembly modules |
Why WebAssembly?
WebAssembly provides:- Portability - Runs on Linux, macOS, Windows, and cloud platforms
- Performance - Near-native execution speed
- Security - Strict sandboxing prevents access outside defined boundaries
- Language agnostic - Compile from Rust, Python, Go, TypeScript, etc.
- Standardized - W3C standard ensures long-term stability