Loops Housenear-spend-guard

NEAR HACKATHON
Links
Team
1 member- CAOwner
Carlos Vendrell Felici
Overview
AI agents are starting to pay for APIs, data and compute on their own. On NEAR, an agent's key either can't pay at all (a function-call key can't attach a deposit) or can spend everything (a full-access key). There is nothing in between.
near-spend-guard is the in-between: a Rust contract that holds the agent's funds and enforces its budget for native NEAR and NEP-141 tokens, with per-payment caps, a rolling daily cap, receiver allowlists, human approvals and a kill switch. The agent gets a function-call key that can only call request_payment on the guard, so the limit is enforced on chain, not promised by the agent's code.
Two properties are tested on a local NEAR sandbox node. Caps hold under parallel requests: ten payments of 25 TST sent at once against a daily cap of 100 leave exactly 100, and six wait for a human, because the budget is reserved in the same receipt that sends the payment; a naive guard that counts at settlement let 250 leave. And a human approves one exact payment, not a request number: approve carries the full payload, near CLI shows it before signing, and the guard compares it field by field. If the filed request says 190 and the human approves the 50 they agreed to, nothing moves.
A small TypeScript client ships an MCP server with one tool, pay, so any MCP host can use it; it refuses to start with a key that can do more than request_payment. The approver's nsg-approve reads the payment from the guard, not from the agent's output. On testnet, Claude Code with pay as its only tool paid for an API, and a 60 TST payment waited for a human, was approved with its full payload, and settled.
It is for teams whose agents pay for APIs and for marketplaces where agents get hired and paid, such as NEAR's Agent Market. Every claim in the README is a command with its output, backed by unit, sandbox, client and end-to-end tests in CI and mutation runners that weaken each check in turn. Testnet only; next is an independent audit, then mainnet.