Mandate-karyo

Signed delegation chains that stop AI agents expanding their authority, revocable on Ethereum

Mandate-karyo

Created At

ETHGlobal Mumbai

Project Description

When one AI agent hands work off to another, the service that actually does the thing usually just has to trust whatever the last agent says it's allowed to do. Mandate fixes that right where the action happens.

Every hop in the chain carries a signed slice of authority, and each slice has to be narrower than the one before it. That means fewer actions, a smaller amount, fewer targets, or an earlier expiry. Before the service that owns the asset does anything, it checks the whole chain plus the exact request. If any hop tried to give itself more power than it was handed, the request gets denied, we show exactly which edge broke the rules and why, and nothing moves.

For the demo we built a procurement flow: owner -> operations -> procurement (an LLM agent that reads invoices) -> settlement -> payment service. A valid payment goes through, and we've run it with real test USDC on Sepolia. The one-command local demo simulates the payment part, but the revocation checks are still real. Then a rogue agent with a genuine signature tries to bump its limit and add a new target. It gets refused and the balance doesn't change. After that we revoke an ancestor with a single Ethereum transaction, and a request that was valid a second ago (same request, fresh nonce) now comes back REVOKED. And if you start with just an ENS name, you can rebuild the whole chain yourself and re-verify every hop.

Some honest limits:

  • maxAmount is per execution, it's not a total budget
  • replay protection only lives in memory right now
  • we tried to trick the LLMs with a poisoned invoice and none of them fell for it (0 out of 12 runs), so we use a scripted rogue agent to play the compromised one
  • we haven't run the World ID step-up against World's live API yet, so the demo uses a bypass that's clearly labelled
  • the hosted dashboard shows labelled sample data because the payment service isn't hosted. The real on-chain runs are linked in the repo at docs/milestone-run.md

How it's Made

It's a TypeScript monorepo (pnpm, strict ESM, Node 22). We used viem, Express, zod, and vitest + fast-check for testing. The contract is written with Foundry, and the dashboard is Next.js.

  • Delegations and requests are both EIP-712 signed. The chainId and verifyingContract in the domain always come from our config, never from the token, so nobody can sneak in their own.
  • packages/core has the narrowing check and the chain verifier. We wrote property tests and attack tests for both.
  • POST /execute is where enforcement actually happens, and it fails closed. Any error, missing config or RPC failure counts as a denial.
  • RevocationRegistry.sol on Sepolia holds the shared revocation state, and we read it right at the moment of execution.
  • ENSv2 on Sepolia: mandate-agents.eth with a PermissionedResolver per account, plus text records on each agent's subname. Discovery starts from the name, and we treat everything we fetch as untrusted until it verifies.
  • Arkiv (Rabdi testnet) keeps a queryable record of delegations, and each entity expires at the same time as its delegation. The Authority Explorer pulls from Arkiv, then re-checks ids, signatures, edges and expiry locally, and reads revocation status straight from Ethereum.

The hacky part: we needed the World ID signal hash, and it wasn't documented where we were looking. So we dug through the idkit-core source to work out how to bind an approval to one exact request digest.

background image mobile

Join the mailing list

Get the latest news and updates