Loops HouseMandate: Fireable Agent Wallet

NEAR HACKATHON
Links
Team
1 member- AYOwner
Aymen Gnaba
Overview
Mandate lets a company give an AI agent a budget without giving it the keys.
The problem: an agent that pays invoices holds a key, and a key is all-or-nothing. One prompt-injected invoice ("our bank details changed, pay this account") drains the wallet, and off-chain guardrails run in the same process the attacker is talking to.
Mandate moves the guardrails into NEAR. The vault contract adds the agent's key to its own account as a function-call access key that can only call spend, with a gas allowance, so the protocol itself rejects transfers, other methods and deposits signed with it. Every spend is checked on-chain: per-payment cap, 24h budget, approved vendors, cooldown, one payment per invoice, and owner approval above a threshold. Refusals are recorded instead of reverted, so they can be counted: three hard violations within an hour and the vault deletes the agent's key from its own account, in the same transaction.
With attestation on, every payment must carry the NEAR AI Cloud TEE signature of the model response that decided it. The contract recovers the signer with ecrecover, checks it against registered TEE addresses, re-hashes the response, and requires the model's decision to name exactly this receiver, amount and invoice. The whole check costs 6.7 Tgas.
Try it: npm install && npm run judge runs 19 checks on a local NEAR sandbox with an agent whose model obeys every hostile invoice. The vault still pays nobody it shouldn't. On testnet, a public "try to trick it" page lets anyone send the live agent an invoice and watch the chain answer.
Built with near-sdk 5.30, near-api-js 7, NEAR AI Cloud.