Post-hoc AI essay detectors fail in both directions at once. Non-native English writers who use formal grammar get falsely flagged by perplexity classifiers all the time, while passing generated prose through a basic paraphrase prompt walks right past those same checks. When an accusation lands, the teacher is staring at a single opaque number and the student can't show they spent three hours actually drafting and revising.
That setup is unfair to honest writers and irritatingly easy to game. Worse, the usual edtech fix of browser lockdowns and continuous webcam recording crosses privacy lines I wanted nothing to do with.
So I built Clio (MIT), an open-source writing studio and authorship auditor that records how an essay was composed inside the browser canvas rather than guessing from finished text, backed by a Pure-Rust verification engine (engine-rust/). Live demo: clio-three.vercel.app.
Two design rules: no spyware, no black-box scores
Before touching any detection math, I wrote down two hard invariants in the codebase.
First, Clio won't use webcams, microphones, or OS-level hooks. It runs inside a standard Next.js 16 + TipTap ProseMirror editor with IndexedDB (ClioDB) offline autosave and Supabase PostgreSQL (7 tables protected by Row Level Security), observing only what happens inside the editor canvas.
Second, there are no opaque percentages on their own. Instead of outputting "84% AI," Clio hands educators a scrubbable Session Replay timeline alongside physical signals inside the document (discrete paste events and keystroke cadence histograms), so a student can actually point to their editing history.
On the Rust side (engine-rust), the compute service enforces #![forbid(unsafe_code)], makes zero outbound network calls, and compares internal engine API keys in constant time using bitwise XOR folding. If Rust isn't running locally (for example, on a serverless preview deployment), a Strangler Fig proxy in Next.js (lib/engine.ts) falls back cleanly to TypeScript.
Four independent verification layers in Pure Rust (Axum 0.8 + Rayon)
Any single detector has an obvious bypass. Instead of betting on one metric, engine-rust evaluates four separate layers.
1. Lexical Winnowing & Containment (src/winnowing.rs)
Raw substring hashing misses edited patches, while comparing global Jaccard similarity misses a copied paragraph buried inside a long original essay. Clio implements Schleimer, Wilkerson, and Aiken's Winnowing algorithm (k = 5, guarantee threshold t = 12, sliding window w = t - k + 1 = 8) over 64-bit FNV-1a shingle hashes with deterministic rightmost tie-breaking:
pub const NOISE_THRESHOLD_K: usize = 5; pub const GUARANTEE_THRESHOLD_T: usize = 12; pub const WINDOW_SIZE_W: usize = GUARANTEE_THRESHOLD_T - NOISE_THRESHOLD_K + 1; Instead of symmetric Jaccard, it computes asymmetric Broder containment C(A, B) = |S(A) ∩ S(B)| / |S(A)|, so lifting 200 words out of a 2,000-word source still flags a 90% collision inside that block without blowing up the index.
2. Parallel MinHash LSH (src/similarity.rs)
To compare an essay against a whole class cohort without O(N^2) full-text scans, similarity.rs computes 128 universal hash permutations in parallel using rayon::prelude::* and buckets candidates with 64x2 Locality-Sensitive Hashing bands.
3. Intrinsic Stylometry & Semantic Projection (src/stylometry.rs, src/semantic.rs)
If a student writes half an essay in their normal voice and pastes generated or ghostwritten paragraphs into the middle, global checks miss the seam. stylometry.rs slides a 250-word window (stride = 50) tracking 50 English function words via Burrows' Delta alongside Yule's length-invariant Characteristic K. Alongside it, semantic.rs projects words and character trigrams into a pure-Rust 64-dimensional vector space with synonym clustering to catch word-swapped paraphrasing.
4. Log-Normal Keystroke Process Telemetry (src/telemetry_advanced.rs)
Human typing roughly follows Log-Normal Inter-Keystroke Interval (IKI) distributions punctured by planning pauses (P-bursts) and backspacing cycles (R-bursts). Macro scripts and typing bots either emit unnaturally uniform intervals or fake randomness with flat uniform jitter.
To avoid pulling C bindings or external crates just to evaluate a normal CDF in the Kolmogorov-Smirnov test (D_KS), telemetry_advanced.rs implements a zero-allocation erf_approx() using Abramowitz & Stegun Formula 7.1.26 (< 1.5e-7 error):
pub struct ProcessAuditResult { pub is_authentic: bool, pub confidence_score: f64, pub p_burst_mean: f64, pub r_burst_mean: f64, pub revision_ratio: f64, pub cognitive_pause_ratio: f64, pub log_mean: f64, pub log_std_dev: f64, pub ks_d_statistic: f64, pub rapid_interval_count: usize, pub valid_interval_count: usize, pub flags: Vec<String>, pub method: String, } Export reports don't spawn headless Chrome or Node PDF wrappers either: src/pdf.rs writes raw ISO 32000-1 PDF 1.4 byte offsets directly in Rust.
Verification & live demo accounts
Right now engine-rust passes 69/69 Cargo tests (cargo clippy --all-targets -- -D warnings clean) and the web tier passes 31/31 security and E2E Playwright QA suites (auto_qa_tests/).
You can click through the live app without registering first at clio-three.vercel.app/login:
- Teacher login (
teacher/ClioTeacher2026!) for Session Replay and similarity reports - Student login (
student/ClioStudent2026!) for the TipTap writing studio (faculty signup invite code:CLIO-FACULTY-2026)
Repo (MIT): github.com/yashh1323/Clio
What browser software still can't stop
There is one boundary Clio deliberately doesn't cross. If someone puts an AI-generated draft on a second monitor and manually types every sentence into the TipTap editor at human speed (pausing occasionally, fixing a typo here and there), no purely web-sandboxed telemetry will catch it reliably. Stopping that requires cameras, keyloggers, or locked-down hardware, which breaks trust with every honest student in the room.


