Skip to main content
The Python SDK additionally provides a common AgentReinError base class that all other SDK errors inherit from (the TypeScript SDK has no equivalent base class) — catch AgentReinError in Python if you want to handle any SDK error generically.

AgentReinUnavailableError

Thrown/raised when the SDK cannot reach the AgentRein backend during authentication. If authentication succeeds but session creation fails, an AxiosError (TS) or httpx.HTTPError (Python) is thrown/raised.
Developers should catch both error types when using failureMode/failure_mode: 'closed'.
Thrown/raised when a human rejects a requiresApproval/requires_approval action. AgentRein automatically triggers session rollback before throwing/raising.
Thrown/raised when a requiresApproval/requires_approval action is not reviewed within the timeout window. The SDK logs the timed-out action as failed, which triggers AgentRein’s normal session rollback flow.
Thrown/raised synchronously when invalid options are passed to wrap(). Common causes: pollIntervalMs/poll_interval_ms below 1000ms or timeoutMs/timeout_ms below 5000ms.
Valid minimums: