ALab

Get aterm

ALab / trust

Rust and Lean, checked at compile time.

AI writes code faster than anyone can review it. On a textbook binary search, targo trust check catches two overflows silent in release mode, with counterexamples like arr.len() = 0.

github.com/alabsystems/trust · ALab Academic Use License · written in Rust · signed releases

48/48
Linux AArch64 leaf-arithmetic AOT cases certified with ay and clean; 27/27 tampered rejected.ALab's own measurement, 2026-09-20
0.886x
trust-cg runtime geomean vs LLVM -O3 on x86-64 Linux; all 18 programs’ outputs match.trust-cg 0.7.0, released 2026-11-15 ↗
0 of 18
beat-llvm programs compiling in trust-cg with proof certificates on (larger corpus: 0 of 57).ALab's own measurement, 2026-10-14, Apple M4 Max
measuring
Share of verification checks trust proves automatically on a real Rust crate.

Get trust

macOS, Apple silicon

aterm pkg install trust

Signed prebuilt toolchain (trustc, targo) linked into rustup as trust; runs locally on your machine. Get aterm first. ↗

Linux, Windows, Intel Macs. No current build. The signed trust toolchain is built for Apple-silicon macOS only. ↗

How you use it

Run targo trust check in your crate, or targo trust check file.lean on Lean. One router runs ay, trust-mc and clean, counting proved, failed, runtime-checked and inconclusive checks. --format json gives one row per function; targo trust diff --baseline FILE fails on lost proofs.

Works today

  • Catches integer overflow, division by zero, out-of-bounds indexing, unreachable-code assertions and broken contracts.
  • Lean theorems sit in clean { } blocks beside Rust, one report row per declaration. ↗
  • ty lowers TLA+ to trust-ir and JIT-compiles through trust-cg, with an interpreter fallback. ↗
  • Bare targo build refuses until you name a lane; targo --unverified build builds natively and claims nothing.
  • Opt into the experimental trust-cg backend with targo trust check --backend trust-cg.

Not yet

  • Even a corrected binary search ends Result: FAIL; broader crates can still hit skipped, unsupported or unknown rows.
  • Engine answers are untrusted until clean re-checks them; certifying every proof-authority class is not today’s default.
  • The design: trust-cg proves emitted bytes mean what trust-ir means. Today LLVM and MIR stay on production paths.

not proved: The compiler builds itself with verification off (-Ztrust-verify=off), a defect, not policy; building itself is not proving itself.

Its parts

Parts of trust, sharing trust-ir (its meaning written in Lean), alongside ay, ty, clean and ny.

  • trust-cg

    A proof-oriented backend for AArch64 and x86-64, with bounded RISC-V 64 and WebAssembly; the goal: replace LLVM.

    not proved: Its evidence is not an end-to-end proof of every frontend, optimization and emitted binary. ↗

  • trust-mc

    A bit-precise model checker for Rust on ay: proves an assertion for every input, or gives a counterexample.

    not proved: trust verification of trust-mc itself is enabled but does not pass yet. ↗

  • trust-vc

    Contract verifier on ay: drop trust-vc example’s requires line and it fails with x = 4294967295.

    not proved: Lemmas from NIA, BV, Array and Seq theories are accepted on trust.

  • trust-wp

    A deductive verifier for Rust that proves Creusot-compatible contracts over MIR, on ay.

    not proved: Its #[trusted] standard-library specifications are taken as axioms, not proved. ↗

Follow the work