Some Intercept middleware actions stop a prompt before it reaches the AI provider.
When a prompt is blocked, your app should catch the exception and return a safe user-facing response.
Injection Guard exception
Injection Guard throws:
Example:
PII Redactor exception
PII Redactor throws:
Example:
Catch both exceptions
Most apps should catch both.
You may also catch the parent exception class InterceptException throwable by all Intercept middleware.
Validation-style responses
If your frontend expects validation errors, return a validation-style payload.