Cost detection in minutes

Findings are recomputed every six hours. A runaway agent can spend a month's budget in one of those gaps, and a page that is triggered by something that runs four times a day is useless. So cost has a fast check: every minute, over recent records only, a small set of rules opens, updates or resolves a finding at once and emits a feed event. Alerting and incidents work from the same record as every other finding. The six-hourly check is unchanged for everything else, and it never resolves these.

In the product

Budgets and detection with budget controls and detection timing

Product capture, 15–16 November 2026. Open the image for full size. Counts and dates are examples from the captured workspace.

Open Cost, then Budgets and detection. Budget comparisons use today and month to date in UTC. The timing panel distinguishes how long records waited after storage from how late each source delivered them; neither promises detection before the source sends data.

The seven rules

Each is a finding kind (see findings). All thresholds below are defaults and can be set for the organization, and overridden for an agent or a tag (dimension=value).

Rule Fires when Default threshold
Spend rate above its usual (cost_spend_rate) Cost per minute for an agent, department, product or the whole organization is above a multiple of its own usual rate for this hour and weekday, for several complete minutes in a row. 5 times the usual, for 3 minutes, at least $0.05 a minute. Resolves after 5 minutes below.
Run far beyond the usual (cost_runaway_run) One run that is still going (a record in the last 10 minutes) has a cost, step count or duration above a multiple of that agent's median run. 10 times the median of the last 14 days (from at least 20 runs), above a floor of $1, 50 steps or 30 minutes. With less history, a fixed $10.
Budget crossed (cost_budget_crossed) A daily or monthly budget reaches 80% (medium) or 100% (high) of its cap. 80% and 100%.
Budget forecast to be crossed (cost_budget_forecast) At the cost rate of the last half hour, a monthly budget will reach its cap within a set time. 48 hours, held for 3 minutes. High within 6 hours.
New spender (cost_new_spender) A model or an agent that has never spent before spends above a floor. $0.50 within 30 minutes. Not raised in an organization with under a day of history, where everything is new.
Spend on failing calls (cost_failure_burn) The cost of calls that failed is above a rate for several minutes in a row. $0.50 a minute for 3 minutes.
Security finding and abnormal spend together (cost_security_and_spend) A high-severity finding is open on an agent whose spend rate is also above its usual. The two conditions together. It is one event carrying both, and it does not say one caused the other.

Budget rules read the budgets on the Cost page. A budget blocks nothing.

No flapping, one finding per subject

  • A rate rule must hold for N complete minutes to fire and be clear for M to resolve.
  • There is one finding per subject (an agent, a run, a budget and span). It is updated while the condition continues and resolved when it clears. If it comes back, the same finding reopens.
  • A person's acknowledgement is kept, as on every finding.

Baselines need history

A subject with fewer than 7 days of spend has no usual rate to compare with. It uses the fixed threshold an admin sets (default $2 a minute), and the event says so: "the fixed threshold of $2.00 a minute, because there are 0 days of history and 7 are needed". A subject with history is compared with its own usual cost per minute for the same hour and weekday, over up to the four earlier weeks (from the day it first spent).

Late or missing data

  • The data is only as fresh as its source. A source that sends in batches every ten minutes cannot be seen faster than that. The health page shows each source's typical delay (from the call to its arrival), and an event says when a source's data is arriving late: "this is the earliest it could be seen".
  • Silence is never read as "spend stopped". A finding is not resolved while the subject's source has delivered nothing for ten minutes. When the source delivers again, the quiet minutes count. A genuinely quiet organization keeps its open finding until it next sends data.
  • Costs are estimates from your price table. A call with no price counts as nothing here, so a rate is a floor.

Measured delay

The health page (on the Cost page, Budgets and detection tab, "Cost detection in minutes") shows the measured delay from a record being stored to the pass that evaluated it finishing, as the median, the 95th percentile and the longest, against the target of under 2 minutes. It also shows how long a pass takes, when it last ran, and any rule that errored. A rule that errors leaves its findings as they are. A rule that must hold for several minutes fires that many minutes later by design; that is the hold, not a delay.

Every firing keeps its numbers

Each time a rule opens, reopens or resolves a finding it stores what it saw: the per-minute figures, the threshold, the baseline and how much history it had, and whether the data was late. GET /api/detection/evaluations/<finding id> returns them, so an event can be checked afterwards.

API

  • GET /api/detection/health: the measured delay, sources and rules.
  • GET and PUT /api/detection/settings: thresholds (scope org, agent or tag, subject, settings). Admin only, audited, versioned.
  • POST /api/detection/run: run a pass now (admin).
  • GET /api/detection/evaluations/<finding id>.

Limits

  • Budgets by owner or team are checked for crossing but a forecast uses the budget's own scope, so a budget whose records cannot be placed in a minute is not forecast.
  • Minutes are placed by when a call was observed. Records that arrive late fill in minutes already passed, and a finding may open some minutes after the spend began.
  • API keys are not a subject: Provantix records do not carry one. A provider's own usage report (see providers) is read hourly and is not part of this check.
  • Thresholds are first guesses to tune on real traffic.