Loops HousePreflight

NEAR HACKATHON
Team
1 member- COOwner
Cole Williams
Overview
One NEAR address, two answers. Open https://wonkared.github.io/preflight/. The demo contract starts on its fixed build; both checks say ALLOW. Click "Swap in the bad code": a real testnet transaction, no wallet, puts a vulnerable build behind the same address. A check that trusts the address still says ALLOW. Preflight hashes the live code, looks up its verdict in an on-chain registry, and says BLOCK. Click "Rob it": a real transaction forges a balance on the vulnerable build; the fixed build refuses it on chain.
(1) A scanner for NEAR Rust contracts: 26 rules, each backed by a sandbox exploit. It flagged a live bug in a mainnet NEAR contract: reproduced in a sandbox, reported privately (SHA-256 8742cf58), details after a fix. (2) A registry contract storing a verdict under the SHA-256 of the deployed wasm; only allowlisted auditors write. (3) A guard in the agent, also an MCP server: it hashes the deployed code, checks the registry, refuses on block, asks a human on warn.
A second check needs no auditor: the guard reads who can replace a contract's code and pins its fingerprint, so it warns or blocks if the code changes after approval.
On testnet a local Qwen3.8-27B fine-tune was the agent. A page I wrote (reworded 5 times first) told it to call two other contracts; it followed in 8 of 10 runs; of the 16 injected calls the guard blocked 8 and held 8 for a human; none was signed.
Limits. The scan is syntactic: of 90 findings on the 14 repos it was tuned on, 10 are real bugs, 65 real but guarded elsewhere, 15 wrong; on 8 held-out repos, 20 of 57 are wrong. One model, testnet only. The registry's auditor here is my own account, so the Swap shows what each check keys on, not that a verdict is right. The code-change check is off by default and sees a change only after first approval; zero full-access keys does not mean fixed code.
All code was written by AI agents (Claude), directed by one human. My other entry, $CHAIR (a memecoin), shares no code.