An agent is configured to escalate to a human operator whenever a tool call fails three times consecutively. A security team audit reveals that the escalation never triggered, even though logs show the agent encountered multiple repeated tool failures over several days. Reviewing the agent's code, the error handler catches all exceptions and returns a success response to the calling loop. What is the root cause?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Silent error swallowing is like a smoke detector that catches the alarm signal and says 'we're fine' — the building is on fire but nobody knows it. When the error handler converts failures to successes, the failure counter never ticks up, the escalation trigger never fires, and the operator is never called.
Full explanation below image
Full Explanation
Error swallowing is one of the most dangerous patterns in agentic systems. When a catch block intercepts an exception and returns a success response, the calling code has no way to know a failure occurred. In this scenario, the consecutive failure counter that drives the escalation logic is only incremented when the calling loop detects a failure — but the error handler has hidden the failure, so the counter stays at zero and the escalation threshold is never reached.
The fix is to ensure that error handlers either: (1) re-raise or propagate the exception to the calling loop so the failure counter can increment, or (2) explicitly call the escalation logic directly from within the error handler when the failure meets escalation criteria. A third option is to log failures to a separate, durable store that an independent monitoring process checks for escalation conditions.
Option A (threshold too high) might be a tuning concern in other scenarios, but the audit shows the escalation never triggered at all despite multiple days of repeated failures — not just too slow to trigger. The counter never incremented because errors were swallowed.
Option C (notification channel not connected) would result in escalation being triggered (counter reaching threshold) but the notification failing to deliver. The audit would show escalation attempts with delivery failures, not zero escalation triggers.
Option D (tool timeout too low) would cause failures, but those failures would still be visible to the calling loop unless the error handler swallowed them — which is exactly what the audit found.
Never catch exceptions silently in an agent's error handling path.