Kusari

Onchain limits and an ENS kill switch for AI trading agents.

Kusari

Created At

ETHGlobal Mumbai

Project Description

Kusari lets an AI agent propose trades while an owner keeps enforceable control over its money and permissions. Funds stay in an owner-controlled vault. A Uniswap v4 hook checks the signed trade against a public ENSv2 policy: authorization, per-trade and daily spending caps, an allowed pool, price impact and minimum output. Revoking the agent’s ENS role blocks its next trade after confirmation.

The live Sepolia demonstration uses real Gemini decisions and public transaction receipts. A normal trade succeeds within policy; a staged poisoned-news challenge demonstrates rejection when the model requests an over-limit trade. Anon-RPC/Nox carries the agent’s chain reads and submissions, while transactions remain public. The default demo is one shared funded workspace whose restricted agent key is held by Kusari’s runner. Visitors sign only a bounded run request and supply no trading funds.

Separate-owner isolation has also been tested on live Sepolia: freezing agent A blocked A while agent B continued trading, with separate ENS labels, resolvers, vaults and spending counters. The README links the receipts. Personal self-service onboarding is an optional beta and is not required to use the shared demo.

How it's Made

The contracts are written in Solidity around Uniswap v4 PoolManager and a required PolicyHook. AgentVault fixes its owner, agent and hook at deployment. The agent signs an EIP-712 SwapIntent binding the vault, pool, amount, minimum output, nonce and expiry. The hook checks authorization and spending before execution, then checks the real output and pool-price movement after execution; a revert rolls back the entire swap.

ENSPolicySource pins an ENSv2 parent registry and reads policy data through ENSIP-10 resolution. A narrow registry marker role authorizes trading; the owner can revoke or restore it without changing the model. Agent privileges do not include editing the policy or moving the vault’s funds directly. The Kusari parent namespace remains a disclosed trust dependency.

The TypeScript/viem runner on Fly calls Gemini and uses the Anon-RPC browser harness with Nox for chain reads, simulation and signed transaction submission. Next.js on Vercel supplies the interface and a fixed-route server proxy. Direct wallet-provider network/account checks pin owner actions to Sepolia. Shared runs use single-use signed challenges, cooldowns and service quotas. The public repository includes tests, deployment manifests, FEEDBACK.md and live isolation receipts. Codex assisted implementation, UI, tests and deployment tooling; the README discloses AI assistance and distinguishes automated rehearsals from user-confirmed MetaMask actions.

background image mobile

Join the mailing list

Get the latest news and updates

Kusari | ETHGlobal