#31976 [Bug]: `BedrockGuardrail` with `disable_exception_on_block=True` silently bypasses block on `/v1/messages` requests
### What happened?
When `disable_exception_on_block=True` is set on a `BedrockGuardrail`, blocked `/v1/messages` requests are **silently allowed through** to the underlying model. The guardrail fires correctly and the Bedrock ApplyGuardrail API detects the violation, but the block has no effect and the model call proceeds and returns a real response to the client.
### Root Cause
Two components are out of sync:
**1. `async_pre_call_hook` in `bedrock_guardrails.py`** (introduced in v1.78.8, commit `b90e916`) sets a `ModelResponse` object as the mock response when content is blocked:
```python # bedrock_guardrails.py except GuardrailInterventionNormalStringError as e: bedrock_guardrail_response = e.message ... if isinstance(bedrock_guardrail_response, str): data["mock_response"] = self.create_guardrail_blocked_response( response=bedrock_guardrail_response )
def create_guardrail_blocked_response(self, response: str) -> ModelResponse: return ModelResponse( choices=[Choices(message=Message(content=response))], model="bedrock-guardrail", ) ```
**2. The `/v1/messages` handler** (`messages/handler.py`, line ~426, check introduced v1.74.1, cā¦