# codex · 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: [codex](https://ai-agents-review.com/runtime/codex.md)
- Column: [Budget enforcement](https://ai-agents-review.com/column/budget-enforcement.md) (Execution controls)
- Mark: 1→4 [opt: rollout_budget (under development)] s
- Default deployment: 1
- Best supported configuration: 4 (opt: rollout_budget (under development))
- Page: https://ai-agents-review.com/cell/codex/budget-enforcement

## Rationale

Default token_budget only steers, cost display only; rollout_budget is pre-call tree-wide admission, in-flight calls billed

## 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

Goal `token_budget` (goals on by default) is soft: once tokens reach the budget the goal becomes `BudgetLimited` and a steering message is injected. [opt: `rollout_budget`, under development, off] adds a hard weighted-token admission gate shared across the agent tree; in-flight responses are still billed. $ turn cost is polled from the backend for display. No turn cap. [X12][X13][X14][X15][X16][X17]

## Evidence cited by the mark

- [X12] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/state/src/runtime/goals.rs#L290-L300 — goal status set to BudgetLimited when tokens_used >= token_budget — [S]
- [X14] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/core/src/rollout_budget.rs#L17-L40 — tree-shared work gate consulted before new work; in-flight work still billed — [S]
- [X15] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/features/src/lib.rs#L2415-L2437 — `goals` Stable default on; `rollout_budget` UnderDevelopment default off — [S]

## Evidence also cited by the review finding

- [X13] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/ext/goal/src/extension.rs#L539-L549 — BudgetLimited injects steering message (soft) — [S]
- [X16] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/core/src/config/mod.rs#L3131-L3197 — RolloutBudgetConfig validation (missing/non-positive limit errors; weighted token units) — [S]
- [X17] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/app-server/src/turn_cost_worker.rs#L1-L32 — turn cost polled from backend every 150 s (API-key users) — [S]

## Grading record

- Grader A (default / best): 1 / 4
- Grader B (default / best): 1 / 4
