Verification

You can't verify whether your AI's output is correct, complete, or safe.

LeanCTX produces proof-carrying outputs. Policy invariants are formally verified in Lean4 with 82 machine-checked theorems. Every context decision generates an auditable trail with pipeline metrics and provenance chains. Outputs are checked for valid paths, correct identifiers, and structural integrity. Claim-based verification decomposes proofs into atomic, verifiable units with Quality Levels 0-4.

The Problem

Shipping Unaudited AI Work

AI agents hallucinate file paths, generate broken imports, leak secrets into outputs, and produce changes that nobody can trace back to their context. Without verification, you are shipping unaudited AI work.

ctx_verify checks every output for hallucinated paths, broken imports, and secret leaks. ctx_proof generates ContextProofV2 reports with claim-level verification and Lean4-backed formal guarantees.

ctx_verify
ctx_verify ({ scope: "session" })
- Verified 12 tool calls
- Paths: 12/12 valid
- Secrets: 0 detected
- Replay hash: a3f8c2...consistent
Verification

8 tools

01

Lean4 Formal Proofs

82 machine-checked theorems across 3 domains: Policy invariants, compression preservation, and agent handoff safety — all verified in Lean4 with zero sorry.

02

Claim-based Verification

ContextProofV2 decomposes verification into atomic claims. Each claim is routed to the appropriate verifier — from deterministic checks to Lean4 proofs.

03

Quality Levels 0–4

Five assurance tiers: Provenance (Q0), Deterministic (Q1), Tested (Q2), Policy Proved (Q3), Formally Verified (Q4). Every output carries its exact trust level.

04

Proof Artifacts

JSON and HTML proof reports with pipeline metrics, SLO snapshots, and provenance chains.

05

Output Checks

Path and identifier preservation as the quality gate mechanism. Structure verification with WARN/FAIL semantics ensures no valid paths or identifiers are lost during compression.

06

Compression Invariants

4-layer compression engine with quality gate — formally proven: signatures mode preserves all exports, map mode preserves imports, aggressive mode leaks zero secrets. 82 Lean4 theorems, 0 sorry.

07

Replayability

Deterministic sessions with replay hashes, CI gates, and regression detection.

08

Agent Handoff Safety

State machine formally verified in Lean4. Terminal states are sinks, lifecycle ordering is monotonic, invalid envelopes are rejected.

Live Demo

See it in action

LeanCTX produces proof-carrying outputs. Policy invariants are formally verified in Lean4 with 82 machine-checked theorems. Every context decision generates an auditable trail with pipeline metrics and provenance chains. Outputs are checked for valid paths, correct identifiers, and structural integrity. Claim-based verification decomposes proofs into atomic, verifiable units with Quality Levels 0-4.

ctx_proof
ctx_proof ({ format: "v2" })
- ContextProofV2 · 6 claims extracted
- PathJail: proved (Lean4) · Q4
- Budget: proved (Lean4) · Q4
- Secrets: passed (deterministic) · Q2
- Scope: proved (Lean4) · Q4
- Compression: signatures preserved · Q3
- Quality Level: 4 (Formally Verified)
82 Lean4 Theorems
Q0–Q4 Quality Levels
0 sorry (unproven)
tools

7 MCP tools

LeanCTX produces proof-carrying outputs. Policy invariants are formally verified in Lean4 with 82 machine-checked theorems. Every context decision generates an auditable trail with pipeline metrics and provenance chains. Outputs are checked for valid paths, correct identifiers, and structural integrity. Claim-based verification decomposes proofs into atomic, verifiable units with Quality Levels 0-4.

Verification

Related Documentation

Verification

Every output carries proof

LeanCTX generates proof artifacts for every session: which files were read, what was compressed, which checks passed, and how tokens were spent. This makes AI work auditable, replayable, and trustworthy.

Explore Verification Tools

LeanCTX produces proof-carrying outputs. Policy invariants are formally verified in Lean4 with 82 machine-checked theorems. Every context decision generates an auditable trail with pipeline metrics and provenance chains. Outputs are checked for valid paths, correct identifiers, and structural integrity. Claim-based verification decomposes proofs into atomic, verifiable units with Quality Levels 0-4.