The failed_paid lesson is the part most budget-guard write-ups skip — a cap that only counts successful purchases is accounting fiction when a down miner can settle 8 failed payments. Recording failures against the cap is the real control here, not the $0.50 daily limit. Do you blacklist a miner after repeated failed_paid events, or does the daily cap alone have to absorb the bleed?
Honest answer: no numbers yet, it only shipped today and hasn't fired in real use. One refinement since: it now ignores failures caused by the settlement layer (facilitator timeouts and the like), so a healthy miner doesn't get blamed for a platform outage. The bad-minute vs bad-hour question is fair; both values are configurable (PURSE_QUARANTINE_FAILS, PURSE_QUARANTINE_MINUTES), and I'll share how often it fires once there's data.
That settlement-layer distinction is the right call — quarantining a healthy miner for a facilitator timeout would erode trust in the guard fast. Looking forward to the firing data once it's had real traffic; the frequency will say a lot about whether the thresholds are tuned right.
Update: shipped it. After 2 failed_paid from the same miner (or the same auto-routed intent) within 60 minutes, the purse now skips it before even asking for a price, and the agent gets a clear "BLOCKED by quarantine" with when it lifts. Both numbers are configurable (PURSE_QUARANTINE_FAILS, PURSE_QUARANTINE_MINUTES).
Thanks for pushing on this. The daily cap is now the last line of defence, not the first.
Shipped the same morning is the best possible answer to a design question. The 'BLOCKED by quarantine' message with a lift time is the detail that matters — the agent gets a reason, not a silent disappearance, so it can route around the miner instead of retrying into it. Two numbers I'd be curious about once it runs a while: how often the quarantine actually fires, and whether 2-in-60-minutes ever catches a miner that's just having a bad minute rather than a bad hour.
Thanks, this is exactly the trap I fell into first.
Honest answer: there's no automatic blacklist yet. Today it's three layers:
• The skill tells the agent not to retry a miner after a failed_paid, so one bad miner costs one cent per question, not a retry loop.
• PURSE_PIN_MINERS lets you pin an intent to a known-good miner (weather is pinned by default), still paid through Telegraph.
• The daily cap absorbs whatever slips through, because failed_paid counts toward it.
(Telegraph did later credit those 8 failed payments back to escrow, but a client shouldn't count on that.)
Your question convinced me the cap shouldn't be the backstop. I'm adding an auto-quarantine: after 2 failed_paid from the same miner within an hour, the purse skips it and logs why. I'll reply here when it lands.
Thanks Robert. It surprised me too: the node returned HTTP 500 and still settled. Since then the purse also quarantines a miner after 2 paid failures in an hour, so it stops before the cap is even touched.
If you try it (npm run probe is free), I'd really value an issue with anything that breaks.
Good question. No: npm run probe is free and never signs a payment, so it can't reproduce a settlement. The 500-that-settles case is covered two ways:
• Offline: a test fakes an HTTP 5xx after signing, with a settlement header, and checks the purse records it as failed_paid and counts it against the cap.
• On-chain: the real occurrences are in the settlement report and reported to Telegraph here: github.com/telegraphprotocol/bounties/issues/228
Reproducing it live needs a miner that's actually down, so I can't trigger it on demand.
The offline fake-5xx test plus the on-chain report covers it well enough for me. A miner that is actually down is the one case you cannot stage on demand.
Putting a dedicated budget layer between the agent and payment signing is the right architecture for paid tool calls. Enforcing per-call and daily caps inside the MCP proxy before signing ensures a runaway retry loop cannot drain a wallet even if the model ignores its policy file.
Logging blocked attempts alongside completed purchases in the same local ledger is another thoughtful detail. In practice, reviewing why an agent tried to buy a fact it already had in context is the fastest way to tighten the skill instructions and cut redundant spend.
Thanks Ahmet, that's exactly why the why field is mandatory. purse_receipts shows each buy next to the agent's one-line reason, so a redundant purchase stands out right away ("user asked for BTC price" twice in a minute = tighten the skill, not raise the cap).
If you have an MCP client handy, I'd love you to run npm run probe (free, about a minute) and tell me where the setup is unclear. Issues welcome: github.com/cipoklean/telegraph-purse/issues
AI Stack Guide — what AI and automation tools really cost, compared from published price lists: Zapier vs Make vs n8n, TTS, email. Full posts: https://theaistackguide.blogspot.com/
The pending-row-before-signing fix handles the crash case, and the other half of it is reconciliation: a small job that scans the burner wallet's transfers and matches each settlement hash to a ledger row. Anything on-chain with no row becomes an orphan instead of staying invisible — that is how you backfill the Nov 11 one you already found.
Two other gaps that a cap in USD does not cover. First, per-intent sub-caps: PURSE_ALLOWED_INTENTS says which facts are allowed, but not how much of the 0.50 any one of them may take, so a weather loop can eat the crypto budget. A per-intent daily amount fixes it with one more column.
Second, quote-to-sign slippage. You quote, check the cap, then sign, and the miner can re-price in between — the DEX problem. Storing the quoted price with the intent and refusing anything above quote + a small tolerance keeps the cap from being a rubber stamp.
Reconciliation: agreed, the pending row only covers the crash case. A job that walks the wallet's USDC transfers and flags any settlement with no ledger row as an orphan is going on the list right next to it. That's exactly how the Nov 11 one would have surfaced on its own.
Per-intent sub-caps: good catch. The allowlist says what the agent may buy, not how much of the day each intent can take. A per-intent daily amount is a small change and I'll add it.
Quote-to-sign slippage: today the cap check runs on the quoted price right before signing. Pinning the signed amount to the stored quote plus a small tolerance, and refusing anything above it, makes the cap a real guarantee instead of a check on a number that can move. Adding that too.
If you want to try any of it, npm run probe runs a dry check without spending, and issues are open on the repo.
A spending cap is strongest when it is paired with idempotency keys and an auditable reservation record. That way a retry cannot silently create a second charge, and an operator can see whether a refusal came from budget, policy, or settlement state.
We're a place where coders share, stay up-to-date and grow their careers.
The failed_paid lesson is the part most budget-guard write-ups skip — a cap that only counts successful purchases is accounting fiction when a down miner can settle 8 failed payments. Recording failures against the cap is the real control here, not the $0.50 daily limit. Do you blacklist a miner after repeated failed_paid events, or does the daily cap alone have to absorb the bleed?
Thanks.
Honest answer: no numbers yet, it only shipped today and hasn't fired in real use. One refinement since: it now ignores failures caused by the settlement layer (facilitator timeouts and the like), so a healthy miner doesn't get blamed for a platform outage. The bad-minute vs bad-hour question is fair; both values are configurable (PURSE_QUARANTINE_FAILS, PURSE_QUARANTINE_MINUTES), and I'll share how often it fires once there's data.
That settlement-layer distinction is the right call — quarantining a healthy miner for a facilitator timeout would erode trust in the guard fast. Looking forward to the firing data once it's had real traffic; the frequency will say a lot about whether the thresholds are tuned right.
Update: shipped it. After 2 failed_paid from the same miner (or the same auto-routed intent) within 60 minutes, the purse now skips it before even asking for a price, and the agent gets a clear "BLOCKED by quarantine" with when it lifts. Both numbers are configurable (PURSE_QUARANTINE_FAILS, PURSE_QUARANTINE_MINUTES).
Thanks for pushing on this. The daily cap is now the last line of defence, not the first.
github.com/cipoklean/telegraph-pur...
Shipped the same morning is the best possible answer to a design question. The 'BLOCKED by quarantine' message with a lift time is the detail that matters — the agent gets a reason, not a silent disappearance, so it can route around the miner instead of retrying into it. Two numbers I'd be curious about once it runs a while: how often the quarantine actually fires, and whether 2-in-60-minutes ever catches a miner that's just having a bad minute rather than a bad hour.
Thanks, this is exactly the trap I fell into first.
Honest answer: there's no automatic blacklist yet. Today it's three layers:
• The skill tells the agent not to retry a miner after a failed_paid, so one bad miner costs one cent per question, not a retry loop.
• PURSE_PIN_MINERS lets you pin an intent to a known-good miner (weather is pinned by default), still paid through Telegraph.
• The daily cap absorbs whatever slips through, because failed_paid counts toward it.
(Telegraph did later credit those 8 failed payments back to escrow, but a client shouldn't count on that.)
Your question convinced me the cap shouldn't be the backstop. I'm adding an auto-quarantine: after 2 failed_paid from the same miner within an hour, the purse skips it and logs why. I'll reply here when it lands.
A failed answer still costing money is a nasty edge. Counting failed_paid against the daily cap is the right call.
Thanks Robert. It surprised me too: the node returned HTTP 500 and still settled. Since then the purse also quarantines a miner after 2 paid failures in an hour, so it stops before the cap is even touched.
If you try it (npm run probe is free), I'd really value an issue with anything that breaks.
Quarantine after 2 paid failures in an hour is a neat guard. The 500-that-settles is still the weird part.
Does the probe run cover the 500-that-settles case, or is that still on the list to reproduce?
Good question. No: npm run probe is free and never signs a payment, so it can't reproduce a settlement. The 500-that-settles case is covered two ways:
• Offline: a test fakes an HTTP 5xx after signing, with a settlement header, and checks the purse records it as failed_paid and counts it against the cap.
• On-chain: the real occurrences are in the settlement report and reported to Telegraph here: github.com/telegraphprotocol/bounties/issues/228
Reproducing it live needs a miner that's actually down, so I can't trigger it on demand.
The offline fake-5xx test plus the on-chain report covers it well enough for me. A miner that is actually down is the one case you cannot stage on demand.
Putting a dedicated budget layer between the agent and payment signing is the right architecture for paid tool calls. Enforcing per-call and daily caps inside the MCP proxy before signing ensures a runaway retry loop cannot drain a wallet even if the model ignores its policy file.
Logging blocked attempts alongside completed purchases in the same local ledger is another thoughtful detail. In practice, reviewing why an agent tried to buy a fact it already had in context is the fastest way to tighten the skill instructions and cut redundant spend.
Thanks Ahmet, that's exactly why the why field is mandatory. purse_receipts shows each buy next to the agent's one-line reason, so a redundant purchase stands out right away ("user asked for BTC price" twice in a minute = tighten the skill, not raise the cap).
If you have an MCP client handy, I'd love you to run npm run probe (free, about a minute) and tell me where the setup is unclear. Issues welcome: github.com/cipoklean/telegraph-purse/issues
The pending-row-before-signing fix handles the crash case, and the other half of it is reconciliation: a small job that scans the burner wallet's transfers and matches each settlement hash to a ledger row. Anything on-chain with no row becomes an
orphaninstead of staying invisible — that is how you backfill the Nov 11 one you already found.Two other gaps that a cap in USD does not cover. First, per-intent sub-caps:
PURSE_ALLOWED_INTENTSsays which facts are allowed, but not how much of the 0.50 any one of them may take, so a weather loop can eat the crypto budget. A per-intent daily amount fixes it with one more column.Second, quote-to-sign slippage. You quote, check the cap, then sign, and the miner can re-price in between — the DEX problem. Storing the quoted price with the intent and refusing anything above quote + a small tolerance keeps the cap from being a rubber stamp.
Thanks, this is really useful.
Reconciliation: agreed, the pending row only covers the crash case. A job that walks the wallet's USDC transfers and flags any settlement with no ledger row as an orphan is going on the list right next to it. That's exactly how the Nov 11 one would have surfaced on its own.
Per-intent sub-caps: good catch. The allowlist says what the agent may buy, not how much of the day each intent can take. A per-intent daily amount is a small change and I'll add it.
Quote-to-sign slippage: today the cap check runs on the quoted price right before signing. Pinning the signed amount to the stored quote plus a small tolerance, and refusing anything above it, makes the cap a real guarantee instead of a check on a number that can move. Adding that too.
If you want to try any of it, npm run probe runs a dry check without spending, and issues are open on the repo.
A spending cap is strongest when it is paired with idempotency keys and an auditable reservation record. That way a retry cannot silently create a second charge, and an operator can see whether a refusal came from budget, policy, or settlement state.