# LoopSettings

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/http-api/schemas/loopsettings/
> Summary: OpenAPI request or response schema for LoopSettings, including required fields, defaults, constraints, and linked nested types.

[← All HTTP schemas](/http-api/schemas/)

Turns the harness loop on: the agent is re-invoked until a stop criterion
says the work is finished.

**Shape:** `object`

| Property | Required | Type | Description | Rules |
|---|---|---|---|---|
| `criteria` | yes | array of [`LoopCriterion`](/http-api/schemas/loopcriterion/) | Gets the stop criteria, evaluated in order. At least one is required. | — |
| `maxIterations` | no | `integer (int32)` | Gets the upper number of loop iterations. `null` takes `DefaultMaxIterations`. Must be greater than zero. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `freshContextPerIteration` | no | `boolean` | Gets a value that starts every iteration from a fresh context instead of carrying the previous iterations' messages forward. | — |
| `onExhausted` | no | [`LoopOutcome`](/http-api/schemas/loopoutcome/) | Gets what happens when the iteration ceiling is reached while a criterion still asks for another iteration. LoopOutcome.ReturnLastResponse by default. | — |
| `onCriterionError` | no | [`LoopOutcome`](/http-api/schemas/loopoutcome/) | Gets what happens when a criterion throws while it is evaluated. LoopOutcome.ReturnLastResponse by default. | — |
