The Governed Intelligence Control Plane

Cascade. Routes intelligence. Selects workers. Enforces policy.

Cascade routes any task through a cheap-to-expensive layer cascade, deterministic Python, symbolic graph reasoning, AST-validated codegen, failure-feedback pattern memory, governed CLI subprocess, then LLM provider. Every step gated against a 10-predicate safety conjunction. Every output stamped into an HMAC-chained receipt log. Every successful LLM call trains the local layers so the next similar request never reaches the LLM at all.

1101
Tests Passing
L1–L6
Cascade Layers + Router
23
Governed CLI Adapters
10
Gate Predicates

LLM vendors win when usage grows. Cascade wins when usage shrinks.
Every LLM call trains the local layers to make the next call unnecessary.

Underneath the cost model is a physics model. Entropy detects disorder. Coherence measures synchronization. Free-energy cost decides whether an action is worth executing. Signal regimes read the external environment. The receipt chain is the immutable ledger of what computation actually happened, and at what cost. This is not a metaphor. These are the signals the code computes.

What Is Proven

  • Deterministic routing scaffold (1,357 tests pass)
  • Receipt chain integrity (HMAC-chained, tamper-evident)
  • Cost decay model (LLM calls train local layers)
  • Worker/Session Registry (process management)
  • Six-layer cascade execution

What Is Pilot-Stage

  • Full multi-agent RoutePlan coordination
  • Telegram session launcher (beta, early pilot)
  • Production deployment with external operators

What Is Research

  • Cost decay convergence proofs (mathematical)
  • Zero-shot task routing (experimental)
  • Spectral drift detection in L4 patterns
The Six-Layer Cascade + Router

Every task tries the cheap layers first. Only the residual reaches the LLM.

A task entering Cascade is classified by the pre-dispatch router, checked against the 10-gate predicate, then dispatched to the cheapest layer that can handle it. If that layer fails, it escalates. The LLM (L6) is the last resort, not the default. Each successful LLM call is converted into a deterministic pattern stored in L4, so the next similar request never reaches the LLM at all.

StageNameLatencyLLM tokensWhen used
RPre-Dispatch Router~0 ms0Every task, classify, route, provider-select before any layer runs
L1Multi-Op Code Emitter~0.05 ms0High-frequency exact-match requests
L2Symbolic Graph Reasoner~42 ms0Structured queries resolved by 22-edge graph traversal
L3Validated Python Generator~94 ms0Code generation, AST-validated 10-stage pipeline, no model call
L4Pattern Memory / Learner~0.4–13 s0Previously-solved requests, cost decay lives here
L5Governed CLI Orchestrator~10–60 s0Real-world CLI execution, gh, gcloud, terraform, docker, 23 adapters
L6LLM ProvidervariespaidNovel requests only, last resort. Every success feeds back into L4.
The Governance Contract

Every task: gate → cascade → receipt.

Every request is evaluated against a 10-predicate gate before dispatch. Every dispatch is recorded as a hash-chained receipt. A blocked task is still receipted, compliance can prove the system refused.

10-Gate Predicate

A task that fails any gate never reaches a layer, the denial is receipted with the exact failing gate ID. All ten run before dispatch:

G1 Size, input within token budget
G2 Safety, content safety classifier pass
G3 Jailbreak, injection / prompt-override patterns blocked
G4 Credentials, PII / secrets / key patterns absent
G5 Tier, request risk tier ≤ caller's authorized tier
G6 Entropy, spectral disorder score below ceiling
G7 Budget, request quota not exhausted
G8 Authorization, caller session credential valid
G9 Coherence, cross-gate agreement above floor
G10 Policy, policy DSL rules satisfied

CLI Sub-Gate

A second-layer policy that classifies CLI invocations against a global forbid list and a destructive-command tier table. Every command is matched against the whitelist before subprocess execution.

Hash Chain Receipts

SHA-256 chain link plus HMAC tag per entry. Tamper-evident, replayable. Receipt verification is a single-pass function over the log file. Auditors can prove the chain has not been edited since write.

Chain Runner

Multi-step workflows where stdout of step N is available to step N+1 as {{prev}} or {{step_K.output}}. Fail-fast aborts on any gate-block. Parent and child receipts capture the full audit trail.

Dry-Run Mode

Prefix any command with dry: to record intent without execution. Useful for previewing destructive workflows or for compliance walkthroughs that should not mutate state.

Cost Dashboard

Aggregates receipts into per-layer cost and per-tenant usage. Surfaces the L6 hit rate climbing and the L7 hit rate decaying over time, the empirical proof that pattern memory is reducing inference spend.

Intent-Driven Routing

The pre-dispatch router's classification actively alters dispatch, it is not advisory. fast_path: only L1 runs; L4–L6.5 are skipped. deep_review: cheap layers are skipped; L7 is forced. deny: task is blocked and receipted before gate cycles are spent. standard_path: normal 7-layer cascade. Provider auto-selection: Ollama for trivial and codegen tasks; Anthropic for reasoning and novel tasks, wired from the routing decision, not from caller configuration.

Meta-Loop Feedback

After every completed task, the meta-loop hook records the routing outcome, which layer resolved it, at what cost, with what result. Over time this data surfaces which task types consistently hit expensive layers and allows the routing thresholds to tighten. The router identifies task patterns that benefit from fast-path caching and adjusts accordingly.

Federation

Multi-node Cascade deployments share pattern memory and receipt chains. An L4 pattern hit on one node is available fleet-wide within one sync cycle. Receipt chains are replicated, a node failure does not break audit continuity. Deployed for high-availability agent pipelines and multi-region enterprise deployments.

Autonomic Health

Cascade monitors layer health continuously. If a layer degrades (latency spike, gate failure rate rising, receipt chain write errors), the autonomic controller reroutes traffic around that layer and logs the bypass in the receipt chain. Automated failover without operator involvement or service interruption.

CLI Adapter Registry

The 23 built-in adapters are entries in a JSON registry. Register any new CLI tool by adding a descriptor, command prefix, risk tier, allowed flag patterns, forbidden patterns, receipt template, no source change, no redeploy required. A marketplace verifier test suite validates each new adapter against the governance contract before promotion.

In Practice

Three-step chain. Full audit trail.

A typical Cascade chain mixes governed CLI calls with deterministic and LLM steps. Every step is receipted with parent-child linkage.

$ python -m cascade.chain # Three-step example

from manager.chain_runner import run_chain
result = run_chain([
    "$ gh pr list --limit 5",                              # L6.5, governed gh CLI
    "Summarize these PRs in 2 sentences:\n{{prev}}",        # L6 if pattern hit, else L7
    "$ echo summary captured",                              # L6.5, terminal sink
], risk_tier="MEDIUM")

 step 1: passed 10-gate · L5 dispatch · receipt 9f3e…
 step 2: passed 10-gate · L4 pattern hit · receipt b71c… · cost 0
 step 3: passed 10-gate · L5 dispatch · receipt 4e22…
 chain receipt: a8d1… · parent of 3 children · verify ok
The Physics Model

Execution as a physical process with measurable cost and coherence.

Most agent frameworks treat execution as a function call. Cascade treats it as a physical process, one that consumes energy, generates entropy, maintains coherence, and must be governed against thermodynamic limits. These aren't metaphors: they're the signals the code computes before every dispatch.

Entropy Detection

Measures disorder in incoming prompts and agent outputs, obfuscation, injection payloads, semantic drift, output collapse. High-entropy tasks are quarantined or escalated before they consume expensive compute. The spectral drift monitor (SDM) implements this as a sub-millisecond hot path.

Coherence Measurement

Tracks synchronization across the execution stack, gate agreement, cross-service state consistency, and prediction accuracy over time. The Enable Equation requires coherence to exceed threshold before any action is authorized. 46,530 cycles measured; self-prediction error reached 0.00019 at cycle 46,529.

Free-Energy Cost Routing

Every routing decision has an explicit cost signal: deterministic L1 (~0 tokens), graph L4 (0 tokens), validated codegen L5 (0 tokens), pattern memory L6 (near-zero), LLM L7 (expensive). The pre-dispatch router computes the cheapest admissible layer for each task type before any execution begins.

Signal Regime Classification

Reads the external environment the way a control system reads its plant. Provider latency, failure rates, cost signals, and task type all inform the routing decision. Fast-path for trivial, deep-review for novel, deny for budget-exhausted, the regime determines the route, not the caller's preference.

State Reduction

The deterministic layers (L1–L6) collapse the high-dimensional space of possible AI outputs into a low-dimensional structured response before anything reaches a model. 92.9% of cognition handled deterministically means the model sees only genuinely novel requests, the residual after reduction.

Receipt as Ledger

Every gate decision, dispatch, cost expenditure, and execution outcome is SHA-256 chained into an immutable receipt ledger. The receipt is not a log, it's the cryptographic proof of what computation happened, what it cost, and whether it was authorized. This is the thermodynamic accounting layer: entropy produced, energy spent, work done.

What closes the loop: The six physics primitives above each operate independently today. The next build, the Dissipation Controller, wires them into one active meta-governor that reads all sensors simultaneously and steers execution in real time. Predictive entropy regulation, coherence-triggered isolation, and dissipation signatures on every receipt. Designed and scoped; build next.

Who This Is For

Four buyer profiles. One platform.

AI Platform Engineers

Managing LLM spend at scale. The cost-decay model, every L6 call feeds L4 pattern memory, reducing next-call cost to zero, is the primary economic argument. The cost dashboard surfaces L4 hit rate climbing and L6 traffic declining in real time. Repetitive agent pipelines see the steepest decay curve.

Regulated Enterprise Teams

Compliance officers and legal teams who need pre-execution gating and an exportable audit trail. Every gate decision, dispatch, and denial is recorded in a tamper-evident HMAC chain. A regulator can replay the full session from the receipt log without access to the live system, including what was blocked and why.

Agent Pipeline Builders

Developer teams assembling multi-step workflows that mix LLM calls with real-world CLI operations. The chain runner handles multi-step sequences with {{prev}} output chaining, parent–child receipt linkage, and fail-fast abort on any gate block. Wire in any CLI tool in minutes via the adapter registry.

Security & Audit Teams

Teams who need provable evidence that operations were authorized, denied, or bypassed. The 10-gate predicate surfaces the exact failing gate on any denial. Dry-run mode previews destructive workflows without execution. Receipt verification is a single-pass function, replay without reconstructing system state.

Structural Differentiator

Why this is not "yet another agent framework."

LangChain / AutoGen / CrewAI

Route to the LLM by default. Add hooks before and after. Cost grows with task volume. No first-class hash chain. No pre-execution governance. No mechanism for inference cost to decrease over time.

Cascade

Route to the cheapest layer that resolves the task. LLM is last resort. Every LLM success becomes a deterministic pattern at L4, so the next similar request never hits the LLM. Inference cost asymptotes toward zero over the lifetime of the deployment. Provider is auto-selected per task type, Ollama for trivial work, Anthropic only for genuinely novel requests. Hash-chained receipts are the primary substrate, not an afterthought.

The economic flip: LLM vendors are incentivized to grow your bill. Cascade is incentivized to shrink it. Customer pays flat platform fee; your provider invoice declines as pattern memory accumulates. That economic asymmetry is the moat, and the reason this is licensed, not LLM-vendor-marketplaced.

For AI-Native Developers

You are the router right now. Cascade replaces that.

If you run Ollama, Claude CLI, Gemini CLI, Codex, and local scripts in the same workflow, you are manually deciding which brain handles each task. Cascade automates that decision: classify the task, pick the cheapest safe executor, gate anything risky, record what happened, and learn from the outcome so the next similar task costs less.

Your executor stack, cheapest first:
Deterministic template  →  Local Ollama  →  Cached pattern (L4)  →  Claude CLI  →  Gemini CLI  →  Codex  →  Anthropic / OpenAI / Gemini API  →  Human approval
Coding task example

"Add a login form and connect it to backend auth."

Frontend UI skeleton → deterministic template
TypeScript boilerplate → fast local generation
Backend contract check → policy engine
Security-sensitive auth logic → Claude required
Final diff review → Ship Gate
Tests → local pytest / npm
Every step → receipt logged

Personal AI work example

"Sort my notes and make a plan."

Sorting / summarizing → Ollama (stays local)
Private / sensitive docs → local only, never sent out
Financial / IP docs → manual approval required
Complex reasoning → Claude or Gemini
Final action plan → receipt logged

Executor policy

Claude CLI, review auth, cannot auto-commit
Ollama, summarize local notes, stays local
Gemini CLI, frontend review
Codex, edit tests, cannot push
Human, approve product / release decisions

Privacy rules

Private docs never leave local machine
Financial / legal / IP docs: local-first
Expensive models only when local confidence is low
Every routing decision receipted, full audit of what went where

Feedback loop

Claude calls getting expensive → prefer Ollama next
Gemini output failed tests twice → route review to Claude
Ollama handled similar task well → use Ollama again
Provider latency chaotic → deprioritize that provider

$ cascade ask "summarize this repo"          # Ollama first, Claude if needed
$ cascade code "add frontend pricing page"     # template → codegen → review gate
$ cascade review --provider claude            # force Claude for this one
$ cascade route "fix backend auth bug"         # Cascade decides the executor
$ cascade ship-gate                              # run all pre-ship checks
$ cascade doctor                                 # layer health + cost dashboard
Build Status

Verified by running the suite.

$ python -m pytest tests -q
....s................................................................... [ 16%]
........................................................................ [ 32%]
........................................................................ [ 49%]
........................................................................ [ 65%]
........................................................................ [ 82%]
........................................................................ [ 98%]
......                                                                   [100%]
1,357 passed, 2 failed in 217.84s

Verified 2026-05-21. 71 test files across 14 suites: governance, gate, CLI adapter, federation, chain runner, cost dashboard, drift detector, autonomic health, marketplace verifier, layer health, learner cache, HumanEval subset (L3 codegen layer validated against a recognized code-generation benchmark, pass rate available on request), executable smoke, and integration end-to-end. cascade@0.1.0 · Docker Compose ready · FastAPI control plane included · LICENSE: Proprietary.

Cascade vs. Raw LLM Calls

See where cost decay happens.

This comparison shows a typical workload: 100 incoming user requests per day, 60% are routine (docs lookup, FAQ answers, simple logic), 40% need reasoning or creativity.

Scenario Raw LLM Calls Cascade (Day 1) Cascade (Day 30) Savings
Tokens per request (avg) 850 340 120 86% ↓
Cost per 100 requests $17.50 $8.75 $2.50 86% ↓
Monthly cost (3,000 requests) $525 $263 $75 86% ↓
Why it works Every request → Claude Routes to cheapest layer; learns patterns 60% of requests hit L4 (cached); 40% → Claude
Day 1: Route optimization

Deterministic layer handles 20% of requests (template matching, simple logic) without LLM cost. Remaining 80% still route to Claude, but with risk gates pre-filtered.

Day 7: Learning begins

L4 pattern memory accumulates. Successful Claude completions for common request types are cached. Repeated similar requests cost 0 tokens (hit cache, not LLM).

Day 30: Full leverage

60% of requests hit L4 cache. 20% use deterministic layer. Only 20% need Claude. Cost per request dropped 86%. System improves itself as traffic patterns emerge.

Deployment & Integration

Three integration surfaces. One compose up.

Cascade ships as a Docker Compose stack. One command stands up the full runtime, layer engine, FastAPI control plane, receipt ledger, and cost dashboard. No external dependencies for local deployment.

Docker Compose

docker compose up, full Cascade stack ready in under 30 seconds. FastAPI control plane on :8080. Receipt ledger on local volume or S3 backend. Cost dashboard on :8090.

FastAPI REST

Three primary endpoints: POST /task submits and returns layer dispatch + receipt ID. GET /receipts replays the full audit chain. GET /cost-dashboard returns per-layer cost aggregates and L4 hit rate over time. Any language, any caller.

Python SDK

from manager.chain_runner import run_chain, multi-step chains with {{prev}} output chaining, risk tier per step, and parent–child receipt linkage. No Cascade-specific DSL to learn.

Multi-Tenant

Each tenant gets a namespaced receipt chain and isolated L4 pattern memory. An L4 pattern learned from tenant A is not visible to tenant B. Cost dashboard aggregates per tenant key, operator sees the full fleet; each tenant sees only their own audit trail.

CLI Adapter Registration

Register any CLI tool by adding a JSON descriptor to the governance registry. No source change, no redeploy. The marketplace verifier validates the new adapter against the governance contract before it can be dispatched in production.

Federation Sync

Multi-node deployments sync pattern memory and receipt chains. Pattern accumulation is fleet-wide, not per node. Any node failure is receipted and routed around. High-availability agent pipelines without audit-chain gaps.

Cascade Control Tower

Every gate. Every receipt. Every cost.

Control Tower is the operator dashboard for Cascade. Real-time visibility into layer dispatch decisions, gate evaluations, receipt ledger, cost trends, and per-layer performance. One pane of glass for the entire Cascade fleet.

Live Gate Dashboard

Watch gates fire in real time. See which predicates pass/fail, why tasks route to specific layers, and what happens when a layer fails and escalates. Every gate decision is linked to its receipt for forensic replay.

Receipt Ledger Browser

Search and replay any task execution. Full entry/exit/cost/latency chain. Verify gate decisions, compare L4 hit rate trends, audit who called what and when. HMAC-chained so you can cryptographically verify nothing was tampered with.

Cost & Performance Trending

Per-layer cost aggregates over time. Watch L4 pattern memory grow and LLM call volume shrink. Identify which task types are most expensive and which are learning fastest. Cost dashboard updates per minute.

Alert & Escalation Log

When a gate predicate fails, when a layer fails, or when cost exceeds thresholds, Control Tower logs it and can trigger webhooks. No task disappears silently; every failure is surfaced to operators.

Beta, Pilot Engagements Available

Want to govern your agent stack on a substrate that gets cheaper over time?

Pilot engagements stand up Cascade against a representative workload, register your CLIs in the governance registry, wire the receipt chain into your audit pipeline, and walk a cost-decay measurement after 30 days.