Skip to content
QORECHAIN
Register

Post-Quantum AI Agents

LeashGuard

AI agent that can pay bills, but can’t drain your account; every limit is enforced on‑chain by a post‑quantum signature

Share on X

About

LeashGuard is an autonomous treasury assistant that pays approved invoices and subscriptions. The agent holds no private keys. Instead, it operates under a scoped EVM window and a set of on‑chain spending rules that only the owner’s ML‑DSA‑87 key can modify. Even if the agent’s classical key is stolen, the attacker cannot exceed the per‑transaction limit, the daily cap, or the list of approved payees. Every payment is a hybrid‑signed transaction (secp256k1 + ML‑DSA‑87), and the agent’s decision log is readable on‑chain, making the AI’s behaviour auditable without trusting the model.

How it's made

Phase 1 - Scaffold & Hybrid Signing - Use npx create-qorechain-dapp leashguard to generate a full‑stack app wired to the Diana testnet. - Register an ML‑DSA‑87 key for the agent’s testnet account via the QoreChain SDK and obtain test QOR from the faucet. Phase 2 - On‑Chain Rules - Deploy a Solidity AgentVault contract that stores: - approvedPayees (mapping), - perTxLimit and dailyLimit, - ownerPqcKeyHash (for authorising rule changes). - The vault exposes a payBill(bytes32 invoiceId) function that only the agent’s registered key can call, and only if the payee and amount pass the stored checks. Phase 3 - AI Agent Logic - Write a Node.js (TypeScript) agent that: 1. Fetches pending invoices from an off‑chain source (e.g., a simple JSON file or a mock API). 2. Simulates the payBill call against the vault’s current rules. 3. If the simulation succeeds, signs the transaction with QoreSign (hybrid secp256k1 + ML‑DSA‑87) and broadcasts it. - The agent never sees the owner’s ML‑DSA‑87 private key; it only uses its own derived key, which is scoped by the vault. Phase 4 - Owner Dashboard - A React front‑end (using @qorechain/react and QoreX wallet integration) where the owner can: - Approve or revoke payees. - Adjust limits (per‑tx, daily). - View the agent’s payment history and the on‑chain rule‑change events. Phase 5 - Testing & Q‑Day Drill - Write Foundry tests that prove a stolen classical key cannot change rules or pay an unapproved payee. - For the Q‑Day Drill, register a fresh testnet account as the drill account, store its ECDSA private key on the project page, and during the drill make a normal payBill transaction that is hybrid‑signed. The vault’s rules should cause any attacker‑initiated call (using only the classical key) to revert. What Was Hard - Coordinating the two‑stage signing (classical + PQC) in a headless agent while keeping the user experience smooth. - Designing the vault so that rule changes themselves require an ML‑DSA‑87 signature, preventing a compromised classical key from loosening the leash.

Timeline

LeashGuardPost-Quantum AI Agents

Pushed 1 commit to main

  • 4fb8086 initial commit · GauravKarakoti
LeashGuardPost-Quantum AI Agents

Pushed 1 commit to main

  • 80f950c Scaffolded · GauravKarakoti
LeashGuardPost-Quantum AI Agents

New project.

Comments and questions

  • No comments yet.