Loops HouseValet: a valet key for AI agents on NEAR

NEAR HACKATHON
Team
1 member- LUOwner
luocheng
Overview
Valet lets an AI agent pay from a NEAR vault without holding a key that can move your funds, like a valet key that starts the car but not the trunk. The agent's key is a function-call access key limited to one method, pay, on a guard contract. The guard enforces a per-payment cap, a rolling window cap, allow/deny lists and a kill switch on-chain. For receivers the owner never listed, pay needs an ed25519-signed verdict from a risk oracle (allow / warn / block, with reasons): account age and activity from the indexer, lookalike names, contract code changed since first sight or deployed in the last week (bait and switch), prior payments, and a shared registry of scam reports with evidence links. warn is queued on-chain for the owner, so a stolen key cannot approve it. The client refuses to sign on block, asks the human on warn and keeps an audit log. An MCP server (valet_pay, valet_check, valet_status) exposes it to MCP clients; the human's yes/no comes from the client's UI through MCP elicitation, not from the model. npm run sandbox also opens a web console where you play the agent and act as the owner; a replay runs in any browser at https://195440.github.io/valet/. npm run demo runs a prompt-injected agent and a thief with the stolen key against real contracts on a local nearcore 2.14.0 chain: 0 NEAR reached the attackers, 25 assertions. npm run testnet runs the same story on the public NEAR testnet; docs/testnet-run.md links every transaction, and the vault's code matches the committed wasm. 205 unit tests and 50 end-to-end tests (42 on a real chain), GitHub Actions on Ubuntu 24.04, a Dockerfile for other hosts. npm run lookup -- <account> scores any mainnet account. Claude Code (a real model) was pointed at the vault: five prompts and answers in docs/real-agent-run.md. Limits: the contracts are unaudited and ran on the testnet only, NEAR only (no USDC yet), and the oracle is a heuristic, so the on-chain caps are the guarantee.