Loops HouseLeash

NEAR HACKATHON
Team
1 member- LIOwner
Liam Lakevold
Overview
Problem: an AI agent that pays for things needs a key, and a normal key can move everything, so one leaked key or one prompt injection can empty the account. Limits written into the agent's own code do not bind an attacker who holds the key.
Leash is a wallet contract on NEAR. The money sits in an account that runs the contract, and a separate owner account sets the rules. Each agent gets its own key, which the contract adds to the wallet account as a NEAR function-call access key that can call one method, pay, on the wallet itself. The protocol rejects everything else that key signs: transfers, other methods, key changes, code deploys. pay enforces a policy stored per key: receiver allowlist, per-payment limit, per-window limit, lifetime limit, expiry. A payment above the limit is parked on chain for the owner to approve or reject. Denials are recorded on chain, and after a set number of them the contract freezes the agent and deletes its key from the account. A guardian key can freeze the wallet and do nothing else. After setup the account's full-access key is deleted, so only the contract hands out keys.
How NEAR fits: Leash relies on function-call access keys, on a contract being able to add and delete keys on its own account, and on signer_account_pk, which makes the key itself the agent's identity.
What works today: the contract (Rust, near-sdk), a policy engine with 23 unit tests, a JS client whose agent wrapper refuses to sign a payment the policy would deny and refuses to run on an over-privileged key, 27 end-to-end tests that sign real testnet transactions, and a demo (npm run demo) in which an attacker holding the stolen agent key gets 0 NEAR. Testnet only, native NEAR only, not audited. The known gaps are listed in the README.