Guardian - anti-loop system

Per-workspace rules to block runaway agents, duplicate traffic and cost spikes.

Guardian is HiWay's always-on safety net. It watches every request in near real time and blocks the failure modes that bankrupt agent-heavy workloads: runaway loops, duplicate requests, cost spikes, context bloat, zombie agents and rate limit abuse. Every rule is editable per workspace in Dashboard → Guardian.

The rules

RuleTriggerDefault action
DedupSame prompt hash, same key, 3+ times in 60sBlock 4th request, alert
Cost spike10× your 24h rolling average upstream cost in under 5 minutesThrottle to 1 req/s, alert
Context bloatPrompt tokens > configurable ceiling (default 50k)Reject with 413
Zombie agentSame key looping 30+ minutes with no output variationSuspend the key, alert
Rate limitPer-key RPM exceededReturn 429 with Retry-After

Guardian runs before routing

Guardian blocks happen before the request touches a provider, so blocked requests do not count against your monthly quota and do not incur upstream BYOK cost.

What a block looks like

json
{
  "error": {
    "code":                "guardian_block",
    "message":             "Blocked by Guardian: dedup (3 identical prompts in 47s)",
    "rule":                "dedup",
    "retry_after_seconds": 60
  }
}