PyxGrant / FinOps

A budget that can say no before the spend.

Most cost tools report the bill after it arrives. PyxGrant forecasts the cost of each call inside the same decision that checks PHI and secrets, and it can refuse the call.

run budget, checked per calllive
billing-loop · run budget$0.00 / $5.00
    9cost buckets on every decision
    3rdidentical call is where a loop is stopped
    1ledger shared by every child of a run
    2exports: FOCUS CSV and a GL file
    Loops

    The runaway agent stops on the third call.

    The seeded billing agent repeats the same $4,200 hop. The first two are allowed. The third identical call is refused with R-LOOP and the wallet is drained, so a retry storm cannot keep spending.

    Bursts. Different calls that add up past $5 inside a minute are refused with R-BURST.
    Degrade. Under 20 percent of a wallet, eligible calls move to the cheaper BAA model.
    billing-loop · wal-billing$50,000
    call 1  slack.post "reconcile batch 18"  ALLOW  -$4,200
    call 2  slack.post "reconcile batch 18"  ALLOW  -$4,200
    call 3  slack.post "reconcile batch 18"  DENY   R-LOOP
            wallet drained  circuit break
    Run budgets

    One budget for the whole run, however many processes it spawns.

    Pass a run id and a limit. The first limit sticks. Every agent and session that carries that run id debits the same ledger, and only calls that actually proceed are debited.

    run-7 · limit $2.00shared
    process A   forecast $1.50   ALLOW   spent $1.50
    process B   forecast $1.50   DENY    R-RUN
                ledger stays at $1.50
    Showback

    Debited and avoided spend by agent and purpose.

    Every decision records forecast, debited, and avoided cost across nine buckets: LLM tokens, tools, retrieval, sandbox and GPU, egress, memory, human review, waste, and the control plane itself.

    FOCUS export. Load it into the cost tool you already use.
    GL file. One line per wallet, by cost center.
    Our own cost is a bucket. The control plane is metered like everything else.
    /api/export/focuscsv
    ChargePeriodStart,ServiceName,BilledCost,ResourceId,Tags
    2026-09-24,LLM tokens,0.18,claude-platform,bucket=llm_tokens
    2026-09-24,MCP and SaaS tools,0.12,claims-bot,bucket=tool_apis
    2026-09-24,PyxGrant control plane,0.01,alidade-control,bucket=control_plane

    Put a ceiling on agent spend this week.

    Wallets and run budgets work on the same checkpoint that already enforces security.