{"uid":"cap_n3x9rmBgDKQKo4fI3Z_Gj","slug":"aibrake-agent-safety-check-d443c63c","name":"AIBrake Agent Safety Check","description":"Agent safety for paid AI agents — loop detection, model stop-loss, retry-storm catch, and unverified-deploy block. Live x402 API at $0.005 per check, 18× ROI on average. Stops stale retries, same-tool loops, and premium-model burn before the next expensive step. Privacy-first. <50ms P95.","url":"https://api.aibrake.dev/x402/v1/check","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["actor","next_action"],"properties":{"actor":{"type":"object","required":["type"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"runtime":{"type":"string"}}},"spend":{"type":"object","additionalProperties":true},"history":{"type":"object","additionalProperties":true},"objective":{"type":"object","properties":{"id":{"type":"string"},"goal":{"type":"string"},"budget":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"hard_limit":{"type":"boolean"}}}},"additionalProperties":true},"next_action":{"type":"object","required":["type","estimated_cost"],"properties":{"type":{"type":"string"},"model":{"type":"string"},"reason":{"type":"string"},"provider":{"type":"string"},"estimated_cost":{"type":"object","required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string"}}}},"additionalProperties":true},"telemetry_quality":{"type":"object","additionalProperties":true}},"additionalProperties":true},"output":{"type":"object","required":["decision","risk_score","pattern","reason","suggested_action"],"properties":{"reason":{"type":"string"},"pattern":{"type":"string"},"decision":{"enum":["allow","warn","require_confirmation","block","uncertain"],"type":"string"},"confidence":{"type":"number"},"risk_level":{"type":"string"},"risk_score":{"type":"number","maximum":100,"minimum":0},"matched_rules":{"type":"array","items":{"type":"string"}},"policy_version":{"type":"string"},"detector_version":{"type":"string"},"suggested_action":{"type":"object","properties":{"type":{"type":"string"}}},"projected_savings":{"type":"object","properties":{"basis":{"type":"string"},"currency":{"type":"string"},"amount_usd":{"type":"number"}}},"recommended_policy":{"type":"string"}},"additionalProperties":true}}},"responseSchema":{"type":"json","example":{"reason":"Attempt #7 on the same exception: 6 prior repeats with no evidence gathered in any attempt. Another paid retry is unlikely to produce a different result without a context refresh.","pattern":"stale_context_retry_storm","decision":"require_confirmation","confidence":0.9,"risk_level":"critical","risk_score":100,"matched_rules":["failure_signal_present","same_failure_count_high","no_new_evidence_since_last_attempt"],"policy_version":"policy@0.1.0","detector_version":"stale_context_retry_storm@0.1.0","suggested_action":{"type":"context_refresh"},"projected_savings":{"basis":"projected_future_attempts","currency":"USD","amount_usd":1.26},"recommended_policy":"ask_human"}},"example":{"request":{"input":{"actor":{"id":"agent-001","name":"TestAgent","type":"agent","runtime":"python-3.11"},"spend":{"currency":"USD","total_spent":0.5},"history":{"last_action_type":"search","previous_actions":1},"objective":{"id":"obj-123","goal":"Process user request","budget":{"amount":1,"currency":"USD","hard_limit":true}},"next_action":{"type":"model_inference","model":"gpt-4","reason":"Generate summary for user query","provider":"openai","estimated_cost":{"amount":0.03,"currency":"USD"}}}},"response":{"docs":"https://aibrake.dev","openapi":"https://api.aibrake.dev/v1/meta","payment":{"price":"$0.005 per check decision","network":"Base mainnet","protocol":"x402"},"service":"AIBrake — Agent safety for paid AI agents","endpoint":"POST https://api.aibrake.dev/x402/v1/check","description":"Agent safety for paid AI agents — loop detection and model stop-loss. POST with a SpendingGuardCheckInput payload to get one decision per request.","primary_mode":"stale_context_retry_storm","supported_modes":["stale_context_retry_storm","same_tool_retry_loop","model_escalation_without_evidence","objective_drift","task_budget_breach","unverified_success_assertion"]}},"exampleRequest":{"input":{"actor":{"id":"agent-001","name":"TestAgent","type":"agent","runtime":"python-3.11"},"spend":{"currency":"USD","total_spent":0.5},"history":{"last_action_type":"search","previous_actions":1},"objective":{"id":"obj-123","goal":"Process user request","budget":{"amount":1,"currency":"USD","hard_limit":true}},"next_action":{"type":"model_inference","model":"gpt-4","reason":"Generate summary for user query","provider":"openai","estimated_cost":{"amount":0.03,"currency":"USD"}}}},"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ZF4_hacn9CQ2s3N8kunMs","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates a proposed AI agent action for safety risks including loop detection, retry storms, and model cost overruns, returning a decision to allow, warn, block, or require confirmation","exampleAgentPrompt":"Before I call GPT-4o again for attempt #7 on this same failing task that has cost $0.84 so far with no new evidence gathered, check if I should proceed — my actor type is 'llm_agent', the next action type is 'llm_call', estimated cost is $0.18 USD, and my goal is to extract structured data from a PDF.","exampleUseCases":null,"resultDescription":"Returns a structured safety decision (allow / warn / require_confirmation / block / uncertain) with a 0–100 risk score, risk level label, detected behavioral pattern (e.g. stale_context_retry_storm), matched rule names, confidence score, suggested corrective action type, and a projected USD savings estimate if the action is halted.","failureModes":["Missing required fields (actor.type or next_action.estimated_cost) returns a 400 validation error","Payment not included or insufficient USDC causes 402 Payment Required","Ambiguous or incomplete history may result in an 'uncertain' decision with low confidence","Network timeouts are rare given <50ms P95 but possible under high load","Malformed input schema returns parse error without a safety decision"],"whenToPreferThis":"Use AIBrake when you are operating an autonomous or semi-autonomous AI agent that makes paid API calls (LLM inference, tool calls, deploys) and you want a fast, cheap ($0.005) pre-flight safety check before each expensive step. Ideal when agents may get stuck in retry loops, risk exhausting a budget, or trigger unverified deploys. Prefer this over manual rule-writing or no-op checks when you need sub-50ms latency, pattern-based detection (loop, storm, stale context), and ROI-positive cost savings for paid agentic workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:30:35.478Z","isFirstParty":false}