Why WebAssembly?
Plugins must be:- Secure - Can’t access system, steal data, or harm other processes
- Fast - Near-native performance for complex computation
- Portable - Write once, run anywhere
- Controlled - Resource limits (memory, CPU time)
WASM Sandbox Model
Noorle uses WASI Preview 2 (WebAssembly System Interface) for safe system access:Plugin Lifecycle
Npack Format
Npack is Noorle’s plugin package format:manifest.json
schema.json
Defines MCP tools the plugin exposes:Example Plugin: Loan Analyzer
Rust Source Code
Compilation
Packaging
Runtime Behavior
When an agent calls your plugin:Permissions & Capabilities
Control what each plugin can do via permissions:cpu_bound- Remove default CPU time limitsmemory_bound- Increase memory limit to 256 MBenv:{var_name}- Access specific environment variableexecution_timeout:{seconds}- Custom timeout
Versioning & Rollback
Plugins are versioned:Performance Characteristics
WASM near-native performance:Supported Languages
Any language that compiles to WASM:| Language | Status | Setup |
|---|---|---|
| Rust | ✓ Best | rustup target add wasm32-wasi |
| C/C++ | ✓ Good | Emscripten or clang WASM |
| Go | ✓ Good | GOOS=js GOARCH=wasm |
| Python | ⚠ Limited | Pyodide (some limitations) |
| JavaScript | ✓ Good | Node.js WASM target |
| Zig | ✓ Good | Zig target wasm32-wasi |
Debugging
Monitor plugin execution:Best Practices
Pure Functions
Plugins should be deterministic. Same input = same output.
Handle Errors Gracefully
Return structured errors. Agents need to know what went wrong.
Keep Simple
Plugins for specific logic. Use builtins for general tasks.
Test Thoroughly
Test locally before uploading. Use unit tests and integration tests.
Limitations
- Binary size: Max ~50 MB (practical: 10 MB)
- Memory: 256 MB default (or configurable)
- Execution time: 30 seconds default (or configurable)
- Network: No direct network access (use HttpClient builtin instead)
- Filesystem: No direct file access (use Files builtin instead)
Plugins power custom business logic while maintaining security. Next: Learn about Authentication.