kleisli.io

Correctness infrastructure for the agentic era.

Formal methods, type theory, Nix.

The verification layer is missing. Agents generate code faster than any human process can check it. The bottleneck is not skill. It is architecture. Kleisli.IO builds the missing layers.

The verification layer.

  Pos = refined "Pos" Int (x: x > 0);
  Network = Record {
    hostName = String;
    port = Pos;
    interfaces = ListOf (Record { name = String; mtu = Pos; });
  };

  badConfig = {
    hostName = "kleisli.io";
    port = (-1);
    interfaces = [
      { name = "eth0"; mtu = (-50); }
      { name = 42; mtu = 1500; }
      { name = "eth2"; mtu = "big"; }
    ];
  };

  comp = Network.validate badConfig;
  runWith = handlers: state: fx.handle { inherit handlers state; } comp;
strict
error: Type error at .interfaces[1].name: expected string, got int
collecting
2 error(s):
  .interfaces[1].name :: expected string, got int
  .interfaces[2].mtu :: expected int, got string
logging
  fail  .interfaces[1].name : string
  fail  .interfaces[2].mtu : int
$ nix eval --raw -f examples/handler-swap-validation.nix {strict|collecting|logging}examples/handler-swap-validation.nix

One computation. Three handlers. Three semantics. The specification defines what to check; the handler decides how to respond. evalModules bakes halt-on-first into the module system (nixpkgs#367882); swapping it requires forking nixpkgs.

The coordination layer.

kli is the coordination layer. An append-only event log is the specification; a projection is the handler. Privacy redaction, CRDT merges, retention windows — all are handlers over the same log. No central coordinator, because the log doesn't need to know who's reading.

09:14task.createrotate-mesh-credentials
09:14session.joinagent-a
09:16observation12 WireGuard peers regenerated
09:18session.joinagent-b
09:20observationall WireGuardPeers pass under strict handler
09:21tool.calldeploy push 5 machines
09:22observationmesh converged, no runtime coordinator
09:23session.leaveagent-b (graceful)
in production

Kleisli.IO operates the complete technical infrastructure for the Lie-Størmer Center, Norway's national center for mathematics.

Built on the Kleisli stack. Operated from Tromsø.

Lie-Størmer-senteretUiT The Arctic University of NorwayAMTI

Going deeper.

metaBuilderJune 2026

An Experiment in Heterogeneous Software Builds

An experiment report on metaBuilder, a typed builder DSL we built to test whether ornaments are what relate heterogeneous build descriptions, and what held under test once we did.

nixFebruary 2026

Dependent Types in Pure Nix

nix-effects embeds a Martin-Löf Type Theory proof checker in pure Nix. Dependent functions, dependent pairs, identity types with J, cumulative universes, verified extraction of plain Nix functions from proof terms. The whole system runs at nix eval time.

nixFebruary 2026

Trampolining Nix with genericClosure

Nix has no loops and no tail-call optimization. builtins.genericClosure, the package dependency primitive, doubles as a general-purpose trampoline once you break the thunk chain.

Agents write code.
Your team needs to know it is correct.