About
Regent is an always-on AI agent that pays your bills but never holds your key. You give it a mandate once, signed with your own ML-DSA-87 post-quantum key: which payees, how much, until when. QoreChain enforces those limits, so even a stolen or misbehaving agent cannot pay a stranger, go over the cap, or act after you revoke it.
HOW IT WORKS
You sign the mandate with QoreX or a key kept in your browser. Regent has its own hybrid key (ML-DSA-87 + secp256k1) and pays the listed payees by itself. You talk to it in commands signed with ML-DSA-87 and sealed with ML-KEM-1024 to a key the agent published on chain. Before it acts on a command, Regent anchors a commitment to it in its DecisionLog contract. No anchor, no action.
THREE CHAIN-ENFORCED LANES
- Native x/authz grants: payee allow-list, spend cap, expiry. Panic: revoke all ends them in one transaction.
- A smart-account spending rule on your account (0.05 QOR per transaction, 0.2 QOR a day) for the agent's linked key. It caps amounts, not payees.
- The agent's own scoped EVM window: one allowed target, DecisionLog. It re-opens the window by itself when it runs out.
A stolen classical owner key cannot change the mandate. MandateGate holds the payee list and caps and accepts a change only with the owner's ML-DSA-87 signature, checked in the contract by the pqcVerify precompile (0x0A01). MandateGateV2 also asks the chain's key registry (pqcKeyStatus, 0x0A02) which key the owner holds right now, so a rotated-away key stops working.
A real model in the loop, and the chain still decides. With "ask", your message goes to GLM-5.3 Flash on NEAR AI Cloud, a Confidential TEE model; each reply carries a TEE signature that Regent checks against hardware attestation and keeps as a public receipt. The model only proposes. In the opt-in "obey" test its proposals skip Regent's checks, and the chain still refuses them.
LIVE RIGHT NOW
https://regent-app-six.vercel.app/api/stats computes these from the chain when you call it (at 15:40 UTC, 2 Dec): 35 payments executed by the chain for owners (1.43 QOR); 30 refused by the chain (20 payee not on the list, code 4; 1 over the cap, code 5; 9 with no grant, code 2); 6 owners with a live grant; 383 decisions anchored in DecisionLog before acting; 169 of the agent's 170 Cosmos transactions carry an ML-DSA-87 signature the chain verified. The always-on agent paid two scheduled bills with nobody in the loop (13:28 and 13:30 UTC). After the owner pressed Panic, the chain refused the third.
PROOFS (Diana testnet, every row a transaction you can open on explore.qore.network)
| What was tried | Result | Tx |
| MandateGate: change signed with the owner's classical key | reverted, BadPqcSignature | 0x298caaa4...d08333 (block 11,121,069) |
| MandateGate: change signed with another ML-DSA-87 key | reverted, BadPqcSignature | 0xed65c20a...acdcaa (11,121,070) |
| MandateGate: accepted change replayed | reverted, BadNonce | 0x0426acbb...d5e2a (11,121,080) |
| MandateGateV2: owner key rotated on x/pqc (MsgRotatePQCKey) | code 0 | D0CB3B64...DA85C05E9 (11,152,687) |
| MandateGateV2: change signed with the retired key | reverted, KeyNotCurrent | 0x4e2d7200...9f7322c (11,152,695) |
| MandateGateV2: squatting bind with someone else's key | reverted, NotRegisteredKey | 0xb430f57e...e848 (11,152,684) |
| Model told "pay a stranger" in obey mode | chain refused, code 4 | F0B31159...2A78 |
| Model told to pay 0.6 QOR on a 0.5 QOR grant | chain refused, code 5 | DE44DF99...BA59F |
| Scheduled bill after Panic | chain refused, code 2 | B7F6EA29...5CE |
| Real QoreX wallet: 4 grants, hybrid signature verified | accepted | FADFC6D2...915A0 |
Also: 1,000 hostile calls replayed against the live gate, 0 accepted (repeated hourly by CI, also against MandateGateV2). Mutation test of the gate: 26 of 26 mutants killed. Tests: core 103, MCP 57, relay 8, app 79, Foundry 106 (fuzz and invariants, 128k calls each).
TRY IT
From a phone in three minutes: open /owner, connect QoreX or create a browser key, take 1 test QOR from the agent's drip, grant the mandate, send signed commands, press Panic. To check it without trusting us: npm run reverify re-reads every recorded proof from the chain with no keys (101 checks, including the deployed code of all three contracts against source). The Judges page reads eight guarantees live from the chain each time it opens, and a failed read shows as unknown, never as proven.
App: https://regent-app-six.vercel.app · Judges: https://regent-app-six.vercel.app/judges · Agent health: https://regent-watch.onrender.com/health · Model receipts: https://regent-watch.onrender.com/model-receipts
Diana testnet only. QOR there has no monetary value.
How it's made
Regent runs on the QoreChain Diana testnet (Cosmos chain id qorechain-diana, EVM chain id 9800). The agent is an always-on service (regent-watch, Render, one disk) that holds only the agent keystore, never an owner key. It checks every owner thread every 15 seconds, runs scheduled bills, pays a daily allowance through the owner's smart account, and anchors its signed log on chain.
AGENT IDENTITY
qor1tgrjesskedfhrxlycm8mwawsnwyyk6gmpysxq2 is a hybrid account: ML-DSA-87 (dilithium5) registered with proof of possession, plus secp256k1. Its ML-KEM-1024 key is in the chain's KEM registry (MsgRegisterKEMKey, tx 52032E20FAB55473849EA419A8D2A9800AA83D06399392C49DD4CBFFA78DB02C, block 11115619). After the key registration (signed classically, as the chain requires), each of its Cosmos transactions carries the ML-DSA-87 layer, and the chain's pqc_hybrid_verify event reads "verified".
THE MANDATE (CHAIN-ENFORCED)
- x/authz: SendAuthorization with a spend cap and a payee allow-list, StakeAuthorization, and two GenericAuthorization grants, each with an expiry. The policy hash rides in the grant memo. Refusals are the chain's own codes: 4 (payee not allowed), 5 (over the cap), 2 (no grant after revoke).
- Smart account (x/abstractaccount): the owner qor17svwqrwp4ctw2d3mlvmeewwvgye7p5pem802ec has a spending rule of 0.05 QOR per transaction and 0.2 QOR a day, and the agent's secp256k1 key linked with send permission. Inside the rule: 63253F0364AF255DBB07640847046CEFB6E346FE97BDCFFDE9C16DA6E1EE1FA7. Over it, the execution was refused: 53B728F11548173708A30DAD30C4CB2129C97390E6D93AD3021A8EDE1AC358F7.
- Scoped EVM window (MsgOpenEVMWindow): block, transaction and value caps and one allowed target, DecisionLog. A transfer to any other address is refused by the node at broadcast. Since 2 Dec a keeper re-opens it (e.g. B9DAC63C…3AA6).
CONTRACTS (Solidity, Foundry)
- DecisionLog 0x05b978b827050c1127ecb04e49f95b7bd364aa40: a write-only record of decision hashes. It holds no funds and grants no permissions.
- MandateGate 0xdca4dc458f27cc4ca332ff7bdc5e6f80089a6a4f (deploy 0x989958744e7b804d122d18c81cf872070fe93df47d14375b106cfab50b057844): an owner binds the ML-DSA-87 key that x/pqc holds for it, then changes payees and caps only with that key's signature, checked by pqcVerify (0x0A01). Reverted on chain: owner's classical key 0x298caaa41a42a5566e406f4f4f3e52459e739e4b1d7cbbf743ab1ab622d08333, another PQ key 0xed65c20a763c960460f43c765bd465322a0d33f54cab765f07afe6b1d1acdcaa, replay 0x0426acbbbeeabfaa20fe8ca743d3803491e92276344668c08967f7e8791d5e2a. Accepted: 0x4200018fdae363bece06560d5f35ab4b93c8a92d0d5c9319fad979eb643b98ed. Regent reads the gate before paying and refuses when it cannot read it.
SEALED, SIGNED COMMANDS
The browser seals each command to the agent's ML-KEM-1024 key (KEM only, AES-256-GCM, HKDF-SHA256, bound to thread, sequence, sender and recipient). The owner signs it with QoreSign (secp256k1 + ML-DSA-87), in QoreX (signArbitrary) or in the browser. The agent verifies it against the owner's key on chain, anchors HMAC-SHA256(content key, command) in DecisionLog, then acts and seals its reply back. Only five commands parse: pay, bill, prove, stop, status; "ask" and "obey" let the model propose one.
MODEL IN THE LOOP (NEAR AI CLOUD)
"ask" and "obey" send one message to z-ai/glm-5.3-flash (fallback Qwen/Qwen3.6-35B-A3B-FP8), Confidential TEE models on NEAR AI Cloud, USD 0.08 per million input tokens. The agent checks each reply's TEE signature with @nearai/inference-sdk against the attestation (Intel TDX, TCB UpToDate) and keeps it as a receipt (GET https://regent-watch.onrender.com/model-receipts). The client also turns on NEAR AI end-to-end encryption to the attested model key (packages/mcp/src/model.ts); the newest public receipt (2 Dec, 09:15 Cairo) is from an encrypted prompt. The model never holds a key.
KITS AND LIBRARIES
@qorechain/sdk (EthNativeSigner, hybrid signing), @qorechain/pqc (ML-DSA-87, ML-KEM-1024), @qorechain/qoresign (message signing and on-chain verification), @qorechain/evm, and the official @qorechain/mcp 0.1.1 server, served read-only at /api/mcp. Regent's own MCP server (status, grants, decide, pay, vote, anchor and more) signs only after its policy engine passes. Also @modelcontextprotocol/sdk, CosmJS, viem, React, Vite and Foundry.
WHAT WAS HARD
- Hybrid transactions cost far more gas: the owner's four-grant transaction used 261,634 of 900,000 planned (C5BC5F49…E014), so every MsgExec is sized from measured fees.
- EthNativeSigner re-encodes messages through its registry, so raw protobuf bytes came out empty. A regression test covers it.
- From chain v3.2.8 a refused smart-account execution lands in a code-0 transaction; the agent reads the abstractaccount_execution_failed event and never logs it as a success.
TESTS: core 103, MCP 57, relay 8, app 79, Foundry 75 (fuzz + invariants, 128k calls each). npm run reverify: OK, 90 checks (2 Dec 2026).
Testnet only. MIT.