Epistemic Kernel
Epistemic Kernel
Foundational Architecture for Trust-Aware Multi-Agent Systems
The Epistemic Kernel is a broker daemon that enforces a strict structural distinction between fact and belief in multi-agent LLM systems. It is the first buildable slice of a ground-up “AI OS” — applying traditional kernel principles (mediate access to shared resources) to the substrate of truth rather than memory/CPU.
Core Concept
Multi-agent LLM systems today have no structural distinction between fact and belief. Agent A summarizes something, Agent B treats the summary as ground truth, Agent C builds on B’s already-corrupted belief — and by the fourth hop nobody can trace where the error entered.
The Epistemic Kernel solves this by enforcing one invariant everywhere:
A process may act on another process’s belief, but it can never receive that belief as if it were an attested fact.
This is achieved through a real Linux privilege boundary plus a Rust type system that makes the fact/belief distinction impossible to accidentally erase.
Architecture Overview
┌────────────────────────────┐
│ Broker Daemon │
│ (owns Unix socket, owns │
│ the only Attested ctor) │
│ │
│ ┌────────────┐ ┌──────────┐│
│ │ Provenance │ │ Attestor ││
│ │ Store │ │ Registry ││
│ │ (TTL sweep)│ │(pluggable)││
│ └────────────┘ └──────────┘│
└──────────────┬───────────────┘
│ Unix domain socket
│ (request/response protocol)
┌─────────────────┼─────────────────┐
│ │ │
┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐
│ Agent A │ │ Agent B │ │ Agent C │
│ (client SDK)│ │(client SDK)│ │(client SDK)│
└────────────┘ └────────────┘ └────────────┘
Components
| Component | Purpose |
|---|---|
ek-provenance | Rust crate defining Provenance, Tagged<T>, upgrade/downgrade functions, serialization |
ek-broker | Daemon owning the socket, store, attestor registry, TTL sweeper |
ek-sdk | Client SDK crate for agents to communicate with the broker |
ek-attestors | Pluggable trait Attestor + filesystem implementation for MVP |
ek-demo | Scripted fake agents exercising the system for acceptance testing |
Provenance Type System
The core innovation is a type system that distinguishes three categories:
- Attested: State whose provenance traces to a real, broker-verified source (file, sensor, direct process output)
- Belief: State derived/inferred by an agent (a model), never directly ground truth
- Synthesized: Generated artifacts (image, audio, self-authored tool) — neither a fact nor an inference about the world
Key rule: Provenance::Attested has no public constructor outside ek-broker. Every other crate can only build Believed or Synthesized, and building Believed always requires wrapping an existing Provenance (never fabricating one from nothing).
Key Invariants (The Constitution)
The Epistemic Kernel enforces these non-negotiable rules:
| Rule | Description |
|---|---|
| R1 | Sole constructor: Only ek-broker can construct Provenance::Attested |
| R2 | No silent stripping: Cannot discard provenance tag while keeping the value |
| R3 | No flattening: Belief provenance must nest, never replace with fresh tag |
| R4 | Mandatory revalidation: Every attested fact must be re-checkable via Attest |
| R5 | TTL on beliefs: Expired beliefs are inaccessible until re-derived |
| R6 | No direct cross-agent access: All state crosses boundary through broker protocol only |
| R7 | Reject forged attestation: Broker rejects agent claims of Attested provenance |
| R8 | Traceable by construction: Can always walk belief back to real Attested leaf |
| R9 | No amnesty by age: Retained beliefs always expose staleness, never upgrade to attested |
| R17 | Rate-bounded requests: Per-agent request-rate limiting to prevent abuse |
| R18 | Crash-safe writes: Atomic operations survive unclean shutdowns without corruption |
MVP Definition
The MVP is not a full OS. It is:
- A broker daemon (single OS process, async runtime) that owns a Unix domain socket
- A provenance type library (Rust crate) where
Attestedvalues can only be constructed inside the broker - A client SDK crate that agent processes use to talk to the broker over the socket
- A pluggable attestor interface with filesystem facts implementation for MVP
- A belief store with TTL-based expiry
- A demo with 2-3 toy agent processes proving the broker’s guarantees
Explicitly out of scope for MVP: multi-machine distribution, process-level UID isolation, semantic filesystem, scheduler/context-window economy, GUI, LLM integration.
Roadmap
| Phase | Description |
|---|---|
| Phase 0 | Spec, requirements, rules — COMPLETE |
| Phase 1 | ek-provenance crate — types, constructors, visibility rules, serialization |
| Phase 2 | ek-broker skeleton — socket, connection handling, in-memory belief store, protocol enforcement |
| Phase 3 | ek-attestors — trait + filesystem implementation |
| Phase 4 | Persistence + TTL — persistent store, background sweep, retained beliefs, Promote request |
| Phase 5 | ek-sdk — ergonomic async client wrapper |
| Phase 6 | ek-demo — scripted agents, acceptance tests |
| Phase 7 | Stretch: process-level UID/cgroup isolation, multi-machine transport, second attestor backend |
Documentation
Core Documentation
→ Epistemic Kernel Full Specification — Complete technical specification including protocol details, data model, functional requirements, and non-functional requirements
→ Future Directions & Hardware Tiers — Exploratory document covering hardware tiers (T0-T5), functional expansion ideas, ambient device ecosystem, security & threat model, multi-user identity, and open questions
→ dream.sh Memory Consolidation — Aurora’s memory consolidation script demonstrating provenance tracking principles aligned with the Epistemic Kernel
Quick Reference
| Component | Description |
|---|---|
ek-provenance | Rust crate defining Provenance, Tagged<T>, upgrade/downgrade functions |
ek-broker | Daemon owning the socket, store, attestor registry, TTL sweeper |
ek-sdk | Client SDK crate for agents |
ek-attestors | Pluggable trait Attestor + filesystem implementation |
ek-demo | Scripted fake agents for acceptance testing |
Relationship to Aurora
Relationship to Aurora
The Epistemic Kernel serves as foundational architecture for Aurora’s memory and provenance systems. It provides the trust boundaries and provenance tracking that enable Aurora to maintain transparency about what she knows and how she knows it — a core principle in her design.
For more about Aurora, see Aurora’s self-documentation