Overview
PromptGuard’s proxy routes your LLM requests through the security pipeline before forwarding to providers. You can configure retry, fallback, timeout, and circuit breaker behavior per project.Configuration Schema
Set these in your project settings via the dashboard or API:Retry
Control how failed requests are retried before falling back to alternative providers.| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
max_attempts | integer | 3 | 1–5 | Total attempts including the initial request |
delay_ms | integer | 200 | 0–5000 | Base delay between retries in milliseconds |
backoff_multiplier | float | 2.0 | 1.0–10.0 | Exponential backoff multiplier (delay × multiplier per retry) |
Timeout
Set time limits for upstream provider connections and responses.| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
request_timeout_s | integer | 30 | 5–120 | Total request timeout in seconds |
connect_timeout_s | integer | 5 | 1–30 | TCP connection timeout in seconds |
Fallback Strategy
Control how PromptGuard selects and fails over between LLM providers.| Parameter | Type | Default | Description |
|---|---|---|---|
strategy | string | "failover" | Routing strategy: failover, round_robin, cost, latency |
providers | string[] | [] | Ordered list of provider names for fallback |
Strategies
failover— Try the primary provider first, fall back to alternatives on failureround_robin— Distribute requests evenly across healthy providerscost— Route to the cheapest provider that can serve the modellatency— Route to the provider with lowest observed latency
Circuit Breaker
Prevent cascading failures by temporarily removing unhealthy providers from rotation.| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
enabled | boolean | true | — | Enable/disable circuit breaker |
threshold | integer | 5 | 1–50 | Consecutive failures before opening the circuit |
recovery_timeout_s | integer | 30 | 5–600 | Seconds before retrying an open circuit |
recovery_timeout_s seconds. After recovery, a single probe request is sent — if it succeeds, the circuit closes and the provider returns to rotation.
Example: High-Availability Setup
- Tries OpenAI first, then Anthropic, then Groq on failure
- Retries up to 3 times with exponential backoff (500ms → 1s → 2s)
- Allows 60s for long completions
- Opens the circuit after 3 consecutive failures, waits 60s before probing