ResiliencePolicy

Configure provider-call resilience under the resilience key on AurexConfig.

Agent hint

Use for resilience.enabled, mode, max_attempts, max_extra_cost_usd, retry_on, backoff, idempotency.

In scope

  • All ResiliencePolicy fields
  • Minimal config example

Out of scope

  • Mode semantics — see Observe vs Enforce
  • Fallback registration — see Fallbacks
Python
from aurex_sdk import AurexAuditor, AurexConfig

auditor = AurexAuditor(AurexConfig(
    api_key="aux_dev_yourkey",
    resilience={
        "enabled": True,
        "mode": "observe",
        "timeout_ms": 60000,
        "max_attempts": 2,
        "max_extra_cost_usd": 0.05,
        "retry_on": ["timeout", "429", "5xx", "network", "empty"],
        "idempotency": "auto",
        "proof_window_pct": 0.0,
    },
))
Node.js
const auditor = AurexAuditor.getInstance({
  apiKey: "aux_dev_yourkey",
  resilience: {
    enabled: true,
    mode: "observe",
    timeoutMs: 60000,
    maxAttempts: 2,
    maxExtraCostUsd: 0.05,
    retryOn: ["timeout", "429", "5xx", "network", "empty"],
    idempotency: "auto",
    proofWindowPct: 0.0,
  },
});
FieldDefaultDescription
enabledfalseMaster switch; false = passthrough.
modeobserveobserve | enforce
timeout_ms60000Per-attempt wall-clock cap.
max_attempts2Including initial call; enforce only.
max_extra_cost_usd0.05Cap on additional spend for retries/fallbacks.
retry_onsee ClassificationList of failure kinds eligible for retry.
backoffbase 200msbase_ms, max_ms, jitter for enforce retries.
idempotencyautoauto | require_key | off
fallbacks[]Named fallback chain (see Fallbacks page).
proof_window_pct0.0Sample enforce retries in observe for proof (0–1).
on_recoveryNoneOptional callback after successful recovery.
classify_response_overrideNoneCustom classifier hook (Python).

See also