Architecture Reference

Architecture Overview

Spectorn's launch architecture is gateway-first.

Primary Path

Client / OpenAI-compatible SDK -> spectorn-server -> tenant authentication -> API-key and session policy -> provider/model route resolution -> prompt and model-visible auxiliary scan -> optional recalled-memory scan -> combined prompt scan -> upstream provider -> output scan (JSON or SSE sliding window) -> usage, audit, metrics, self-defense, dashboard/SOC signals

Layers

API Gateway

spectorn-server is the production entry point for customer model traffic. It owns tenant auth, provider routing, model aliases, scan mode/policy, billing/webhooks, dashboard/admin APIs, and readiness checks.

Detection Library

sentinel-core is the Rust analysis library used by the gateway and native/SOC paths. Public docs should describe verified behavior, not static engine-count slogans.

Memory And SOC

GoMCP provides optional memory and SOC/MCP services. Recalled memory is treated as untrusted model-visible content: it is scanned before injection and the resulting combined prompt is scanned again.

Dashboard/Admin

The dashboard and admin surfaces expose product workflows: API keys, providers, model aliases, billing, readiness, audit/self-defense status, and security visibility.

Experimental Runtime Guard

immune is currently an experimental Go runtime guard under gomcp/cmd/immune. Kernel/eBPF enforcement is not a production claim unless a deployment explicitly wires and validates that path.

Detection Cascade

The cascade is qualitative. Requests move through independent controls: protocol/auth/policy, input scanning, memory controls, provider routing, output scanning, and audit/SOC correlation.

Do not publish per-layer percentages or residual floors without a named benchmark corpus, harness, commit, and date.

Production Topology Constraint

The current control plane has process-local state for sessions, signup tokens, rate-limit buckets, usage snapshots, and Stripe webhook de-duplication. Production readiness requires SPECTORN_REPLICA_COUNT=1 until those stores are promoted to shared durable infrastructure.

Spectorn — AI Gateway for LLM Apps | Security & Memory in One API