agent-self-funding — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited agent-self-funding (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Trigger when the user describes:
A self-funding agent has three phases that cycle continuously:
EARN (x402 endpoint) → PRESERVE (treasury) → SPEND (operational costs)
↑ ↓
└──────────── repeat ─────────────────────────┘If EARN > SPEND over a rolling window, the agent grows. If SPEND > EARN, it dies (treasury depletes to zero).
Before writing code, calculate whether the agent can be viable:
function isViable(params: {
pricePerCall: number;
expectedCallsPerDay: number;
hostingCostPerDay: number;
llmCostPerCall?: number;
txFeesPerDay?: number;
}): { viable: boolean; marginPerDay: number; daysToBreakeven: number } {
const dailyRevenue = params.pricePerCall * params.expectedCallsPerDay;
const dailyVariableCost = (params.llmCostPerCall || 0) * params.expectedCallsPerDay;
const dailyFixedCost = params.hostingCostPerDay + (params.txFeesPerDay || 0);
const marginPerDay = dailyRevenue - dailyVariableCost - dailyFixedCost;
return {
viable: marginPerDay > 0,
marginPerDay,
daysToBreakeven: marginPerDay > 0 ? params.hostingCostPerDay / marginPerDay : Infinity,
};
}Example viability check:
const check = isViable({
pricePerCall: 0.01,
expectedCallsPerDay: 50,
hostingCostPerDay: 0, // Vercel free tier
llmCostPerCall: 0.002,
txFeesPerDay: 0.05,
});
// → { viable: true, marginPerDay: 0.35, daysToBreakeven: 0 }If marginPerDay < $0.10, the agent is too marginal to survive temporary outages or LLM price changes. Aim for marginPerDay > $0.50 minimum.
self-funding-agent/
├── src/pages/api/
│ ├── service.ts # x402-paywalled endpoint (REVENUE)
│ ├── cron.ts # Treasury management (PRESERVE)
│ └── stats.ts # Public dashboard data
├── src/lib/
│ ├── x402-paywall.ts # Payment middleware
│ ├── treasury.ts # Auto-invest / auto-redeem logic
│ └── service-logic.ts # The actual value-add of the agent
└── vercel.json # Cron scheduleFor an agent that earns small frequent payments:
const TREASURY_FLOOR_USDC = 1.00;
const AUTO_INVEST_TRIGGER = 5.00;
const AUTO_REDEEM_TRIGGER = 0.50;
export async function rebalance(walletAddress: `0x${string}`, usdcBalance: number, gblinValueUsdc: number) {
if (usdcBalance > AUTO_INVEST_TRIGGER) {
const excess = usdcBalance - TREASURY_FLOOR_USDC;
return { action: 'invest', amount: excess };
}
if (usdcBalance < AUTO_REDEEM_TRIGGER && gblinValueUsdc > 1.0) {
return { action: 'redeem', amount: 1.0 };
}
return { action: 'idle', amount: 0 };
}/api/stop endpoint guarded by a secret that pauses cron-triggered treasury operations if something goes wrong.skills/base-agent-treasuryskills/x402-paywall-patternskills/jit-redemption-patternskills/crash-shield-risk-managementexamples/mcp-paywall-template~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.