Loops House



AgentFence

NEAR HACKATHON
Links
Team
1 member- PROwner
Pratiksha Kalbhor
Overview
AgentFence is a policy-enforced treasury for AI agents on NEAR. The agent can ask. The contract decides.
Problem: give an AI agent a full-access key and one prompt injection can drain it. Require a human to approve every payment and it is no longer autonomous.
Solution: the agent holds only a NEAR function-call key that can call one method, request_spend. A smart contract checks every request against on-chain rules (per-transaction limit, daily cap, destination allowlist, pause switch, fee cap), logs every decision, allowed or blocked, in an on-chain audit log, and only then calls NEAR Chain Signatures to sign a real Sepolia EIP-1559 transaction that the contract builds itself. The agent never holds a signing key and cannot change the destination, value or chain of the signed transaction.
Built and verified on testnet:
- Rust smart contract (near-sdk), 20 unit tests, MPC cross-contract call with callback and refund
- Contract-built transaction hash matches an independent viem implementation
- Real Sepolia transaction signed through Chain Signatures (success on Etherscan)
- Scoped function-call key proven to be refused for set_policy, direct MPC calls and deposits
- Prompt-injection demo: injected invoices are Blocked on-chain
- SDK, MCP server and CLI so any agent developer can plug it in
- Dashboard with a live-policy simulator, live audit log and docs
Track: AI Security & Defense. NEAR features: function-call access keys, Chain Signatures, cross-contract calls.
Limitations (stated in the README): testnet and Sepolia ETH only, no TEE, single-key owner, and the injection demo simulates a compromised model.