{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreic455de6ew6lpe4vqrlvz3dd27lwqodmlpjxpicew6pka5tzpa5ja",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mnssrfwclcc2"
  },
  "path": "/t/has-anyone-actually-solved-runaway-agent-costs-looking-for-patterns-beyond-logging/1383094#post_1",
  "publishedAt": "2026-06-08T22:45:33.000Z",
  "site": "https://community.openai.com",
  "textContent": "Running into something I can’t find a clean answer to.\n\nThe Agents SDK gives great observability — you can trace every call,\nlog every token. But logging isn’t enforcement. If an agent loops or\nretries aggressively, the cost accumulates in real time and the trace\nshows you what happened after the fact.\n\nI’ve been looking at a few approaches:\n\n  1. Wrap each tool call with a pre-check that queries a spend ledger\nbefore execution — hard stop if the policy would be breached\n  2. Custom Runner subclass that intercepts before model calls\n  3. External policy engine the agent calls as a tool\n\n\n\nOption 3 is what I’ve been building — treating budget as a tool the\nagent calls before any paid operation. The agent asks “can I spend\n$0.05?” and gets approved/denied before the call fires.\n\nHas anyone else approached this differently? Curious whether the\ncommunity has patterns for hard enforcement (not just monitoring)\nat the agent level.",
  "title": "Has anyone actually solved runaway agent costs? Looking for patterns beyond logging"
}