‹ Harness Lab
prototype · no live model

STAGE 11 · FINOPS MIDDLEWARE

Budgets as Code

An agent loop that projects its total spend before every step, halts the instant the projection breaks the budget, and degrades to a cached partial answer instead of dying.

Run controls

Tier prices per step: Frontier $0.045 · Mid $0.012 · Local $0.002 · Cache $0. The loop plans up to 24 steps. Task B is a near-duplicate of A on purpose: run A first, then B. Then try a $0.25 budget on task C to watch the kill switch and the fallback chain fire.

Spend live, per step

SPENT
$0.000
PROJECTED TOTAL
$0.000
STEPS
0 / 24
TIER MIX
none yet
bar: spent vs budget · red tick: projected total · the loop halts before any step that pushes the tick past the budget
FALLBACK CHAIN
Frontierfull agent loop → Middegraded resume → Localcheap finish → Cachepartial answer

Step log

No run yet.
KILL LOG

Semantic cache overlap = |A∩B| / min(|A|, |B|) over word tokens, hit at 0.80 or above

Cache is empty. Completed runs are stored here.
SIMILARITY OF SELECTED TASK TO CACHE
Select a task to compute.

Answer

Nothing served yet. Run the loop.

The projection formula

What the middleware checks before every step

projected = spent + cost(next step) + rate × steps remaining. The rate is the run's real average cost per step, shrunk toward the router policy rate ($0.012 expected per step under the 12/45/43 tier mix) with a prior weight of 8 steps, so one expensive opening step cannot poison the estimate, but a run that keeps reaching for the frontier tier still watches its projection climb. The check runs before the step executes: if projected is greater than the budget, the step never runs, the halt is logged with the exact numbers, and the fallback chain serves the best partial answer assembled from the steps that did complete.

WHAT THIS PROVES