Skip to content

Input Guardrails: Directly return safe_text #784

@nishika26

Description

@nishika26

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions