# Agent Limits

Configure per-agent execution guardrails, per-turn credit budgets, output token caps, and timeout profiles under **Advanced → Limits** in the [agent editor](/agents) (or via the `limits:` object in the _Code_ YAML tab).

The **Advanced** section stays collapsed by default unless any limit is already configured.

```yaml
limits:
  toolIterations: 25
  turnCredits: 150
  outputTokens: 4096
  timeouts: batch
```

## Max Tool Steps {#max-tool-iterations}

When an agent uses [tools](tools/index.md), tool calling runs in a loop for up to **7 tool execution rounds** per turn by default. Multiple tool calls returned together in a single model response count as one round.

If a task needs more steps and reaches this limit, the turn pauses cleanly as an amber **Continue** checkpoint instead of failing. You can click **Continue** right in the chat to resume from where the agent left off, or increase **Max Tool Steps** (from `1` up to `128`) under **Advanced → Limits** or via `limits.toolIterations` in YAML.

## Max Turn Credits {#max-turn-credits}

To guard against runaway compute usage in deep agent loops, each turn enforces a default per-turn budget of **50 credits** ([BYOK](key.md) accounts using their own key are not subject to credit caps).

If a multi-step turn reaches this limit, it pauses as an amber **Continue** checkpoint so you can review intermediate progress and click **Continue** to proceed with a fresh per-turn budget. You can adjust **Max Turn Credits** (from `1` up to `1000`) under **Advanced → Limits** or via `limits.turnCredits` in YAML.

## Max Output Tokens {#max-output-tokens}

Optionally caps the maximum number of output tokens per model response (`>= 1`) when set, subject to remaining credit affordability clamping (`limits.outputTokens` in YAML). Leave empty to use the selected [model](models.md)'s default.

## Timeouts {#timeouts}

Selects the execution timeout and retry profile (`interactive` for fast conversational turns or `batch` for long-running worker agents via `limits.timeouts` in YAML). Leave unset to use automatic defaults (`batch` for configured coding runtimes, `interactive` otherwise).
