agent/harmonia_agent/failures.py normalizes worker exceptions into a strict FailureEnvelope with category, code, safe public message, retryability, stage, operation ID, trace ID, attempt count, and sanitized details.
The worker allows at most three stage attempts by default. Retryability is removed on the final attempt. Sensitive response bodies, prompts, tokens, secrets, transcripts, and cookies are excluded from public details. See Failure recovery.
