Skip to content

Tracefold

TraceFold

AI agents should not make irreversible changes. TraceFold escrows the inverse before an effect lands — or refuses the effect — and issues receipts anyone can verify offline.

Not an observability tool. It sits before the effect.

See the Scope Exclusions table below and docs/LIMITS.md for what this does not cover.

Zenodo DOI npm SDK Rust 1.97.1 Lean 4 Proofs Email Discord Support Tracefold


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

Reproduction: examples/demo_one_screen.sh runs the longer, 8-stage version of the same idea end to end — commit → receipt → tamper → verify → undo → redo — against a real cloned repository, not a fixture.


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 (Paper DOI: 10.5281/zenodo.22168558).

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 154 theorems Lean 4, 14 files: 154 theorems, 14 of them counterexamples, 1 axiom, sorry 0, recounted 1 Sep 2026 with the attribute-aware predicate (SS1001-consistent; see docs/LIMITS.md item 8)
Open High Holes 0 Out of 44 adversarial audit rounds, same 25 Aug 2026 table/commit as above (not independently re-dated by this pass)
Unmeasured Platforms 3 environments Windows native, OneDrive, SMB

Deliberately absent: no CI/build badge on this page, and the honest reason is worse than not having one. GitHub Actions has run zero jobs on any push since the account went billing-blocked at 2026-08-15T17:25:29Z (req/908) — not because of a code defect, but a green tick here would not mean what a green tick usually means while that stays true. The last time CI ran (commit f65aac2f), it covered 16 of this project's 17 workspace crates automatically; the TypeScript SDK's tests have never run under CI at all. See docs/LIMITS.md item 8 for the full, dated detail (checked current as of 2026-09-01).

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

Writing


Support

Everything shipped here is free — verification, receipts, self-hosting — and stays free for as long as a single person uses it. Nothing is for sale, and paying changes nothing about what you get.

If you want to fund the work anyway, there is exactly one channel:

Support TraceFold — pay what you want, via Stripe

Changed from Polar to Stripe on 1 Sep 2026 (the Polar checkout account's onboarding was not finishing). Nothing is promised in return either way.


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

About

AI agents should not make irreversible changes. TraceFold escrows the inverse before an effect lands, or refuses it, and issues receipts anyone can verify offline.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages