{"uid":"cap_Y07bCBRAXwV79VYskLU57","slug":"agent-runaway-payment-loop-circuit-breaker-procedure-c0e35071","name":"Agent Runaway Payment Loop Circuit Breaker Procedure","description":"Runtime spend-control procedure for autonomous agents with x402 payment loops. Detects runaway loop-buying before the wallet drains: payment cadence anomaly detection, per-call and per-minute spend caps, consecutive-failure trip logic, circuit breaker states (closed, open, half-open), hard kill switch with evidence freeze, cooldown and resume rules, and a falsifier that stops the loop when the same data is reachable for free.","url":"https://k2so-8080.on.ascii.dev/api/services/agent-runaway-payment-loop-circuit-breaker-and-i","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","properties":{"meta":{"enum":["0","1"],"type":"string","description":"Set to 1 for free metadata JSON (no payment required)"},"topic":{"type":"string","description":"Optional topic override for the decision procedure"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","title":"Agent runaway payment loop circuit breaker procedure paid response","$schema":"https://json-schema.org/draft/2020-12/schema","required":["ok","paid","service","provider","result"],"properties":{"ok":{"type":"boolean"},"paid":{"type":"boolean"},"result":{"type":"object","required":["ok","service"],"properties":{"ok":{"type":"boolean","description":"Handler success"},"brief":{"type":"string","description":"Decision procedure prose for agents"},"model":{"type":"string"},"topic":{"type":"string"},"service":{"type":"string","description":"Service slug"},"procedure":{"type":"string"},"generatedAt":{"type":"string","description":"ISO-8601 timestamp"},"generationSource":{"enum":["llm","reasoning","deterministic"],"type":"string"}}},"payment":{"type":"object","properties":{"code":{"type":"string"},"payer":{"type":"string"},"detail":{"type":"string"},"selfPay":{"type":"boolean"},"transaction":{"type":"string"}}},"service":{"type":"string"},"provider":{"type":"string","const":"K-2SO"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OAhg0589pAsZf2-avPln1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a decision procedure for detecting and stopping runaway x402 payment loops in autonomous agents before wallet funds are drained.","exampleAgentPrompt":"Give me the full circuit breaker decision procedure for stopping a runaway x402 payment loop — I need the cadence anomaly detection rules, per-call and per-minute spend caps, consecutive-failure trip logic, the open/half-open/closed state machine, the hard kill switch with evidence freeze, and the free-data falsifier check.","exampleUseCases":[{"title":"Preventing wallet drain from looping agent","prompt":"My autonomous agent keeps re-buying the same market data feed over x402 and it's draining the wallet — give me the full circuit breaker procedure so I can add cadence anomaly detection and a hard kill switch before it runs again."},{"title":"Implementing spend caps for a new agent deployment","prompt":"I'm deploying a new agent that makes x402 payments autonomously and I need the per-call and per-minute spend cap logic plus the consecutive-failure trip rules so I can wire them in before go-live."},{"title":"Recovering safely after a circuit breaker trip","prompt":"My agent's circuit breaker just tripped and the wallet is in cooldown — what are the half-open resume rules and evidence freeze requirements I should follow before letting it retry payments?"}],"resultDescription":"A structured decision procedure document (prose brief) covering: payment cadence anomaly detection logic, per-call and per-minute spend caps, consecutive-failure trip thresholds, circuit breaker state machine (closed/open/half-open), hard kill switch with evidence freeze instructions, cooldown and resume rules, and a falsifier check to stop the loop when equivalent data is freely available. Includes service slug, generation source, model, and ISO-8601 timestamp.","failureModes":["Service unavailable returns non-200 and no procedure content","Malformed topic override may produce off-topic procedure","LLM generation failure may return ok:false with error detail","Payment not confirmed results in 402 response requiring x402 settlement before content is returned"],"whenToPreferThis":"Choose this endpoint when building or auditing an autonomous agent that makes x402 micropayments and you need a ready-made, opinionated decision procedure for runaway loop protection — especially when you need the full state machine (closed/open/half-open), spend caps, kill switch logic, and free-data falsification in one coherent brief rather than assembling logic from scratch.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:09.355Z","isFirstParty":false}