Per-category timeouts
By default every external classifier (AWS Bedrock, Azure Content Safety,
custom webhooks) shares a flat 1500ms timeout. That’s pessimistic for fast
checks like PII (typically <150ms) and bites p99 when a slow check ties up the
budget.
Per-category timeouts let you set per-class budgets so fast checks fail fast and slow checks get the time they need.
Default behavior
Section titled “Default behavior”Opt-in. Without configuration, the flat global timeout
(DEEPINTSHIELD_GUARD_ADAPTER_TIMEOUT_MS, default 1500ms) applies to every
adapter call.
Configure it
Section titled “Configure it”Map check categories to millisecond budgets. Categories are matched
case-insensitively against the policy’s metadata category field (falls back
to check_class).
# Via plugin config:{ "embedded_timeouts_by_category": { "pii": 150, "toxicity": 600, "jailbreak": 1200, "hallucination": 800, "prompt_injection": 400 }}
# Or via env (JSON-encoded):DEEPINTSHIELD_GUARD_TIMEOUTS_BY_CATEGORY='{"pii":150,"toxicity":600,"jailbreak":1200}'Precedence
Section titled “Precedence”For each individual adapter call, the budget is picked in this order:
policy.TimeoutMs— an explicit override set on the policy itself.- Per-category timeout — matched from the map above.
- Global adapter timeout — the flat 1500ms (or your override).
Fail-open semantics
Section titled “Fail-open semantics”If an adapter call times out:
- The error becomes a chain-trace entry (visible in the audit log).
- No finding is emitted for the timed-out check.
- Other checks running in parallel still complete normally.
- The request continues with the verdicts from checks that succeeded.
Realistic budgets
Section titled “Realistic budgets”| Category | Typical p95 | Recommended budget |
|---|---|---|
| PII patterns | <50ms | 150ms |
| Prompt injection | 100–300ms | 400ms |
| Toxicity | 200–500ms | 600ms |
| Hallucination | 300–700ms | 800ms |
| Jailbreak (LLM) | 500–1000ms | 1200ms |
Pulling p99 down by ~30–50% is realistic once you replace the flat 1500ms ceiling with these.