Rule types
| Rule | When it runs | What it does |
|---|---|---|
| Cost threshold | Post-call | Sends an alert when spend crosses a threshold. |
| Budget limit | Pre-call or post-call | Warns or blocks when a customer or pool exceeds a budget. |
| Customer throttle | Pre-call | Blocks traffic for a selected customer. |
| Model routing | Pre-call | Rewrites matching calls to another provider or model. |
| Reliability failover | Pre-call | Uses a backup path when the primary model path is unhealthy. |
| Margin protection | Scheduled analysis | Finds 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:- Customer-specific rules beat pooled rules.
- Step-specific rules beat general rules.
- 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.