Practical technical guides / Recent development: openai-agents-python v0.24.0-alpha.8 (16 November 2026)

Validate Tool Arguments Before Asking for Approval, and Keep Spent Budget Across a Restore

The 16 November 2026 Agents SDK prerelease validates strict tool arguments before approval and keeps spent budget across a supported restore. Why both rules matter.

By Sandeep Belgavi · Published 2026-11-16

The 16 November 2026 Agents SDK prerelease validates strict tool arguments before approval and keeps spent budget across a supported restore. Why both rules matter.

Two small lines in a long prerelease

OpenAI published v0.24.0-alpha.8 of the Agents SDK for Python on 16 November 2026, marked on GitHub as a prerelease, with wheels attached to the release rather than published as a regular package version. Most of its notes describe new surfaces: managed approvals for Python tools, application-owned model clients, realtime voice in a session, more storage backends. Two smaller entries are about the order and accounting of things an agent runtime does around a tool call, and they apply to any runtime, whether or not you use this SDK.

The first, under Fixed: strict Python tools return a retryable error to the model when the original arguments fail validation, before approval or callback execution, and a corrected call still goes through approval when required. The second, under highlights and upgrading: request and token budgets keep the usage already spent when you restore a supported checkpoint.

Both are statements about what must stay deterministic around a non-deterministic model. This guide explains why each matters, shows the effect with a small synthetic runtime, and lists the limits the release notes and the SDK's budgeted-recovery guide put on them.

Validate before you ask a person

An approval prompt is expensive. It interrupts someone, and it is only useful if the person is approving the action that will actually run. If arguments are validated after approval, two things go wrong. A reviewer is asked to approve calls that can never run, for example a refund whose amount is the word twenty, and learns to approve quickly. And if validation or coercion changes the arguments after the decision, the action that runs is not the action that was approved.

The order the prerelease describes is the safe one: schema validation first, then any input policy, then the approval decision, then the callback. Invalid arguments go back to the model as a retryable error without involving the reviewer, and only a valid call reaches the approval step. The notes add an option, run_input_policy_before_approval=True, to run the input policy before the approval predicate as well as before execution, which extends the same idea to policy checks.

Keep spent budget across a restore

A run budget caps how many model requests or tokens one run may use. Long-running agents are checkpointed while they wait, most often for an approval, and restored later, possibly in a new process. If the restored run starts with a fresh budget, every restart grants a new allowance. A run that waits for approval through two deployments can spend three times its limit without any single process seeing a violation.

The prerelease saves the consumed allowance with supported checkpoints. Its budgeted-recovery guide adds conditions that are worth copying into any runtime: on restore, the application must supply the same limits from its current trusted configuration, not read them back from the saved file; a mismatch raises an error rather than silently adopting either value; the saved counters are not authenticated by shape validation, so the application must verify checkpoint integrity itself; and reopening the same checkpoint twice does not give the two copies a shared allowance.

The worked example

The companion runtime is not the SDK and calls no model. A fixed script of seven model samples asks for a refund for order BB-2210 twice with invalid arguments, then validly, then makes three lookups and answers. The refund tool requires approval. The run has a budget of five requests. Each configuration runs with no restarts and with two process restarts while the refund waits for approval.

Check orderBudget on restoreRestartsRequests madeOver budget byApproval promptsPrompts for invalid arguments
Ask the reviewer firstcarried05032
Ask the reviewer firstcarried25032
Ask the reviewer firstfresh per process27232
Validate firstcarried05010
Validate firstcarried25010
Validate firstfresh per process27210

Validating first removes two of three approval prompts, both of which asked a person to approve a call that would then fail. The carried budget stops the run at five requests regardless of restarts. The fresh budget lets the run finish with seven, because each restore zeroed the counter. In neither ordering did invalid arguments reach the tool callback; the difference is entirely in reviewer attention and in spend.

The core of the restore logic in the example is two lines:

saved = used
used = saved if budget_mode == 'carry' else 0

The bug in real systems is rarely that explicit. It usually appears as a budget object that is constructed in the session constructor and never serialised with the checkpoint.

Limits stated in the release

The notes and guides draw clear boundaries, and a design that relies on these behaviours should respect them:

  • Supported paths only. Budget retention applies to supported portable checkpoints, such as a pending manual tool reply or a managed function approval. Estimated-cost limits are live-only for active turns and reject portable capture.
  • Same-backend storage restores are narrower. For the CustomStorage path that continues through the original backend, the notes say managed function approvals, pending MCP requests and staged input stay outside that restore path.
  • What a request means. The request limit counts root sampling admissions. Transport retries and child requests do not charge it, and a token budget can be overshot by one response before the next admission check stops the run.
  • Older versions reject the new format. Alpha.8 adds checkpointing for pending runs with request or token budgets, and the notes say alpha.7 rejects that new format because it cannot enforce the saved budget. Rolling back after alpha.8 has written a budgeted checkpoint therefore needs a backup of the earlier state, which the notes ask users to take before upgrading.

These are prerelease behaviours. Pin the exact version, read the linked guide at the release's commit, and run the SDK's own tests for the paths you use before depending on them.

Applying the same rules in your own runtime

Whether or not you adopt this SDK, the two rules transfer directly:

  1. Order the checks around a tool call as validate, apply policy, decide approval, execute. Show the reviewer the validated, normalised arguments, and execute exactly those.
  2. Return invalid arguments to the model as a structured, retryable error. Count those errors; a model that needs several attempts per call is a prompt or schema problem worth fixing.
  3. Store consumed budget in the checkpoint, next to the pending call it protects.
  4. On restore, take limits from current configuration and compare them with the saved limits. Refuse to restore on mismatch rather than picking one.
  5. Treat restore of the same checkpoint in two processes as a hazard. Idempotency keys and effect records, not the budget, prevent a duplicated side effect.

Failure modes

  • Approval of unnormalised input. The reviewer sees "20" and the tool receives 20.0 after coercion. Harmless here, dangerous for identifiers.
  • Budget stored but not enforced on restore. Saved counters are useless if the restored run constructs a new budget object.
  • Budget taken from the checkpoint. A tampered or stale checkpoint then raises its own limit. Use configuration.
  • Validation errors that are not retryable. If the model receives a terminal error, the run ends instead of correcting the call.

Verification

The companion tests pin the table above and check the two invariants directly: validating first never prompts for invalid arguments, and a carried budget never exceeds its limit for zero to five restarts. For your own runtime, the decisive test is a restart in the middle of an approval wait, followed by a count of total requests against the configured limit.

Primary references and authorship

Sources dated on or before 16 November 2026. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/approval_order_budget_restore. Views are my own and do not represent any employer, past or present.