Loops HouseAEGIS // COUNTERFACTUAL

NEAR HACKATHON
Links
Team
1 member- ESOwner
Eshaan Gupta
Overview
AI agents that pay invoices must read untrusted messages, documents and tool output, so one prompt-injected line can redirect real money. AEGIS // COUNTERFACTUAL treats the agent as untrusted: it may propose a payment, but it never authorizes one.
A native Rust vault deployed on NEAR testnet enforces an owner-written mandate covering the exact recipient, amount, purpose, authorized-invoice hash, expiry, nonce and daily budget. Restricted NEAR function-call keys isolate the agent and attestor roles, and the vault re-checks policy during both attestation and execution. A counterfactual replay engine compares authorized and adversarial inputs, mutates every intent field, and seals the evidence into an independently verifiable Counterfactual Verification Receipt whose Merkle root is committed on-chain.
The prototype recorded 19/19 expected outcomes across 15 real testnet transactions: a prompt-injected payment was blocked, a redirected payment from a deliberately compromised attestor was rejected, replay and privilege escalation failed, and the legitimate 0.05 NEAR payment executed. Across 23 synthetic scenarios, an unprotected agent would have signed 8 harmful transfers totaling 1.75 NEAR; AEGIS allowed none.