Skip to content

Tracefold

TraceFold

It asks before the changes it can't put back.

Tracefold holds a checked inverse for an AI agent's change before it lands, in Rust. If the inverse cannot be built, the agent stops and the decision escalates to human approval. Every verdict becomes a tamper-evident receipt verifiable offline.

npm SDK Rust 1.97.1 Lean 4 Proofs Email Discord


Flip one byte, and the verifier says no

┌────────────────────────────────────────────────────────────────────────────┐
│ 🔴 🟡 🟢  tracefold-demo-session — 10s Verification Probe                   │
├────────────────────────────────────────────────────────────────────────────┤
Verify a receipt, flip one byte, verify again

Three files on that terminal: a receipt, a signed checkpoint, a public key. No account, no network call.

  • Valid receipt: verifies instantly and exits 0.
  • Flip exactly one byte: cmp -l confirms the 1-byte diff, and the exact same command exits 7.

▶ View Asciinema Cast (Raw Timings) · Read Offline Verification Mechanics


Quickstart

🌐 Route A: In Your Browser (Zero Install)

Open tracefold.github.io/tracefold/verify.html

Paste a receipt and key. Runs 100% via in-tab WebAssembly (network requests strictly 0).

📦 Route B: Node.js / TypeScript (3 Lines)

npm i @mahirhir/tracefold
import { readFileSync } from "node:fs";
import { verifyReceiptOffline } from "@mahirhir/tracefold";

const key = JSON.parse(readFileSync("key.pub.json", "utf8"));
const result = verifyReceiptOffline(
  readFileSync("commit_receipt.json", "utf8"), key.key_id, key.public_key,
  readFileSync("checkpoint.json", "utf8"), key.key_id, key.public_key
);

console.log(result.valid, result.checks.inclusion); // true "verified"

The Paradigm Shift: Pre-Fact Provenance

Dimension Traditional Post-Hoc Audit Logs TraceFold Pre-Fact Provenance
Execution Order Action executes first $
ightarrow$ Logged afterwards Inverse constructed & checked $
ightarrow$ Action lands
Irreversible Damage Discovered only after system corruption Blocked at the gate; escalates to human approval
Verification Trust Must trust the host/server that produced the log Zero-trust offline verification via standalone WASM
Verdict Precision Binary (Pass/Fail) conflates errors with attacks Tri-state: Verified, Refuted, Unknown/Unparseable

Architecture Flow

[ 01. AI Agent Action ]
         │
         ▼
[ 02. Deterministic Gate ] ──(Cannot build inverse S⁻¹)──► [ 🔴 Halt & Escalate to Human ]
         │
    (Inverse S⁻¹ sealed)
         │
         ▼
[ 03. Action Lands & Receipt Issued ]
         │
         ▼
[ 04. Offline WASM Verifier ] ──► Exit 0 (Verified) / Exit 7 (Refuted)

System Context: Glovrex Digital World (Target Architecture)

TraceFold implements the Deterministic Approval Gate (Layer 3: Mechanical Laws) and the Receipt & Escrow Substrate (Layer 8: Provenance & Receipt) within the broader Glovrex Digital World computing architecture.

Glovrex Target Architecture Vision

Formal Status & Scope Boundaries

Dimension Measured Value Conditions & Scope
Test Floor 2,602 probes 454 suites + SDK 36 passed · fresh clone · 25 Aug 2026
Lean Formal Proofs 117 theorems Lean 4, sorry 0, 12 counterexamples
Open High Holes 0 After 44 adversarial audit rounds
Unmeasured Platforms 3 environments Windows native, OneDrive, SMB

Scope Exclusions (Limits by Design)

Out of Scope Why it cannot be closed from inside
Root or kernel-privileged writes Bypasses the tool entirely at the operating system level
Writes into tool's own state dir A detector living in that directory cannot judge itself
Policies encoding the wrong intent Enforced faithfully; intent correctness is external
▶ Expand Environment, Verification & Technical Specifications

Direct: mahirohirakawa@glovrex.com · Built by Glovrex · Licensed under Apache-2.0

About

It asks before the changes it can't put back. Offline-verifiable receipts, three-valued verdicts.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages