Loops HouseLeash

NEAR HACKATHON
Team
1 member- RIOwner
Rizal
Overview
Leash is an on-chain spending policy for AI agents on NEAR. Your AI agent can spend. It can't steal.
Agents are starting to hold money, but their spending rules usually live in the agent's own prompt or code, which is exactly what a poisoned invoice or a jailbreak attacks. Leash moves the rules to where the money is.
The budget sits in a Rust vault contract. The agent account has no full-access key: its only key is a NEAR function-call access key that can call one method, request_spend(), on the vault. The protocol rejects anything else. The contract decides every request on-chain: frozen or blocklisted receivers are blocked; amounts over the per-payment cap, the daily cap or a receiver's own daily limit, and unknown receivers, wait for the owner; everything inside the policy is paid at once. A free check_spend() view runs the same rules, so an agent can ask before it signs.
If the agent keeps attacking, a tripwire answers: 3 refusals in 10 minutes and the vault freezes itself, even for normal purchases, until the owner unfreezes it (the hosted demo uses a 2 minute cooldown). The contract also counts every outcome on-chain, and the site turns that into a public dare: try to get one payment to the drainer.
Any agent can use it: a Leash MCP server gives Claude Code, Codex or Cursor tools to read the policy, dry-run a payment and spend, signing with that same one-method key.
Live demo: a deliberately gullible agent with a jailbreak switch and real testnet transactions. The repo has 32 contract tests, a one-command testnet setup, an attack script that tries every way to move money with the agent's key, and an MCP smoke test.
Built with near-sdk 5.30, near-api-js, NEAR Connect, the MCP TypeScript SDK, and an optional NEAR AI Cloud model backend.