About
IN TWO MINUTES
Video: https://youtu.be/KXshdlnHYJA
What Deen has already stopped on QoreChain testnet:
- A poisoned email. Two agents read the same scam. The ordinary one paid the attacker (2BBDAD1B…), Deen paid the real landlord (A31FD259…).
- A stolen agent key that skips Deen. The chain itself refused 0.06 QOR, a payment past the daily cap, and 60 fUSD (A8B6B763…, A578C98A…, 4BC21784…).
- 49 published attacks in DeenBench. A plain memory agent fell for all 49. Deen fell for none.
And every rent payment is read back by QoreChain's own MCP server before Deen calls it paid (05BB7E6A…).
THE PROBLEM
AI agents keep memory between sessions now, and some of them can move money. Put those two together and you get an easy scam. Someone emails your agent to say your landlord has a new account. The agent writes that down. Next month it sends the rent there, because as far as it knows, that's where the landlord gets paid.
It has already happened. A Princeton team planted fake memories in ElizaOS crypto agents and got them to send funds to the attacker, and the fake memories survived across sessions. The human version of the trick, business email compromise, cost about $2.77 billion in 2024 by the FBI's count. Filters that look for suspicious wording keep getting beaten by someone rephrasing.
WHAT DEEN DOES
Your agent can still remember anything. Deen just keeps track of who told it. Every memory is tagged with its source: you, the agent itself, another agent, or the outside world. The tag is set the first time a claim shows up, and repeating the claim a hundred times won't raise it.
A handful of memory slots control where money goes: who gets paid, who approves, and how much. Those slots only accept a memory you signed with your post-quantum key. The agent has no way to make that signature, and neither does a prompt injection. So when the fake email arrives, the agent saves it, tells you about it, and pays your real landlord anyway.
Each payment comes with a signed receipt that says which address was used, why, and which claims were ignored.
WHY QORECHAIN
You can sign with ML-DSA-87 on any chain. Checking that signature inside a contract is where it gets hard, and QoreChain does it natively with the pqcVerify precompile. DeenRegistry also looks up your registered key on chain through pqcKeyStatus, so nobody can hand the contract a key of their own. Memories are encrypted with QoreSeal (ML-KEM-1024). The chain only ever sees salted hashes.
WHAT RAN ON CHAIN
Everything below is on the QoreChain diana testnet.
- DeenRegistry v2: qor1dg0rcjkh35mtedgt3dty69ukwt028aydjgsgzl (EVM 0x6a1e3c4ad78d36bcb50b8b564d179672dea3f48d)
- Deploy: 0x00ec786a442d136f94b8bd6e43ee99f221549c693914a68f60dd6052794e8ec7
- Owner: qor1p5vr9wy9svx08wdk3k8fcnkcexfzv8svr0lpwk
- Agent and relayer: qor129r9vxc52rjydj9378p9j7fux43znnv7p8d4p6
- Owner approval, checked by pqcVerify: 0xb46bad03172b31e6840f165e4c07279d7cab7112b286114b5063489e6bc1c434
- Ordinary agent pays the attacker: 2BBDAD1B8DF42B36994F3666E70FBA9B788A504AB74DAE10119BAFDC772A56A4
- Deen agent pays the landlord: A31FD25957AD1EC213C9568CEF2053ABD0BE66414AF586FB758DDAB5859F0836
- MCP pay, rent sent from the owner's smart account: 371E0200FD878B53A59A4CAA997330A05A67EC19841D3F53BDB91D599E216EF6
- Agent epoch rotation: 0x4515643229c1236eddd3916843bc273f1651fa2fbcc3713c3e21dc141c11897a
You can check it yourself at https://iamharrie-labs.github.io/deen. The Live section reads the registry from testnet in your browser and lets you send your own scam with a forged signature. The chain rejects it with BadSignature. The Encryption section seals your text with QoreSeal to keys read from the chain, then lets you open it as a stranger, flip a byte, or move it to another memory. All three fail.
STATUS
It works on testnet and 85 automated tests pass. I also put together DeenBench, 49 attacks taken from published papers and real fraud cases. A plain memory agent fell for all 49. Deen fell for none. There's an MCP server too, so Claude Desktop or any other MCP client can use Deen as its memory.
The agent can also pay from the owner's smart account with a session key: send only, 23 hours, capped per payment and per day by the chain itself, in QOR and fUSD. The website's owner tools top up the relayer's gas from QoreX through QoreChain's wallet adapter.
An epoch vault keeps each memory about 390 bytes whether one agent can read it or a hundred. Receipts are signed and checked with qorechain-pqc, and the repo has a QoreScan CBOM covering the contract, both accounts' on-chain keys and the testnet endpoints.
What's left: a recorded run with the signature coming from inside the QoreX app, and an audit. And one honest limit: if you sign the attacker's address yourself, Deen can't save you. It will warn you first and tell you where the claim came from.
Code: https://github.com/IamHarrie-Labs/deen
How it's made
ARCHITECTURE
Deen has four parts.
1. DeenRegistry, a Solidity contract. It stores your approvals as salted SHA3-256 hashes and runs every approval through pqcVerify, using the key the chain has on file for you.
2. An encrypted memory vault. Each memory is sealed with QoreSeal to you and to whichever agents you trust right now. The record ID and its hash are part of the encryption, so nobody can edit a stored record or swap in a different one.
3. The agent runtime. It tags each memory with its source, looks up payee and limit slots in the registry, decrypts the approved memory, and checks it against the hash on chain before it pays anyone.
4. An MCP server with five tools: remember, recall, request_approval, pay and security_events. The pay tool has no address field. The agent says who to pay, like "landlord", and Deen fills in the address you signed.
You sign approvals in the QoreX wallet or from the terminal. A relayer sends them to the chain. Its EVM window is scoped to the registry, so if someone steals the relayer key, the registry is the only thing they can call.
KITS AND FEATURES USED
- pqcVerify and pqcKeyStatus precompiles
- QoreSeal (ML-KEM-1024 + X25519 + AES-256-GCM)
- QoreSign ML-DSA-87 message signing
- PQC key registration with proof of possession
- Scoped EVM windows for the relayer
- QoreX wallet for owner approvals
- An MCP server for Claude and other agents, which asks QoreChain's own MCP server (@qorechain/mcp) to confirm every payment on chain before reporting it
- A smart-account session key, so the chain caps what the agent can spend per payment and per day
- qorechain-pqc to sign and check decision receipts
- QoreScan for a CycloneDX CBOM of everything Deen relies on
WHAT WAS HARD
The signed message took me the longest. The text you sign has to include the chain, the registry address, your address, a nonce and a deadline, and the contract has to rebuild the exact same bytes before pqcVerify passes. Get one byte wrong and all you see is BadSignature. No other hint.
Deciding what counts as trust was the other hard part. In my first version, a claim got more weight when more sources repeated it. Then I read the 2026 papers on forged corroboration and summary laundering and realised that's exactly the hole attackers go through. So now a claim's authority is fixed the moment it first appears, and anything built from several memories gets the lowest authority of the bunch. Saying the same thing again only adds another source.
Testnet rules caught me out too. Every EVM transaction on QoreChain needs a registered PQC key and an open EVM window, and scoped windows won't let you create contracts. I had to deploy with a full window and then move the relayer onto a scoped one.