External Publication
Visit Post

Has anyone actually solved runaway agent costs? Looking for patterns beyond logging

OpenAI Developer Community June 8, 2026
Source
Running into something I can’t find a clean answer to. The Agents SDK gives great observability — you can trace every call, log every token. But logging isn’t enforcement. If an agent loops or retries aggressively, the cost accumulates in real time and the trace shows you what happened after the fact. I’ve been looking at a few approaches: 1. Wrap each tool call with a pre-check that queries a spend ledger before execution — hard stop if the policy would be breached 2. Custom Runner subclass that intercepts before model calls 3. External policy engine the agent calls as a tool Option 3 is what I’ve been building — treating budget as a tool the agent calls before any paid operation. The agent asks “can I spend $0.05?” and gets approved/denied before the call fires. Has anyone else approached this differently? Curious whether the community has patterns for hard enforcement (not just monitoring) at the agent level.

Discussion in the ATmosphere

Loading comments...