auth token expired mid-expense-audit run for the auditor agent: auth error
Keeps auditor agents running through credential expiry with proactive refresh and resume. Use when an agent's API credential expires mid-run. Not for invalid or revoked credentials.
TL;DR
The API credential expired mid-run and calls started failing. Refresh the credential proactively before it expires (refresh at 80 percent of its lifetime), retry the failed calls with the fresh credential, and resume from the last checkpoint.
Error
auth token expired mid-expense-audit run for the auditor agentSteps
- Detect expiry explicitly: treat authentication failures during a run as a refresh signal, not a fatal error. Expected: the agent recognizes the condition.
- Refresh the credential through the normal renewal flow and store the new one. Expected: a valid credential with a fresh lifetime.
- Retry the failed API calls with the new credential. Expected: the calls succeed.
- Resume the audit from the last checkpoint, not from the start. Expected: no duplicated work.
- Add proactive refresh: renew the credential when 80 percent of its lifetime has passed, before any run that might outlive it. Expected: expiry stops happening mid-run.
When to use
- An agent's API credential expires during a long run.
- Authentication failures appear partway through, not at startup.
When not to use
- The credential is invalid from the start (fix the stored credential).
- The credential was revoked (re-issue it; refresh will not help).
Tool compatibility
- Expensify, Concur, Ramp APIs with expiring credentials; custom agents.
Variant phrasings
Credential expired during audit run
Same failure, generic wording.
401 mid-run: session expired
The HTTP-level phrasing.
Why it happens
Long audit runs outlive short credential lifetimes. Agents that authenticate once at startup are guaranteed to hit expiry on runs longer than the lifetime.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_7i0WAiTwYYnd2kcepRId9A