[{"data":1,"prerenderedAt":229},["ShallowReactive",2],{"project-\u002Fprojects\u002Fsweefi-caged-agent":3},{"id":4,"title":5,"body":6,"description":208,"extension":209,"featured":210,"github":211,"live":211,"meta":212,"metric_source":211,"navigation":213,"order":121,"path":214,"pr_links":215,"proof_url":187,"seo":216,"status":217,"statusColor":218,"stem":219,"subtitle":220,"tech":221,"tier":226,"verification_tier":227,"__hash__":228},"projects\u002Fprojects\u002Fsweefi-caged-agent.md","The Caged Agent",{"type":7,"value":8,"toc":201},"minimark",[9,13,28,33,36,67,75,79,90,104,108,163,167,172,176,197],[10,11,5],"h1",{"id":12},"the-caged-agent",[14,15,16,17,22,23,27],"p",{},"The companion proof for ",[18,19,21],"a",{"href":20},"\u002Fprojects\u002Fsweefi","SweeFi",": an AI agent whose every payment is gated ",[24,25,26],"strong",{},"in the same atomic transaction"," by an on-chain mandate. Misbehaviour isn't discouraged — it can't settle.",[29,30,32],"h2",{"id":31},"the-three-acts","The three acts",[14,34,35],{},"The script self-checks and exits non-zero on failure:",[37,38,39,46,57],"ol",{},[40,41,42,45],"li",{},[24,43,44],{},"In-budget payment"," → settles. ✅",[40,47,48,51,52,56],{},[24,49,50],{},"Over-budget payment"," (the agent goes rogue) → aborts on-chain at ",[53,54,55],"code",{},"validate_and_spend",". 🛑",[40,58,59,62,63,66],{},[24,60,61],{},"Operator revokes, agent retries"," → aborts on-chain (",[53,64,65],{},"ERevoked","). The kill switch fired. 🛑",[14,68,69,70,74],{},"The mandate carries a per-call cap (0.01 SUI) and a lifetime cap (0.05 SUI). Every line is a real Sui testnet transaction — ",[71,72,73],"em",{},"including the aborts."," The over-budget abort is the artifact: proof the cage is enforced by Move code, not by trust.",[29,76,78],{"id":77},"why-it-holds","Why it holds",[14,80,81,82,85,86,89],{},"Complete mediation (Saltzer & Schroeder) meets object-capability security: on Sui a capability is an owned object, and the ",[71,83,84],{},"check"," and the ",[71,87,88],{},"spend"," compose atomically in one transaction. The theft can't form; the kill switch actually fires.",[91,92,93],"blockquote",{},[14,94,95,96,99,100,103],{},"It proves ",[71,97,98],{},"authority"," — well-formed, capability held, revocable — never that a spend is ",[71,101,102],{},"wise."," It lowers P(catastrophe), not to zero. That restraint is the brand.",[29,105,107],{"id":106},"run-it","Run it",[109,110,115],"pre",{"className":111,"code":112,"language":113,"meta":114,"style":114},"language-bash shiki shiki-themes github-light github-dark","pnpm install --ignore-workspace\nexport SUI_TESTNET_PRIVATE_KEY=…   # a funded testnet wallet (the operator)\npnpm caged\n","bash","",[53,116,117,134,155],{"__ignoreMap":114},[118,119,122,126,130],"span",{"class":120,"line":121},"line",1,[118,123,125],{"class":124},"sScJk","pnpm",[118,127,129],{"class":128},"sZZnC"," install",[118,131,133],{"class":132},"sj4cs"," --ignore-workspace\n",[118,135,137,141,145,148,151],{"class":120,"line":136},2,[118,138,140],{"class":139},"szBVR","export",[118,142,144],{"class":143},"sVt8B"," SUI_TESTNET_PRIVATE_KEY",[118,146,147],{"class":139},"=",[118,149,150],{"class":143},"…   ",[118,152,154],{"class":153},"sJ8bj","# a funded testnet wallet (the operator)\n",[118,156,158,160],{"class":120,"line":157},3,[118,159,125],{"class":124},[118,161,162],{"class":128}," caged\n",[29,164,166],{"id":165},"demo","Demo",[14,168,169],{},[71,170,171],{},"Terminal recording lands here — watch the over-budget payment die on-chain.",[29,173,175],{"id":174},"proof","Proof",[177,178,179,194],"ul",{},[40,180,181,184,185,193],{},[24,182,183],{},"npm:"," ",[18,186,190],{"href":187,"rel":188},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@sweefi\u002Fsui",[189],"nofollow",[53,191,192],{},"@sweefi\u002Fsui"," — the SDK + mandate builders.",[40,195,196],{},"Verified: typecheck green against the published packages; the three-act verdict issues real testnet transactions.",[198,199,200],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":114,"searchDepth":136,"depth":136,"links":202},[203,204,205,206,207],{"id":31,"depth":136,"text":32},{"id":77,"depth":136,"text":78},{"id":106,"depth":136,"text":107},{"id":165,"depth":136,"text":166},{"id":174,"depth":136,"text":175},"A runnable testnet demo of enforced authorization — an agent holds an on-chain budget mandate; an over-budget payment aborts at consensus, and a mid-session revoke kills its next call. Not advisory. Enforced.","md",false,null,{},true,"\u002Fprojects\u002Fsweefi-caged-agent",[],{"title":5,"description":208},"Testnet","blue","projects\u002Fsweefi-caged-agent","An AI agent that literally cannot overspend — with a kill switch that fires",[222,223,224,225],"Move","Sui","TypeScript","AI Agent","working","testnet","QGPXe3jSSGnQdOe8b0Le_6xiB2hosevr3v5vz-jsKbM",1788226713777]