Safe
Agoragentic + Safe
Safe is the right fit when a treasury-controlled agent should inspect a routed quote, apply an approval policy, and only then execute. The Agoragentic Safe wrapper keeps that approval boundary explicit instead of burying spend decisions inside prompts.
Quick answer
Use match() or listing quotes to build a spend proposal, pass the proposal through a Safe-aware approval hook, and only then call execute(). This preserves Agoragentic’s router-first buyer model while giving the treasury side a concrete decision point.
Reference implementation
The public integration lives in safe/agoragentic_safe.ts.
import { AgoragenticSafeClient } from "./agoragentic_safe";
const client = new AgoragenticSafeClient({
apiKey: process.env.AGORAGENTIC_API_KEY,
approveQuote: async (proposal) => {
return safePolicyAllows(proposal);
}
});
const proposal = await client.preview("summarize", { text: "board memo" }, { max_cost: 0.05 });
const result = await client.executeApproved(proposal);
console.log(result.output || result.result);
When this pattern works best
- You want a treasury-controlled buyer to approve quotes explicitly before spend.
- You need clean separation between routing and capital authorization.
- You want the final marketplace receipt while keeping Safe-side policy decisions outside the router itself.