Skip to main content
The LIOP SDK provides two runtime interceptor hooks designed for telemetry, anomaly detection, and regulatory compliance:
  • LogInterceptor: Intercepts operational log events emitted by LiopLogger (transports, peer-to-peer gossip, routing).
  • AuditInterceptor: Intercepts cryptographic audit entries emitted by AuditLogger after hash sealing (SOC 2 Type II and HIPAA compliance).
Both hooks operate out-of-band using an asynchronous fire-and-forget execution model, ensuring that external analysis or network latency never degrades core protocol throughput.

Interceptor Architecture

LIOP Protocol Interceptor ArchitectureLIOP Protocol Interceptor Architecture

Operational Log Interceptor (LogInterceptor)

LiopLogger emits structured log messages exclusively to stderr to adhere to MCP stdio stream separation constraints (reserving stdout strictly for JSON-RPC framing). The LogInterceptor hook enables developers to forward, analyze, or filter these messages programmatically.

Contract Definition

Registration and Lifecycle

The interceptor is registered directly on the LiopLogger singleton instance:

Recursion Guard

If an interceptor implementation invokes code that triggers LiopLogger (directly or through dependencies), an infinite re-entrant loop could trigger a stack overflow. LiopLogger maintains an internal re-entrancy flag (_isIntercepting) that suppresses recursive interceptor dispatch within the same call frame while preserving normal stderr output.

Cryptographic Audit Interceptor (AuditInterceptor)

AuditLogger records immutable execution traces for every Logic-on-Origin workload. Each AuditEntry is cryptographically bound to its predecessor via SHA-256 hash chaining (prevEntryHash and entryHash), forming an unalterable audit ledger.

Contract Definition

Post-Seal Invariant

The AuditInterceptor hook executes strictly after the audit entry has been sealed:
  1. The SHA-256 hash of the entry is calculated and verified.
  2. The hash chain pointer (lastEntryHash) is updated.
  3. The entry is persisted to the local JSONL ledger file (if configured).
  4. The interceptor receives an immutable deep clone created via Object.freeze(structuredClone(fullEntry)).
Mutations attempted by the interceptor throw in strict mode and cannot alter the stored hash chain or affect downstream verification.

Integration Examples

Example 1: External Threat Detection with TypeSafe Jev

Forwarding internal log streams or execution exceptions to external cloud services such as TypeSafe Jev is not recommended in production. Log messages frequently contain infrastructure paths, query metadata, or partial error traces. Transmitting this operational telemetry to third-party endpoints compromises infrastructure privacy, incurs per-call financial overhead, and introduces remote availability dependencies. For production deployments, use local in-process models (Example 3) or internal SIEM collectors (Example 2).
In development environments permitting outbound telemetry, operational error logs can be evaluated via cloud classification:

Example 2: Compliance Event Streaming to SIEM

Stream sealed audit entries to an external SOC 2 aggregator:

Example 3: Zero-Egress Threat Monitoring with Local ONNX (LogInterceptor)

In air-gapped enclaves where outbound network calls to cloud classifiers are prohibited, LogInterceptor can evaluate error patterns using a local ONNX runtime:

Example 4: Local Cryptographic Audit Ledger Bridge (AuditInterceptor)

Process sealed audit entries locally to detect unusual execution patterns or trigger local compliance storage:

Universal Out-of-Band Deployment

Unlike GatewayInterceptor (which is strictly restricted to perimeter gateways), LogInterceptor and AuditInterceptor can and should be deployed on EVERY node across all tiers: Because both hooks execute asynchronously via fire-and-forget (Promise.resolve().then(...) or un-awaited fetch()), external inference latency or remote SIEM outages introduce exactly 0 ms of delay to client RPC responses or host sandbox evaluation.
LIOP Interceptor Topology (Light)LIOP Interceptor Topology (Dark)

LIOP Interceptor Topology: Demarcation between Ingress Admission and Enclave Isolation


Security Model Comparison

LIOP defines three complementary interceptor hooks. None replace or compromise the 6 security layers of The Shield: