Guardian — anti-loop system
Automatic protection against runaway agents and duplicate traffic.
Guardian is HiWay's always-on safety net. It watches every request in near real time and blocks the three kinds of failures that bankrupt agent-heavy workloads: runaway loops, duplicate requests, and cost spikes.
The three rules
| Rule | Trigger | Default action |
|---|---|---|
| Duplicate detector | Same prompt hash, same key, 3+ times in 60s | Block 4th request, alert |
| Cost spike | 10× your 24h rolling average in under 5 minutes | Throttle to 1 req/s, alert |
| Zombie agent | Same key looping for 30+ minutes with no variation | Suspend the key, alert |
Guardian is opt-out
Guardian is enabled by default for every account. You can tune thresholds per key in Dashboard → Guardian, or disable rules individually if a rule doesn't fit your workload. We strongly recommend keeping duplicate detection on — it has caught the vast majority of runaway agents we've seen.
What happens when Guardian blocks a request
Blocked requests return a 429 Too Many Requests with a specific error body indicating which rule fired. The cost of the blocked request is not debited — Guardian runs before the router decision and before the provider call.
{
"error": {
"message": "Blocked by Guardian: duplicate_detector (3 identical prompts in 47s)",
"type": "guardian_block",
"rule": "duplicate_detector",
"retry_after_seconds": 60
}
}