Loops HouseSwaraj

NEAR HACKATHON
Links
Team
1 member- SAOwner
Saurabh Shetty
Overview
Swaraj lets AI agents act without being trusted: every action, from a payment to a tool call, is checked against the owner's rules before it runs and can be proved after.
Problem: agents now move funds, call tools and change real systems, and the usual guardrail is a sentence in the prompt. Prompts get injected or misread: an attacker queued prompts through aixbt's dashboard and its agent sent 55 ETH; Grok was tricked by Morse code into a ~$200K transfer. Nothing checks the action first or proves what was allowed.
What we built: a fail-closed gateway between the agent and everything it can do. The owner writes an Agent Mandate ("pay vendor.testnet at most 0.01 NEAR"). The agent can only propose typed actions (payments, trades, MCP tool calls, any app action): it never holds the keys and cannot edit its own mandate. Rules decide (FORBID > REQUIRE_APPROVAL > PERMIT, default deny), the Z3 solver re-checks every decision, and any disagreement or failure is a BLOCK. The decision rules are proved in Lean 4 (30 theorems: default deny, forbid always wins, no ALLOW, no run).
How NEAR fits (all live on testnet):
- Execute: only an ALLOW runs, as a NEAR transfer, NEP-141 transfer or Ref Finance swap. One yocto over the cap is blocked before any money moves.
- Prove: each decision, blocked ones too, can be proved with an SP1 Groth16 proof. Our verifier contract checks it on NEAR (~34 Tgas) and only then does the receipts contract mark it PROVED, so no one has to trust our server.
- Pay: a wager escrow pays out only on a NEAR-proved receipt; a fake receipt paid nothing and a replay was refused.
- Demo: Zunno, a card game whose AI opponent is a Shade Agent with its own NEAR account, picks moves via NEAR AI Cloud after a TDX/GPU attestation check, and plays every move through the gate.
Integrate with one SDK call, an MCP gateway that guards existing tools with no agent changes, or the HTTP API. The README has a no-keys 5-minute demo and every contract and transaction.