Skip to main content
Rules help teams react to spend and reliability conditions without redeploying agent code.

Rule types

RuleWhen it runsWhat it does
Cost thresholdPost-callSends an alert when spend crosses a threshold.
Budget limitPre-call or post-callWarns or blocks when a customer or pool exceeds a budget.
Customer throttlePre-callBlocks traffic for a selected customer.
Model routingPre-callRewrites matching calls to another provider or model.
Reliability failoverPre-callUses a backup path when the primary model path is unhealthy.
Margin protectionScheduled analysisFinds margin drift and recommends action.

Draft before active

Rules should be reviewed before they affect production traffic. AgentMeter supports draft rules so teams can preview impact before activation.

Conflict resolution

When more than one rule matches a call, the most specific rule wins:
  1. Customer-specific rules beat pooled rules.
  2. Step-specific rules beat general rules.
  3. If specificity is tied, the most recently updated rule wins.

Fail-open principle

AgentMeter should not become the reason your agent is unavailable. SDK-side controls pass through when the rules cache is cold, pricing is unknown, or AgentMeter is unreachable. The exception is an active hard-stop rule that the SDK has already cached and can enforce locally.

Operational advice

  • Start with alert-only rules.
  • Add budget hard stops to customer plans that need hard cost ceilings.
  • Use model routing on narrow steps before broad rollouts.
  • Keep failover rules explicit and tested before activating them.