# AgentBudgetResolver
Source: https://docs.maelstrom-ai.co/dev/reference/engine/type-aliases/agentbudgetresolver/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **AgentBudgetResolver** = (`ctx`) => `Partial`<[`AgentRunBudgets`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentrunbudgets/)\> | `Promise`<`Partial`<[`AgentRunBudgets`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentrunbudgets/)\>>

Defined in: [packages/engine/src/lib/agent-session/agent-config.ts:54](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/agent-config.ts#L54)

Picks the budgets for one Agent Run. Called once per run before the run starts. Returned fields replace the Engine defaults, and omitted fields keep them. The same validation as static budgets applies, so an unknown field ends the run with an error. A throw or rejection also ends the run with an error, as does a resolver still pending after the default `maxElapsedMs` of 120,000 ms. The resolver caps a single run, not total spend.

The agent loop is experimental in 0.3 and may change in any minor release.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

## Parameters

### ctx

[`AgentRunContext`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentruncontext/)

## Returns

`Partial`<[`AgentRunBudgets`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentrunbudgets/)\> | `Promise`<`Partial`<[`AgentRunBudgets`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentrunbudgets/)\>>
