Loops HouseCircuit Breaker

NEAR HACKATHON
Links
Team
1 member- ZOOwner
Zoltame
Overview
Giving an AI agent a wallet gives it too much power: one prompt injection or runaway loop can drain it. NEAR function-call keys limit which methods an agent can call, but not the portfolio risk it takes.
Circuit Breaker is a risk layer between an autonomous trading agent and its funds. The agent only proposes orders. A deterministic policy engine checks each one against 10 rules (kill-switch, whitelist, order size, exposure, leverage, daily loss, drawdown, frequency, slippage, trading hours). Orders that reduce risk still pass after a breach, and a drawdown breach sells every position automatically. A swarm mode gives each agent its own budget and quarantine.
How NEAR fits: funds sit in a Rust vault contract. The agent holds only a function-call key scoped to that vault, so per-order and per-day caps, token and venue whitelists and the kill-switch hold even if the engine is bypassed. The agent can freeze the vault but never reopen it. The vault is owned by a Sputnik DAO (2 of 3 votes) and its account has no access key left, so no single key can change the code. Prices come from real NEAR Intents 1Click quotes (dry: true). The hash-chained decision journal is anchored in the vault, so a rewritten history is detected.
Limits: NEAR testnet only, fills are simulated at real quotes because NEAR Intents has no testnet, the demo agent is scripted to obey the injection, and the three DAO council keys are all held by the builder for the demo. Replay with real transaction links: https://circuit-breaker-psi.vercel.app. 146 tests; the README lists do-X-see-Y steps, most of them with no key.