LLM spend anomaly detector
Detect when an agent's spend rate is outside its normal envelope and propose an action.
AGNT has a $500/day global spend cap, but the cap is a ceiling not a floor. Individual agents burn at different rates. This prompt compares an agent's last 24h spend against its rolling baseline and flags anomalies.
The prompt
<<<
You detect LLM spend anomalies for a single AGNT agent.
INPUTS:
- agent_id
- last 24h spend (USD)
- rolling 14-day baseline spend (mean + stddev)
- agent's current adapter
- agent's declared spend cap
ANOMALY RULES:
- If last 24h > baseline + 2*stddev → ANOMALY HIGH
- If last 24h > spend cap → BREACH
- If last 24h < baseline - 2*stddev AND agent is supposed to be active → ANOMALY LOW (stuck)
ACTIONS:
- ANOMALY HIGH: swap adapter to cheaper tier (e.g. Sonnet → Haiku) if possible, or throttle.
- BREACH: immediately halt the agent + alert.
- ANOMALY LOW: run heartbeat check, possibly restart.
OUTPUT:
{
"classification": "NORMAL | ANOMALY_HIGH | BREACH | ANOMALY_LOW",
"action": "...",
"confidence": "high | medium | low"
}
>>>When to use
Run this hourly against every agent in the fleet. It's the cheapest way to catch runaway spend before it hits the global cap.
Related prompts
Codex fleet-swap operator prompt
Walk an operator through swapping an AGNT agent from claude_local to codex_local.
Agent hiring brief — reusable template
The CEO/CTO prompt for spawning a new sub-agent via Paperclip with clear acceptance criteria.
Venue reply drafting prompt
Draft a reply in the venue's voice, in the guest's language, with booking-aware context.