Skip to main content
The NSP daemon is a single process that runs on the host machine and does four things: it watches for new applications, attaches language-specific probes to them, normalizes their state into structured JSON, and serves that state to your agent over a local HTTP and WebSocket API. This page explains what each of those layers does and how a request travels through the system — so you can reason about latency, debug unexpected behavior, and build agents that use the API efficiently.

System Overview

The diagram below shows the full architecture from your agent’s perspective. Your agent only ever talks to the Agent API layer at the top. Everything beneath it is managed by the daemon.
Native C/C++ process probing is scheduled for release next month. All other layers shown above are available today.

The Four Layers

Each layer has a clearly defined responsibility. Your agent interacts only with the Agent API — the other three layers are transparent.

Agent API

A hardened REST and WebSocket server running on localhost:7842. It handles authentication via the X-Substrate-Key header, enforces rate limits (100 req/s for state reads, 10 req/s for action execution), validates action safety, dispatches actions to the correct runtime, and runs post-action verification. This is the only layer your agent code calls directly.

Process Watcher

Polls all running OS processes every 500ms. When it detects a new process, the runtime detector classifies it as V8, JVM, CLR, or unknown by inspecting the process name, command-line arguments, and loaded modules. Once classified, the probe lifecycle manager spawns a probe task, runs a fast poll loop every 2 seconds, and caches the latest state in memory for instant retrieval.

Runtime Probes

Three language-specific probes extract live semantic state from running processes. The V8 probe connects via Chrome DevTools Protocol (CDP). The JVM probe loads a JVMTI agent and uses JNI reflection. The CLR probe injects a managed bootstrapper via the Windows CLR Hosting API and communicates over a Memory-Mapped File channel. All three normalize their output to the same SSF JSON format.

Semantic Engine

Converts raw runtime data — V8 heap nodes, JVMTI field lists, CLR type trees — into human-readable dot-notation state keys and versioned action schemas. Discovered schemas are persisted to SQLite so that subsequent attachments to the same application skip the discovery phase and reach full confidence much faster.

API Endpoints

The Agent API exposes nine endpoints. All endpoints except /health require the X-Substrate-Key header when authentication is enabled.

Request Lifecycle — GET /state/

When your agent calls GET /substrate/v1/state/{pid}, the request travels through the following stages. The typical total latency is 1–5ms for a cached state read or 50–200ms when requesting a fresh snapshot.
Omit ?fresh=true for the fastest possible response — the cached state is updated every 2 seconds by default and is sufficient for most agent loops. Use fresh=true only when you need the absolute latest state immediately after an action.

Request Lifecycle — POST /action

Action execution passes through an additional safety validation stage before dispatch. The full flow ensures that irreversible actions are never executed on low-confidence state and that the result is verified before your agent moves on.
The safety validation step runs before any dispatch occurs. If your agent submits an irreversible action without a verify_expression, the request is rejected at this stage with a 400 error — the action is never sent to the application.