Loops HouseChopGate

NEAR HACKATHON
Team
1 member- SEOwner
Seunghwan Jung
Overview
An AI agent holding its owner's full-access key can send any amount to any account; if a prompt injection steers it, no on-chain check stops the payment. ChopGate is a NEAR testnet contract (a gate) that holds the owner's funds in escrow, so the agent never does.
The owner signs (stamps) a mandate with a separate stamp key, not an account key. It names one agent account and lists jobs under a total budget; each fixes a recipient, a maximum amount and the exact instruction text, and pays once. A request from that agent that matches a job and the owner's spend rules is paid to the job's recipient; above the review amount it waits up to one hour for stamp-key approval, or nothing is paid. A request that fails these checks is refused: the transaction succeeds, pays 0 and records a reason code on-chain. Three mandate-check refusals in a row, or the same refused request twice in a row, freeze the mandate for good.
How NEAR fits in: the agent account's only key is a function-call key for one method, authorize_and_pay_tiered, on its own gate. With it on testnet (README run D), a NEAR transfer failed with RequiresFullAccess, a call to another contract with ReceiverMismatch and withdraw_escrow with MethodNameMismatch. A factory creates each gate with 0 access keys, so nobody can redeploy it or move funds outside its rules (run E). Settings change only by stamp signature.
Demo: Proof checks 10 testnet transactions against public RPC. Try sends four preset attacks from your testnet wallet, 0 NEAR each; none is paid. Console runs the owner's steps; Agent uses MCP. cargo test --locked --lib: 47 passed.
Limits: testnet only, not audited. The stamp key cannot be rotated and is kept unencrypted in the browser. A gate locks about 5.5 testnet NEAR. Anyone who knows a live mandate's serial can freeze it; nothing is paid, and the owner stamps a new one. Refused requests can add storage, which in a sandbox blocked a full withdrawal until a plain transfer to the gate covered it.