Tips // Claude in practice

Tips for working better with Claude

One short tip at a time, with an example you can copy. Move through them at random or search for what you need.

OtherAdvancedClaude API

Decide what happens when your guardrail fails: pass or block?

If the screening service errors out and nobody defined the behavior, the code almost always lets the request through unprotected.

Treat the guardrail like any other dependency: it can time out or go down. Define explicitly whether an error blocks or lets through depending on the risk, just as you do with retries and circuit breakers on model calls. A control that fails silently looks healthy while doing nothing.

Example
Rule in your spec:
"If input screening fails or exceeds 2 s → [block / degrade to a safe response]. The event is logged and an alert is raised."
#guardrails#security#fail-closed#resilience