Loops HouseSudo by Contract

NEAR HACKATHON
Links
Team
1 member- KEOwner
Kehinde Emmanuel
Overview
AI agents now restart services, read logs and fix incidents in production. They get access the old way: a long-lived SSH key or root that outlives the task, can be copied, and can do anything. One prompt injection and the agent can do anything you can. Even SSH certificate authorities, the right tool, come down to one private key that someone has to guard.
Sudo by Contract replaces credentials with capabilities. An agent asks for exactly one action on one server for a few minutes (restart checkout-api on prod-web-02, 10 min, 1 use). A policy contract on NEAR evaluates it; production actions need a human, who approves from their phone. The contract then has NEAR's MPC network sign a short-lived OpenSSH certificate: valid for that host only, forced through a gate, no shell. On the server, real OpenSSH checks the certificate and the gate asks the contract to consume each use. Anything outside the capability is denied, and when the window closes OpenSSH itself refuses the key.
NEAR is what makes this possible. Chain signatures let the contract own a CA key that no person, server or company ever holds (11 of 16 MPC nodes must cooperate to sign). Function-call access keys give every agent, approver and server a narrowly scoped on-chain identity. Every request, approval, certificate and denial is a hash-chained on-chain event.
It runs live on testnet, not mocked. In a recorded run I approved a restart from my phone; the MPC-signed certificate arrived 4.3 s later, the restart ran once, and three escalation attempts were denied. A real AI model read a prompt injection planted in the server's logs and ignored it; replayed as a compromised agent, every injected command was denied. Anyone can verify the MPC-derived CA from their browser, and a public CI job runs the whole flow against real OpenSSH every 8 hours.