The Fiduciary Axiom

The Architecture of Proof:
Deterministic AI Sovereignty.

"An LLM is the Engine; Railproof is the Track. Without a track, the fastest engine is simply a faster path to derailment."

This definitive documentation provides exhaustive technical specifications for the Railproof Sovereign stack—from sub-millisecond physics audits to the 'Two-Man Rule' governance lifecycle.

Chapter 1

The 10-Layer Sovereign Wall

Railproof orchestrates 10 deterministic layers of safety and governance into a unified VPC sidecar. Every response must clear the stack before egress.

LayerProtocol NameFunctionality
L0Physics Perimeter[HARDENED] // PROOF: Sub-millisecond Benford's Law audit at the network edge; provides a deterministic, physics-based block that cannot be bypassed via prompt injection.
L1Sovereign ProxyOpenAI-compatible gateway; enables seamless, platform-agnostic redirection for all enterprise AI traffic.
L2.1Ingestion Air-Lock[HARDENED] // PROOF: Mandatory Clean-at-Rest scrubbing; PII is discarded and replaced with deterministic [ENTITY_] keys before data reaches the Postgres L6 vault.
L3Redaction CoreMulti-family semantic stripping (Llama 3); removes residual non-tabular PII and contextual identifiers via local reasoning.
L4.5Sector Mastery Jury[v4.0 MASTERY] // PROOF: Universal audit of 23 industry risks (AML, Ghost Precedents, PHI, etc.) via local Lllama 3.2; ensures logic never leaks or hallucinates.
L6Immutable LedgerSHA-256 cryptographic non-repudiation; every safety decision is hashed and logged to create a permanent, verifiable audit trail.
L7.5Self-CorrectionRecursive refinement protocol; identifies reasoning drift and triggers up to 2 autonomous repair attempts before falling back to steered responses.
L8-10Multi-Sig[HARDENED] // PROOF: Cryptographic "Two-Man Rule"; requires Admin Proposal JWT and Auditor Execution JWT to modify any system-level safety threshold.
L9Threat InterceptReal-time SIEM/SOAR signaling; emits instant critical telemetry (PHYSICS_BREACH, REDACTION_STRIKE) for SOC situational awareness.

The Deterministic Ingress-Egress Path

sequenceDiagram participant U as "USER / APP" participant S as "RAILPROOF CORE" participant V as "LOCAL GPU" participant M as "CLOUD ENGINE" U->>S: PROMPT (Authenticated) S->>S: L2.1 Air-Lock (Inbound) S->>M: EGRESS (Masked Context) M-->>S: TOKEN_STREAM S->>V: L0: PHYSICS AUDIT S->>V: L4.5: CONSENSUS JURY alt STABLE S->>U: STREAM_PASS (Zero Lean) else UNSTABLE S->>S: L7.5: SELF-CORRECTION S-->>U: STEERED_RESPONSE end S->>S: L6: IMMUTABLE_LEDGER_WRITE
Chapter 2

L0: The Physics Perimeter

Policy can be gamed; Physics cannot. Railproof anchors its first line of defense in the natural statistical distribution of data.

Benford's Law Detection

Numeric hallucinations follow non-natural distributions. We extract leading significant digits using the deterministic regex:

\b([1-9])\d*(?:\.\d+)?\b

Deviation is calculated against the ideal logarithmic curve: $P(d) = \log_{10}(1 + 1/d)$. If the deviation score exceeds 0.8, the response is instantly stripped at the network egress.

Chapter 3

L8-L10: Multi-Sig Governance

Safety protocols are protected by a cryptographic 'Two-Man Rule' inspired by nuclear security protocols. No admin can lower thresholds unilaterally.

ADMIN (Propounder)

Adjusts thresholds (e.g., set L4.5 to 0.12) and generates a signed Proposal Artifact (JWT). Changes remain inactive and audit-only.

AUDITOR (Executor)

Reviews the proposal, verifies the reasoning log, and executes the Protocol Lock by signing the Admin's JWT artifact.

Non-Repudiation: Every governance action is logged to the governance_ledger, creating an unbreakable chain of custody for every safety policy change.
Chapter 5

Technical Battle Scenarios (L4.5)

Railproof explicates the exact technical logic used to enforce safety across industry-specific payloads.

📈 Finance: Unauthorized Advice

- L2 Context: Regex-based ticker scanning ($TICKER).
- L4.5 Mastery: Auditor identifies "Imperative Financial Direction", "Market Manipulation", and "AML Evasion".
- Enforcement: Universal Finance Master policy checks for fiduciary integrity.

⚖️ Legal: Ghost Precedents

- L2 Context: Sovereign Case-Law RAG verification.
- L4.5 Mastery: Cross-family verification of phantom citations + Jurisdictional check.
- Enforcement: Choice between RAG (Proof) or STRICT (Zero-Trust) safety modes.

🧬 Healthcare: HIPAA PHI Redaction

- L3 Core: Deterministic culling of SSNs and masked PII.
- L4.5 Mastery: Secondary "Semantic Wash" to identify names, diagnoses, and drug interaction risks.
- Enforcement: Dosage Intercept (L0) + Zero-Leak PHI Enforcement.

Chapter 6

Production Infrastructure Specs

Railproof is designed for the modern VPC, deployed as a sovereign sidecar service.

🖥️ Sidecar Logic

- Core: Node.js 22 (Non-Blocking Proxy)
- Real-time: Socket.io v4 (L9 Alerts)
- Compliance: OpenSSL / RS256 JWT

🗄️ Sovereign Vault

- DB: PostgreSQL 15 w/ JSONB
- Isolation: Private 'railnet' bridge driver
- Persistence: L6 Evidence Volumes