Skip to content
mihok-labsPublic

About

Foundational architecture for safe, auditable agentic systems.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Mihok Labs — Stratum

The kernel contract for agentic computing.

Not another agent framework. Not a wrapper. The substrate layer that makes autonomous systems safe, auditable, and composable by design — the thing that needs to exist before more capable systems can be trusted.


The problem

Every current agentic system is an improvisation.

A language model is given tools. It calls them in sequence. Someone writes orchestration code to handle errors. Someone else adds a logging layer. A third person bolts on a permission check before the dangerous operations. The result is a system that works until it doesn't — and when it fails, nobody can say exactly why.

This is not an engineering failure. It is an architectural one.

The operating system solved this problem once before. It imposed a contract between raw hardware capability and the software that wanted to use it: typed system calls, process isolation, auditable permissions, audit trails. That contract made general-purpose computing trustworthy enough to build the world on. Agentic systems need the same thing. We are building it.


Current state

Stratum is runnable. The core pipeline works end to end on a local machine:

# Start the system
./scripts/dev.sh

# Submit an action
npm run stratum -- session create --agent my-agent
npm run stratum -- intent submit --session <id> --action read_file --path /etc/hosts --watch

# Review and resolve escalations
npm run stratum -- escalation list
npm run stratum -- escalation approve <escalation-id>

# Inspect the audit trail
npm run stratum -- audit tail

The following works today:

  • An agent submits an intent — a pre-execution declaration of what it wants to do
  • The reversibility engine classifies it at runtime (Class 0–4) based on execution context
  • Class 0–1 actions pass through immediately
  • Class 3–4 actions escalate to a human for approval before executing
  • The human approves or rejects via the CLI
  • Approved actions execute; rejected actions are cancelled with their dependents
  • Every action is recorded in an append-only audit store
  • Actions can declare dependencies — the orchestrator manages a DAG and resumes blocked work when upstream actions complete or escalations resolve

Architecture

Nine packages in this monorepo:

packages/
├── reversibility/           ← runtime action classifier
├── audit/                   ← append-only event store
├── escalation/              ← human-in-the-loop primitive
├── action-surface/          ← domain-agnostic plugin host
├── action-surface-fs/       ← filesystem domain plugin
├── action-surface-process/  ← process management domain plugin
├── events/                  ← durable event bus daemon (stratum-eventd)
├── orchestrator/            ← DAG-based execution engine (stratum-orchestratord)
└── cli/                     ← developer CLI (stratum)

The reversibility engine

Every action is classified before execution. Classification is runtime, not static — the same action type can produce different classes depending on execution context:

Class Description Policy
0 Pure read — no state change Pass through
1 Local reversible write Pass through
2 Remote write, reversible within window Log and proceed
3 Irreversible, low blast radius Escalate
4 Irreversible, high blast radius Escalate

The classifier is a pure function — no I/O, no side effects. Domain packages register their own classification rules via a runtime registry. Adding a new domain never requires modifying the core classifier.

The action surface

The agent operates on a typed vocabulary of actions rather than raw system calls. The surface is a plugin host — filesystem and process management are first-class plugins, new domains are new packages. Each plugin owns its action types, handlers, context resolution logic, and classification rules.

ActionIntent is an open discriminated union via TypeScript declaration merging. Domain packages extend it without touching the core.

The escalation primitive

Escalation is non-blocking. When a Class 3 or 4 action is submitted, the system parks it immediately and returns a deferred result. The human resolves it at their own pace. The orchestrator resumes the affected branch of the DAG when the resolution event arrives via the event bus.

The orchestrator

The orchestrator manages a dependency graph (DAG) of pending actions per agent session. Independent actions execute concurrently up to a configurable pool size. Dependent actions wait. If an upstream action fails, all dependents are cancelled. If an upstream action escalates, dependents wait until it resolves.

The event bus

A standalone daemon (stratum-eventd) backed by SQLite and delivered via Unix domain sockets. Every significant system event — escalation created, escalation resolved, action executed, audit record — is published to the bus. The workspace surface will subscribe to it for live rendering.

The audit store

Append-only, SQLite-backed. Every action carries a provenance record: which agent, which context, which classification, which human approval if any, execution outcome, and duration. State is a projection of an event log. You can always reconstruct how you got here.


Running locally

Requirements: Node.js 18+, npm, tsx (installed as a dev dependency).

# Clone and install
git clone https://github.com/mihok-labs/stratum
cd stratum
npm install

# Start both daemons
./scripts/dev.sh

# In a second terminal — create a session and submit work
npm run stratum -- session create --agent my-agent

# Read a file (Class 0 — passes immediately)
npm run stratum -- intent submit \
  --session <SESSION_ID> \
  --action read_file \
  --path /etc/hosts \
  --watch

# Delete a file (Class 3 — escalates for approval)
echo "test" > /tmp/test.txt
npm run stratum -- intent submit \
  --session <SESSION_ID> \
  --action delete_file \
  --path /tmp/test.txt \
  --watch

# Approve the escalation
npm run stratum -- escalation list
npm run stratum -- escalation approve <ESCALATION_ID>

# Check the audit trail
npm run stratum -- audit tail

Stored at: ~/.stratum/ — audit database, escalation database, snapshot store, event bus database, and daemon sockets.


CLI reference

stratum session create --agent <name>
stratum intent submit  --session <id> --action <action> [options] [--watch]
stratum intent status  --session <id> [--intent <id>] [--watch]
stratum escalation list    [--limit <n>] [--all]
stratum escalation approve <id>
stratum escalation reject  <id>
stratum escalation clear
stratum audit tail         [--limit <n>]

Supported actions:

read_file        --path <path>
write_file       --path <path>
delete_file      --path <path>
delete_directory --path <path> [--recursive]
move_file        --from <path> --to <path>
rename_file      --path <path> --new-name <name>
chmod            --path <path> --mode <mode>
list_processes
kill_process     --pid <number>

What is not built yet

The workspace surface. The human-visible execution canvas — a spatial board where pending actions are nodes, causal relationships are edges, and escalations surface as interactive decisions. This is the next package.

Capability tokens. Every agent process should hold a narrow, explicitly scoped authority token. Sub-agents should inherit from orchestrators but not exceed them. The architecture anticipates this; the implementation does not yet exist.

The trust model. Permissions should expand as behavior warrants — the OS maintains a behavioral record, the trust model reads from it. The audit store is the data source; the policy engine is not yet written.

Audit store retention. The store grows indefinitely. No archival or pruning strategy exists yet. This is a known operational requirement before production deployment.

Network and IPC action domains. The action surface architecture supports arbitrary domains. Filesystem and process management are validated. Network calls, container operations, and agent-to-agent communication are not yet implemented.


Open problems

The reasoning trace problem. An audit trail that captures what the agent did is tractable. One that captures what the agent understood is not — model internals are opaque, and generated reasoning traces are outputs subject to confabulation. We do not have a satisfying answer here.

Sandboxing inference. If the model runs locally, the OS needs to manage it as a resource — quotas, interruption, rollback. Nobody has solved this cleanly.

Context generalization. ActionContext is a union of domain-specific types. Filesystem and process domains are validated. Whether the abstraction holds for network and IPC domains is an open question.

The boundary between model and scaffolding. How much semantic understanding lives in the model, and how much in the deterministic layers below it? Too much in the scaffolding bypasses the model's reasoning. Too little and the scaffolding cannot catch confident errors.


Contributing

The architecture is not frozen. The implementation is early.

What is most useful right now: people who read this and have a strong opinion about where it is wrong. Open an issue. Disagree publicly. The design will be better for it.

If you want to contribute code, the most productive areas are:

  • The workspace surface package — the last major unbuilt component
  • A network action domain plugin — the next domain validation
  • Capability token design — the security layer the architecture anticipates
  • Audit store retention strategy — operational requirement before production

Narrow and correct is more useful than broad and approximate.


About

Mihok Labs is an independent research and engineering organization working on foundational problems in agentic computing.

We are not funded by the AI industry. We have no interest in making autonomous systems more capable before they are trustworthy. Our north star is the opposite: making the systems that already exist more legible, more auditable, and more genuinely under human control — and building the infrastructure that makes future systems better by default.


This document reflects the current state of the project. It will be updated as the architecture evolves. If it is wrong in specific ways, open an issue.

About

Foundational architecture for safe, auditable agentic systems.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages