Skip to main content
Loop.define(config) is a pure function: it does no I/O and claims nothing. It returns a LoopDefinition — the handle whose methods do the work:

LoopConfig

Only goal is required.
{ file } next to a binding key ({ file: "./verify.md", model: "…" }) is refused with a teaching error at startup — write { prompt: { file }, model }.

Prompt

The judgment-bearing text you own — one shape for its three homes (goal, execute, verify):
  • Literal string — never touches disk.
  • { file } — re-read fresh at each Round start, so a mid-loop edit retargets from the next Round. Missing or unreadable is a loud error naming the path, never a silent literal.
  • Function — called per Round with the deliberately starved PromptCtx: { round, previous? }. round is 1-based across the whole Loop; previous (absent only when nothing precedes) always carries feedback: string, plus verdict iff the last Round produced one. Every function-form Prompt receives the same ctx, whichever home it lives in.

Limits

Every field optional; omitted, each falls back to an engine default. Time values use the Duration grammar — a whole number with a unit: "45s", "90m", "36h", "7d". Fields typed number | Duration also read a bare number of seconds.

Permissions

How tool calls are gated while no Sandbox contains the Run, resolved per phase: phase override > loop-level > phase default (execute "auto", verify "read").