Skip to content

Bounds

A bound limits what a run can spend. The selected adapter counts an authored bound only when its capability plan marks that bound as enforced.

bounds:
iterations: 40
cost: $2.50
wall_clock: 20m
edits: { max_files: 5, max_changed_lines: 200 }

The bounds field is optional. An omitted bound is authored-unbounded. It is not a writ clause.

The managed writ issue adapter adds operational limits when iterations, cost, or wall_clock is omitted. These limits protect the managed model loop. They do not become authored clauses. Other adapters do not get an authored bound from omission.

Bound Unit Managed operational default
iterations One turn of the loop 25
cost Dollars $1.00
wall_clock Time 15m
edits.max_files Files that the run changes None
edits.max_changed_lines Lines that the run changes None

Use writ plan <file> --agent <agent> or --target <target> before a run. writ start refuses an attached writ when the selected hook cannot enforce an authored bound.

One iteration is one turn of the loop: the model gets the messages, and the model answers. The value must be a whole number of 1 or more.

bounds:
iterations: 40

This bound replaces the retry code that you write by hand. A run that cannot finish the work in 40 turns stops at 40 turns.

The cost bound is a dollar amount. Write the amount with a $, and with a maximum of six decimal places.

bounds:
cost: $2.50

The registrar counts the cost from the token counts of the run and the pricing values in the engagement configuration. The registrar does not ask the provider for a price.

If a judge does the work of a judgment clause, the judge spends part of this same amount. The budget_share value of the judge gives that part.

The wall_clock bound is a period of time. Write a Go duration, such as 90s, 20m, or 2h.

bounds:
wall_clock: 20m

The edits bounds limit the size of the change.

bounds:
edits: { max_files: 5, max_changed_lines: 200 }
Field Limit
max_files The number of files that the run can change.
max_changed_lines The number of lines that the run can change.

These two bounds make the instruction “make a small change” into a limit that a machine can count. A model cannot agree with a vague instruction and then change 40 files.

In managed use, these counts follow the writ issue worktree effect boundary. Ignored files and .writ are inside the boundary. .git metadata is outside it.

Each field is optional. If you write no edits bound, the registrar counts no limit on the size of the change.

A bound breach starts the on_bound_breach remedy. In managed mode, an omitted bound remedy gets an operational halt response. The run stops and Writ exits with code 1.

To select a different response, write a remedy:

remedies:
on_bound_breach: { do: halt, inform: issuer }

Do not edit a bound by hand while you compare runs. Use the writ amend command:

Terminal window
writ amend bug-fixer.yaml --cost $5.00 --iterations 60

The command narrows a bound immediately. The command asks for confirmation before it widens a bound.