agentskit.js

CostGuardMode

Auto-generated API reference for CostGuardMode.

Type Alias: CostGuardMode

CostGuardMode = "warn" | "reject" | "kill"

Defined in: observability/src/cost-guard-advanced.ts:24

Production-grade cost guard. Extends the multi-tenant guard with:

  • Modes: warn (log only) Β· reject (per-tenant flag, no abort) Β· kill (disable the tenant runtime via an injected disableRuntime callback; requires explicit re-enable).
  • Window caps: per-minute / per-day / per-month rolling buckets. Each window has its own threshold; tripping any one fires alerts and (in kill mode) disables the tenant.
  • Linear forecasting: at 50 / 80 / 100 % of any window cap, emit a cost:threshold alert with an extrapolated time-to-cap.
  • Pluggable alert sinks: the same contract regardless of where the alert lands (Slack webhook, PagerDuty, email gateway).
  • Throttled alerting: at most one alert per (tenant, window, threshold) per cap window β€” avoids alert storms.

Closes #787 (hard-kill), #788 (forecasting + caps), #789 (alert sinks). Chargeback report (#790) lives in chargebackReport() below.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page