Post-Quantum AI Agents
Writ
An AI agent you can safely give a wallet: it reads anything, but only an order its owner signed can move money.
About
Writ is an AI agent you can safely give a wallet. It can read anything — support tickets, tweets, web pages — and answer anyone. But it can only move money from an order its owner sealed and signed, and the chain caps what it can spend. The problem: the same model that reads untrusted text can be told to pay. In November 2024, Freysa, an agent guarding a $47,000 prize pool, was talked into releasing it — 482 attempts, and the winning message was a sentence. Bybit lost $1.5B to signatures that were valid for the wrong transaction. Prompt filters fail because the model is supposed to read untrusted text; "the agent has no tools" is true only until someone adds one. Writ splits reading from spending. Money moves only from an order signed with the owner's secp256k1 + ML-DSA-87 key, verified against the owner's keys on chain with proof of possession, and sealed to that one agent with ML-KEM-1024, so a captured envelope is useless to anyone else. The agent runs eleven checks in order: open, schema, binding, owner, signature, freshness, replay, payee policy, execution, result decoding, receipt. Then the treasury pays through an ed25519 authenticator the owner linked, and the chain enforces 10 QOR per payment and 25 QOR per day — a limit the agent cannot raise, even if it is compromised. Every payment is written to an EVM contract that verifies the agent's ML-DSA-87 signature with QoreChain's pqcVerify precompile and stores keccak256(signature), so the receipt can be re-verified later without trusting the agent. Before the model sees a public message, a deterministic detector scores it. A high score never reaches the LLM and quarantines the open channel for five minutes; payments are deliberately not paused, so a stranger cannot deny-service the owner. Try it without a wallet: https://heywrit.vercel.app/demo Watch the refusals: https://heywrit.vercel.app/watch
How it's made
Writ is a TypeScript monorepo: a protocol package, an agent service, and a React/Vite console. PROTOCOL (packages/protocol) The order format, canonical JSON (sorted keys, no whitespace), the exact text the owner signs — domain-separated so the signature can never be replayed as a transaction — and twelve refusal codes. Covered by six unit tests. AGENT (apps/agent) A Fastify service that holds an ML-KEM-1024 key on chain and an ed25519 authenticator the owner linked to the treasury. It decodes sealed envelopes, runs the eleven checks, pays through the authenticator with a relayer, then writes a receipt to an EVM contract. A second process runs the judge sandbox with its own owner, treasury, relayer and ledger. CONSOLE (apps/console) The landing page, the no-wallet demo, the /watch injection debugger and the owner console. QoreX signs the order text; keys never leave the wallet. Vercel serves it and proxies chain REST and both agents. CHAIN QoreChain diana testnet. ML-DSA-87 and ML-KEM-1024 registrations, an authenticator with a spending rule (10 QOR/payment, 25 QOR/day, 24 h expiry), and a bounded EVM window. The receipt contract calls the pqcVerify precompile (0x…0A01) and stores the order hash, payee, amount, time and the hash of the accepted signature. WHAT WAS HARD 1. A refused execution can still return code 0, so the agent decodes the authenticator execution event instead of trusting the transaction result. 2. The EVM call's gas must be covered by the Cosmos transaction; receipts now provision 1.9M for a signed 1.5M call. 3. The authenticator rule allowlists exactly one call — ledger.record(...) — so the agent can write receipts and nothing else. 4. Rate limiting had to key on the real client behind Vercel, and the sandbox needed its own relayer so demos cannot drain production. VERIFIED 36 automated tests, including five contract tests against the testnet EVM; a 35-check audit against the live site (npm run audit); real transactions for key registration, the authenticator link, an executed sealed order and on-chain receipts. AI-NATIVE Built with an AI coding agent; the process and the verification are documented in AI_USAGE.md.
Timeline
Pushed 68 commits to main
- 4076112 README: link the QoreChain project page · kaelah971(not counted: no real change)
- 3106409 Add a forced-download route for the demo video · kaelah971
- 87eed7b Demo video: live screen capture instead of slides · kaelah971
- 8c11f97 Serve the demo video from the site (plays inline; the repo link did not open on mobile) · kaelah971
- 392ca17 Demo video: fix the end-card mark, align all scenes to the narration · kaelah971(not counted: no real change)
and 63 more commits
New project.
Comments and questions
- No comments yet.