Loops HouseNEAR Agent Spend Guard

NEAR HACKATHON
Links
Team
1 member- ETOwner
Ethan Moore
Overview
AI agents are starting to pay for things, but today an agent either cannot pay or holds a key that can spend everything. A prompt injection or a confused model then drains the wallet. NEAR Agent Spend Guard moves the spending decision on chain.
It is a Rust NEAR contract (near-sdk 5.17) that holds native NEAR and enforces an owner-set policy per agent: a receiver allowlist, a per-transaction cap, a UTC-daily cap, an approval threshold, and global or per-agent pause. A spend at or below the threshold is sent without owner approval; a larger one becomes a pending request that reserves budget and liquidity until the owner approves or rejects it; after the next UTC midnight anyone can expire it. Hard-cap violations fail even with approval. A failed transfer gives the budget back in its callback. Accepted spends, approvals, rejections and expiries are NEP-297 events in a bounded on-chain audit log.
NEAR access keys do the rest: the agent gets a function-call key that can call only spend on this contract, with a finite gas allowance, so it cannot change its limits, withdraw or touch other contracts. A Node CLI turns a plain request into a spend call with that key; an optional AI-agent mode lets an LLM drive it. In a prompt-injection test on testnet, a hijacked agent's payment to a stranger and its over-budget payment were refused on chain (E_NOT_ALLOWLISTED, E_DAILY).
Live read-only dashboard (no installation, wallet or key): https://mubudot.github.io/near-agent-spend-guard/ It reads the testnet contract: policy, spend against the daily cap, pending approvals with the owner's command, audit events, and a transaction inspector that decodes refusals.
Live on testnet (guard.spendguard-b31c91.testnet), every demo transaction linked in the repo. 26 Rust unit tests, 88 Node tests and a sandbox integration suite (9 checks, nearcore 2.14.0) run on every push in public GitHub Actions CI; a skipped stage fails the run. The README has do X → see Y steps. Testnet only, MIT.