1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →
Design the guardrails architecture for a bank's customer chatbot with under 300ms of added latency.
30-second answerSay your answer out loud first, then reveal.

Latency budget (illustrative)
| Check | Placement | Added latency |
|---|---|---|
| Deterministic input checks | Inline | ~5ms |
| Injection + topic classifiers | Parallel with retrieval | ~0 extra (hidden behind retrieval) |
| Output chunk checks | Streaming | ~10–30ms per chunk |
| Action guardrails | Code at tool boundary | Negligible |
| Groundedness judge | High-risk answers only (rates/fees) or async | Selective |
Design principles
- Fail closed for actions (transfers, card changes); fail open with logging for low-risk informational guardrail outages (documented decision).
- Self-hosted small classifiers near the app for low latency and data residency.
- Template answers for sensitive topics (fraud reporting steps, complaints) instead of free generation.
- Measure the false positive and false negative rates of each guardrail, plus p95 added latency.
Related
Slow is fine. Stopping is the only problem.