Fixed-vocabulary ACLs (KQML, FIPA) couldn't evolve. Free-form JSON and natural language raised every parser to Turing-complete, making correctness undecidable. CBCL is a deterministic context-free language: eight core performatives, runtime dialect extension, and three safety invariants (R1–R3) that preserve DCFL membership under every extension. Verified in Lean 4. Zero sorries.
Early agent communication languages (KQML, FIPA-ACL) shipped a fixed vocabulary. Evolving it required out-of-band agreement. Modern systems went the other way — agents exchange JSON or natural language — and collapsed every formal guarantee in the process.
FIPA-ACL — fixed performatives, rigorous semantics, impossible to extend without a standards body.
JSON over HTTP — unrestricted input, parser differentials, no semantic contract, no safety argument. Every endpoint is a weird-machine.
"Natural language" protocols — an LLM prompt you hope the other agent understands the same way. No decidability, no compositionality, no proof.
Eight core performatives — tell, ask, reply, hello, bye, ok, error, cancel — formally specified and preserved under all extensions.
Runtime dialect definition — agents exchange pattern-template S-expressions to add domain vocabulary. Resource-bounded; core-preserving.
Formal proofs in Lean 4 — 176 machine-checked theorems, 0 sorries, 0 axioms. dcfl_preserved theorem: installing any R1–R3-verified dialect keeps the language in DCFL.
Two agents. Eight performatives. One new dialect, defined at runtime, verified at admission.
tell, admitted by peer.; eight core performatives (hello agent-a agent-b) (tell agent-b "sky is blue") (ask agent-b "colour-of sky") (reply agent-a "blue") (ok msg-42) (error msg-43 "dialect not admitted") (cancel msg-44) (bye agent-b) $ cbcl parse '(tell agent-b "sky is blue")' ✓ well-formed, DCFL, core performative O(n) · linear-time
; a planning dialect, defined at runtime (define planning () "@anuna" (extend propose (?agent ?action ?time) (tell ?agent ("propose" ?action ?time))) (:resource-requirements ((:max-depth 8) (:max-expansion-size 512) (:verification-time-ms 10)))) # An extend clause is a pattern/template rewrite. # No recursion. Resource bounds are part of the dialect itself.
$ cbcl verify planning.scm admission check (Lean-verified) ✓ R1 — no recursion pattern head ≠ template tokens ✓ R2 — resource bounded depth=8, expansion=512, time=10ms ✓ R3 — core preserving no shadowing of 8 core verbs ✓ R4 — signature unsigned accepted; invalid rejected admitted. language class after extension: DCFL parser complexity: O(n) # If any rule fails, the dialect is rejected. # The check itself is decidable — bounded in |δ|² by construction.
agent-a (tell agent-b (meta (define planning …))) agent-b admission: ✓ R1–R3 pass · signature verified installed: dialect planning agent-a (propose agent-b deploy-v2 2026-04-20) agent-b (reply agent-a (ok deploy-v2)) # Peer-to-peer dialect exchange, no central registry. # Both agents converge on the same language, provably.
$ lake build LeanCbcl.SExpr / Message / Dialect ✓ LeanCbcl.Parser / DetParser ✓ LeanCbcl.R1NoRecursion ✓ LeanCbcl.R2ResourceBounds ✓ LeanCbcl.R3CorePreservation ✓ LeanCbcl.Pipeline / TemplateExpansion ✓ total: 176 theorems · 0 sorries · 0 axioms $ lake exe cbcl-parse # verified binary extracted from Lean 17 built-in test cases passed $ cargo test --workspace 833 passed; 19 proptests; 0 failures $ cargo test -p cbcl-parser --test differential Rust ≡ Lean on shared test vectors
Every cbcl interaction reduces to one of eight performatives with a formal meaning. New vocabulary is a dialect over these; it never touches the core. The core is a fixed point.
hello, bye — session controltell, ask, reply — content exchangeok, error, cancel — coordinationDeterministic context-free is the largest class where parsing is decidable in linear time. Unbounded grammars raise parsing to NP or worse and breed weird-machines. cbcl stays in DCFL — by construction, and by proof.
176 machine-checked theorems in Lean 4 prove parser soundness and completeness, R1–R3 verification, pipeline totality, and DCFL preservation under dialect installation. A verified parser binary is extracted from the proofs; a differential harness cross-checks the Rust implementation against it.
Dialects are pattern-template rewrites checked against three safety rules (R1 no-recursion, R2 resource-bounded, R3 core-preserving) at admission, plus an optional R4 signature check. If any rule fails, the dialect is rejected and nothing changes.
No dialect can shadow, rebind, or override a core performative. Proven, not promised.
Pattern and template, no imperative code, no side effects. Just a rewrite rule with resource bounds.
Every dialect declares max-depth, max-expansion-size, and verification-time-ms. The runtime enforces them before admission.
Dialects can carry causal protocols (which message types may follow which) and shape constraints (required parameters, types, depth). Verification is a monotone predicate on the append-only message store — coordination-free per CALM, with a three-valued verdict (Valid / Violation / Unknown) stable under store growth.
One canonical parser. No parser differentials between implementations. Same input, same tree, every time.
no_std + alloc Rust, WASM build, C FFI. Ship it on a microcontroller or a browser.
Agents teach dialects through meta teach messages. Epidemic propagation converges in O(log n) rounds — a 100-agent network in ~2.6 ms. The proof travels with the definition.
Parse a tell in 78 ns. End-to-end pipeline for a simple message: 386 ns. Full R1–R3 verification of a meta define: ~1 µs. Criterion benchmarks, Apple M4.
Signing and hashing use the RFC 9804 canonical S-expression form. Structurally identical messages produce identical bytes — no signature drift across implementations.
IETF Internet-Draft registers the application/cbcl media type. A Nostr transport binding (cbcl-nostr) carries messages and Lightning micropayments over decentralised relays.
sorry is a placeholder for an unfinished proof. Zero sorries means every
theorem in the codebase has a complete, machine-checked proof. 176 theorems across ~5,400 lines of Lean, all discharged, no custom axioms.
no_std + alloc. WASM build for browsers and edge;
C FFI for native embedding; pure-Rust for servers and CLIs.
Eight verbs. Runtime extension. Lean-checked safety. Install the crate, open the proof, ship with a guarantee.
Paper — CBCL: Safe Self-Extending Agent Communication — accepted at the 2026 IEEE S&P LangSec Workshop.
cargo install cbcl-cli