Skip to main content
The harness tracks cumulative cost across all LLM calls in a run and enforces budget caps in enforce mode.

Per-Run Budget

Set a budget cap on a scoped run:
When cumulative cost exceeds the budget:
  • In observe mode: the trace records action: "stop" with applied: false
  • In enforce mode: the harness stops execution with action: "stop" and applied: true

Per-Agent Budget

Attach budget metadata to agent functions:

Budget Pressure Routing

When budget is partially consumed, the harness can route to cheaper models. This happens automatically when KPI weights include a cost dimension:

Cost Calculation

Cost is estimated from the built-in pricing table:
The pricing table covers 18 models across OpenAI, Anthropic, and Google. Unknown models are resolved via fuzzy matching.

Combining with Tool Call Caps

Budget and tool call caps work together:
The harness checks all constraints at every step. The first constraint that is violated triggers the corresponding action (stop for budget, deny_tool for tool calls).