Describe the bug
When input guardrails flagged a user query as needing rephrasing (rephrase_needed=True), the safe/rephrased text was being passed through to the LLM as the new input instead of being returned directly to the user. This caused the LLM to process a guardrail-modified query rather than surfacing the rephrased response to the user immediately.
Expected behavior
When rephrase_needed=True is returned by the guardrail service, the safe_text should be returned directly to the user as the response, bypassing the LLM entirely. The guardrail's rephrased output is the final answer — the LLM should not be invoked in this case.
Describe the bug
When input guardrails flagged a user query as needing rephrasing (rephrase_needed=True), the safe/rephrased text was being passed through to the LLM as the new input instead of being returned directly to the user. This caused the LLM to process a guardrail-modified query rather than surfacing the rephrased response to the user immediately.
Expected behavior
When rephrase_needed=True is returned by the guardrail service, the safe_text should be returned directly to the user as the response, bypassing the LLM entirely. The guardrail's rephrased output is the final answer — the LLM should not be invoked in this case.