Circuit breakers
Per-agent counters over a rolling window, on three signals:
Crossing a threshold freezes the agent: every subsequent request is refused before anything is analysed, and its pool is drained. Nothing it asks for should be considered until a human has looked at why it was frozen.
Reinstating is deliberate and always attributed, with a reason that is recorded. That judgement — “this was a stale enum value, not an attack” — is the most useful thing in the record when the same agent trips again next week. The automatic freeze is recorded too, with the evidence that triggered it, because that is the event a post-incident review starts from.
Loud failures
An agent that hallucinates a column name gets zero rows, and zero rows looks exactly like a fact. That is how an agent tells a customer they have no orders when they have six. Warden separates the cases:- Genuinely empty — the table has no matching records.
- Suspiciously empty — the table holds records and the filter matched none of them, which is more likely a wrong value than a true answer.
Plan-aware idempotency
A plain unique key cannot express the difference between “the agent retried” and “the agent decided to do this again”. Warden’s key is the agent’s own idempotency key, checked against a fingerprint of the operation:- Same key, same work — replayed. The stored result is returned and the database is not touched.
- Same key, different work —
idempotency_conflict. The key derivation is wrong, and saying so beats silently running it. - Changed plan —
plan_hashis part of the operation’s identity, so genuinely new work is new work.
Per-agent pools
Each agent gets its own connection pool with fail-fast checkout. One agent’s runaway query cannot starve the rest, and an agent that has exhausted its own slots is told so (pool_exhausted, retryable) instead of queueing behind itself. Queueing is how one agent takes down everyone.