Skip to main content
Glama

QoreGuard

A wallet your AI agent can use but cannot abuse. QoreGuard is an MCP server that lets an AI agent (Claude Code, Claude Desktop, any MCP client) pay for things from your QoreChain account. The limits are enforced by QoreChain and by a contract, not by the agent or the server, and every instruction between you and the agent is signed with ML-DSA-87 (FIPS 204), the post-quantum signature QoreChain uses.

  • Dashboard: {{APP_URL}}

  • Demo video: {{VIDEO_URL}}

  • Contract: QoreGuard at 0xA279D4c67483cc04497E9A88834c9AF7614f91D5 on the QoreChain testnet (qorechain-diana, EVM 9800)

  • Track: Post-Quantum AI Agents · Build Before Q-Day Developer Fest

The problem

Agents that act for you need to pay: APIs, data, compute, other agents. Today that means handing the agent a private key or a card number. A prompt injection, a bad tool or a bug then spends whatever the key can reach, and the key itself is an ECDSA or Ed25519 key that a quantum computer will forge.

Related MCP server: PipRail

How QoreGuard stops it: three locks on every payment

 agent (MCP)                         QoreChain                                QoreGuard contract
 ───────────                         ─────────                                ──────────────────
 signs intent with ML-DSA-87  ──►  1. session key: per-payment cap,     ──►  2. payee on the owner's list,
 signs execution with the           daily cap, expiry, only pay() and         per-payee daily cap (policy the
 ed25519 session key                postNote() on this contract               owner signed with ML-DSA-87)
 relays in a hybrid tx                                                    3. agent's ML-DSA-87 signature
 (secp256k1 + ML-DSA-87)                                                      over the exact intent (pqcVerify)
  1. Chain session key (x/abstractaccount). The owner links the agent's ed25519 key to their account with permissions: ["evm"] and a spending rule: per-payment limit, daily limit, expiry, and allowed_evm_calls = only QoreGuard's pay and postNote. QoreChain refuses everything else before any contract runs. One click revokes it.

  2. Owner's payee policy, verified on chain. The owner signs the payee list (who, how much per day, until when) in the QoreX wallet. The contract rebuilds the bytes QoreX signed, reads the owner's registered key from the pqcKeyStatus precompile and checks the ML-DSA-87 signature with pqcVerify. Relayers can deliver a policy but never change it.

  3. Agent's own ML-DSA-87 signature. The agent identity (a QoreChain account with a registered ML-DSA-87 key) signs every payment intent in the QoreSign format; pay verifies it with pqcVerify, so no QoreGuard payment can be made with a classical signature alone.

And two authenticated channels: the owner's instructions are QoreX-signed transactions (the agent obeys nothing else, so a web page cannot instruct it), and the agent's reports are notes signed with ML-DSA-87 and verified by the contract.

What happened on chain

Every row is a real transaction on the testnet, produced by pnpm --filter @qoreguard/core e2e:

#

What

Who decided

Transaction

1

Owner links the agent's session key: 1 QOR per payment, 20 QOR per day, 2 h, only pay/postNote

—

F4832B8E…

2

Owner signs the payee policy with ML-DSA-87 (1 uqor self-transfer, memo = policy digest)

—

DD52812E…

3

setPolicy verifies that signature on chain (pqcKeyStatus + pqcVerify)

contract

0x0d9c479f…

4

Agent pays 0.4 QOR to weather-api (intent signed with ML-DSA-87, envelope hybrid-signed)

paid

18C12727…

5

1.2 QOR, sent past the MCP server's own checks

refused by QoreChain: per-tx limit

95D56B50…

6

0.1 QOR to an address the owner never allowed

refused by the contract: PayeeNotAllowed

6C544372…

7

0.3 QOR over weather-api's 1.5 QOR daily limit

refused by the contract: DailyCapExceeded

5D998CA1…

8

The session key used directly to call another contract

refused by QoreChain: not in allowed_evm_calls

3A676A0A…

9

The session key used directly for a 1.5 QOR plain transfer

refused by QoreChain: per-tx limit

ACA372DB…

10

Agent posts a note to the owner, ML-DSA-87 verified by the contract

posted

C555172E…

11

Owner revokes the session key (kill switch); the next payment is refused

refused by QoreChain

CCAEB802…

The same run also checks that a plain MsgSend with the session key is refused (it has no send permission), that the owner's instruction is verified by the chain and again locally, and that check_transaction re-verifies the agent's ML-DSA-87 signature of step 4.

Use it

1. Agent side (your machine)

git clone https://github.com/imthegoodboy/qoreguard && cd qoreguard
pnpm install && pnpm --filter qoreguard-mcp build
node mcp/dist/qoreguard.mjs init --owner <your qor1 address>
# send ~2 testnet QOR for fees to the agent identity it prints (faucet: https://dashboard.qorechain.io/faucet)
node mcp/dist/qoreguard.mjs register      # registers the agent identity's ML-DSA-87 key
node mcp/dist/qoreguard.mjs link-code     # paste this in the dashboard

2. Owner side (QoreX wallet)

Open {{APP_URL}}/app/link, connect QoreX, paste the link code, choose the limits and sign. Then add the payees the agent may pay and sign the policy.

3. Connect your AI client

Claude Code (from the repo folder, .mcp.json is included) or any MCP client:

{ "mcpServers": { "qoreguard": { "command": "node", "args": ["<repo>/mcp/dist/qoreguard.mjs", "mcp"] } } }

Tool

What it does

guard_status

Session key state and expiry, chain limits, payees and what is left today, problems

list_payees

The payees the owner allowed

pay

Pay an allowed payee (ML-DSA-87 intent + session key, enforced by chain and contract)

fetch_paid

GET a URL; if it answers HTTP 402 with a QoreGuard payment request, pay up to max_qor and fetch again

send_note

Post a signed note to the owner (verified on chain)

read_owner_messages

The owner's ML-DSA-87-signed instructions, verified by the chain and re-verified locally

sign_message / verify_message

QoreSign hybrid signatures against keys registered on chain

check_transaction

Was a transaction signed post-quantum, refused, and does the agent's signature verify

No AI client at hand? pnpm --filter qoreguard-mcp demo runs a scripted agent session through the same MCP protocol.

Repository

Path

What

contracts/

QoreGuard.sol, HybridTx.sol (parses a hybrid-signed QoreChain transaction), tests, deploy script

core/

TypeScript library: session-key payments, ML-DSA-87 intents, owner policy, messages, transaction checks

mcp/

The MCP server and qoreguard CLI (bundled to mcp/dist/qoreguard.mjs)

web/

Owner dashboard (Vite + React) and its serverless relayer and paid demo API

docs/

Architecture, contract, threat model

Tests

Suite

Command

Result

Contract (Hardhat 3, viem; real ML-DSA-87 signatures from @qorechain/qoresign, real hybrid-signed transactions for setPolicy)

pnpm --filter contracts test

78 passing

MCP protocol (official MCP client over stdio against the bundled server)

pnpm --filter qoreguard-mcp test

4 passing

Live testnet end to end (every lock, every refusal path)

pnpm --filter @qoreguard/core e2e

17 steps, E2E OK

Gas measured in the contract tests (QoreGuard's own cost, without the precompiles): setPolicy with 2 payees ~499k, pay ~304–478k, postNote ~311–438k.

Security notes

See docs/THREAT_MODEL.md. In short: the agent can be tricked or taken over and the owner's exposure stays bounded by the chain's per-payment and daily caps and the expiry, which QoreChain enforces on every use of the session key. Every QoreGuard payment additionally needs an owner-approved payee and the agent's ML-DSA-87 signature. One chain fact we verified and document honestly: allowed_evm_calls restricts calls with calldata, so a stolen or forged session key could still make plain transfers up to the caps; keep the caps small and the expiry short. Testnet only.

License

MIT. Built with Claude Code; see AI_USAGE.md.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      A budget-bound x402 payment wallet for AI agents: it autonomously pays HTTP 402 payment-gated URLs across every major chain (EVM, Solana, and many non-EVM families). Self-custodial and backendless, your key, your RPC, with spend caps enforced before any on-chain send.
      8
      10
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to store and retrieve persistent memory across sessions and machines, and to pay any x402 API while keeping a signed, offline-verifiable ledger of purchases and spending.
      Functional Source , Version 1.1, MIT Future