until
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
The until block repeats a set of steps until a condition evaluates to true. The condition is checked after each iteration, so the body always executes at least once.
Syntax
until steps.refine.quality > 0.9 ask refine using "anthropic:claude-sonnet-4-6" with task "Improve the quality of this draft. Current score: ${steps.refine.quality}." returns content as text quality as numberHow it works
- The body steps execute
- The condition expression is evaluated
- If the condition is true, the loop exits and the last iteration’s result becomes the block output
- If the condition is false, the body executes again from the top
- Each iteration produces its own step events in the behavioral ledger
Governance
Each iteration of the until loop is individually governed. Every step inside the body goes through the governance pipeline on every pass. This means:
- An
askstep inside the loop checks permissions and records costs on each iteration - Token budgets are checked before each LLM call, not once for the entire loop
- If a permission check fails mid-iteration, the loop halts (unless wrapped in
on failure) - Cost tracking reflects the total cost across all iterations
The until block itself is a control-flow construct and does not require its own permissions.
Step type
until blocks have step type :control in the execution trace. Steps inside the body retain their own types (:reason, :call, etc.).