Enable query validation to block off-topic AI responses
Enable the question-validity shield to classify each prompt before Intelligent Assistant answers it, so that off-topic or harmful prompts never reach your answering model.
Before you begin Copy linkLink copied!
You have an inference provider configured and enabled in the `inference.providers` section of your `lightspeed-stack.yaml` file.
You can edit the Kubernetes Secret that supplies environment variables to the `lightspeed-core` container.
About this task Copy linkLink copied!
In RHDH 2.1, Intelligent Assistant validates prompts through a single question-validity shield that LCS defines in the `lightspeed-stack.yaml` configuration file. This shield replaces the Llama Guard safety provider, registered shield resources, and `run.yaml` overrides used in earlier releases. Do not edit Open GenAI Stack (OGX) files or the generated `run.yaml` file to change validation behavior.
The shipped `lightspeed-stack.yaml` file includes the shield in a disabled state. You enable or disable the shield through environment variables in the Kubernetes Secret that LCS reads. When you enable the shield, LCS sends each prompt to the validation model, which classifies the prompt as allowed or rejected.
Procedure
What to do next Copy linkLink copied!
- Open the *Intelligent Assistant* and submit a development question, for example, `How do I create a software template in RHDH?`. Confirm that the assistant answers the question.
- Submit a clearly unrelated question, for example, `What is a good recipe for pizza?`. Confirm that the assistant rejects the question when validation is enabled.