LiopServer class represents the host-side infrastructure of the Logic-Injection-on-Origin Protocol. It hosts sensitive datasets, enforces cryptographic boundaries, validates incoming WebAssembly or JavaScript logic modules via Guardian AST, and executes them inside isolated V8 sandboxes under strict CPU fuel and memory constraints.
Rather than exposing high-risk REST or SQL query endpoints to remote AI agents, a LiopServer exposes typed Capabilities (Tools). Agents submit compiled computation payloads to execute in-situ, ensuring raw rows never traverse the network.
Server Instantiation & Configuration
Initialize a Data Node by defining its identity and node characteristics:Server Configuration Options
object
required
Canonical identity announced during protocol handshakes.
ServerOptions
Comprehensive security, thread scheduling, and taxonomy configurations.
Defining Capabilities (tool)
Capabilities represent executable analytical tools exposed to the mesh. Define them with typed schemas using Zod:
In-Situ Logic Execution Pipeline
When an agent passes dynamic logic bytecode (.wasm or JavaScript envelopes), the execution lifecycle enforces six distinct layers of defense:
- Layer 1 (Guardian AST): Parses and inspects the abstract syntax tree before execution. Only 14 standard functions from
wasi_snapshot_preview1are permitted. Any attempt to reference unauthorized host symbols aborts immediately. - Layer 2 (V8 Sandbox Isolation): Executes code inside an isolated V8 context where 25 potentially unsafe globals (
process,require,eval,Function,setTimeout,fetch,WebSocket) are replaced with poisoned proxies that immediately trigger memory traps upon access. Eleven native prototypes (Object,Array,Promise, etc.) are frozen usingObject.freezeto satisfy PCI-DSS limits. - Layer 3 (Taint Analyzer): Acorn-based information flow control tracks variable assignments to prevent side-channel derivation of confidential inputs via boolean inference or character-code indexing.
- Layer 4 (Egress PII Shield): Scans outbound data against fuzzy matches, credit card patterns, IBAN formulas, and NER entity detection.
- Layer 5 (Aggregation-First Policy): Enforces that query outputs return summary statistics. Returning raw entity arrays triggers automatic policy rejection.
- Layer 6 (ZK-Receipt Generation): Emits a cryptographic receipt bound to the executed logic digest and dataset hash. Supports HMAC-SHA256 commitments (Mode 0, v1), native Groth16 zero-knowledge proofs over BN254 (Mode 2, v2), and dual-layer ML-DSA-65 post-quantum hybrid receipts (Mode 3, v2.1) configured via tool-level execution policies.
Tool Execution Policies (LogicExecutionPolicy)
Enclaves configure fine-grained Zero-Knowledge and cryptographic parameters per tool by providing an optional policy object during registration:
Exposing Data Resources & Prompts
In addition to executable capabilities,LiopServer exposes schemas, static references, and templated guidance to instruct AI agents.
Publishing Resources
Registering Prompts
Autonomous Prompt Injection (enableZeroShotAutonomy)
Activating autonomous mode injects the liop_blind_analyst system prompt and binds the host Data Dictionary dynamically: