# software-agent-sdk · Budget enforcement

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [software-agent-sdk](https://ai-agents-review.com/runtime/software-agent-sdk.md)
- Column: [Budget enforcement](https://ai-agents-review.com/column/budget-enforcement.md) (Execution controls)
- Mark: 2 s
- Default deployment: 2
- Best supported configuration: 2
- Page: https://ai-agents-review.com/cell/software-agent-sdk/budget-enforcement

## Rationale

500 iterations and post-step $ cap; child cost merged only at completion does not meet 'covering descendants' (R4)

## Rubric criteria for this column

- 0: No limits of any unit, and no usage reporting
- 1: Usage or cost reported only, **or** only coarse safety caps (retry counts, iteration ceilings ≥1000, wall-clock timeouts ≥ hours)
- 2: An enforced work limit (turns/steps/iterations at a practical default) **or** a $/token limit checked after each step, per run
- 3: A $ or token limit checked **before** the model call (admission) for a run, **or** a post-step $ limit covering descendants
- 4: Pre-call admission across the whole delegation tree, with stated settlement of in-flight calls

## Review finding

`max_iteration_per_run` defaults to 500. `max_budget_per_run` ($, default None) is checked after each step against the conversation's accumulated cost across all its LLMs. It is not a pre-call check, so a step can overshoot, and unknown costs (None) are never counted. Subagents get the parent's full cap; a child's cost reaches the parent's total only when the child's metrics are synced at completion. [X124][X134][X135][X136][X137][X138] Note X-5

## Evidence cited by the mark

- [X124] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-sdk/openhands/sdk/conversation/state.py#L162-L186 — max_iterations 500, max_budget_per_run None (accumulated conversation cost), NeverConfirm, analyzer None — [S]
- [X135] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py#L2777-L2783 — budget checked after each step (post-hoc), MaxBudgetReached — [S]
- [X138] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-tools/openhands/tools/task/manager.py#L502-L510 — child metrics merged into parent stats after child finishes — [S]

## Evidence also cited by the review finding

- [X134] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-sdk/openhands/sdk/conversation/impl/local_conversation.py#L858-L882 — budget check uses combined accumulated cost of all the conversation's LLMs — [S]
- [X136] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-sdk/openhands/sdk/llm/utils/telemetry.py#L505-L556 — cost source header, usage, litellm; failure returns None — [S]
- [X137] software-agent-sdk — https://github.com/OpenHands/software-agent-sdk/blob/cf8158bc25f5552c50ad131a5f0ce2dbc297789b/openhands-tools/openhands/tools/task/manager.py#L262-L290 — sub-agent cap = definition value else parent's full cap — [S]

## Grading record

- Grader A (default / best): 2 / 2
- Grader B (default / best): 2 / 3
- Adjudication: disagreement; R4. 500 iterations and post-step $ cap; child cost merged only at completion does not meet 'covering descendants' (R4)
