Databricks Generative AI Engineer Associate Question 254
Select 3You are developing a Generative AI application on Databricks and want to safeguard the system against malicious user inputs, such as prompt injections or harmful queries. Which of the following techniques should you implement?
- A
Implement input validation to sanitize user-provided text before processing.
- B
Use rate limiting to restrict the number of requests a user can send within a specific timeframe.
- C
Train the model on unfiltered internet data to ensure robustness against all types of inputs.
- D
Apply content moderation to filter out harmful or inappropriate outputs before displaying them to the user.
- E
Enable logging of user inputs to monitor and detect potential malicious activities.
Show answer and explanation
Correct answers: A, B, D
Explanation
Guardrail techniques for Generative AI systems focus on preventing misuse and ensuring safe interactions. Input validation and content moderation directly address the risks posed by malicious user inputs and harmful outputs, while rate limiting mitigates abuse from excessive requests. These techniques collectively form a robust defense against malicious behavior.
- A. Correct.
Input validation helps sanitize user-provided text, removing potential harmful elements such as code injections or malicious commands. This is a key guardrail technique to prevent prompt abuse.
- B. Correct.
Rate limiting reduces the risk of system abuse by malicious users who may attempt to overwhelm the system with a high volume of requests, thereby preventing denial-of-service attacks.
- C. Incorrect.
Training the model on unfiltered internet data is not a guardrail technique. In fact, this could increase the risk of the model producing harmful or biased outputs.
- D. Correct.
Content moderation ensures that the output of the model is safe and appropriate by filtering harmful or discriminatory responses before they are presented to the user.
- E. Incorrect.
While logging user inputs can help in monitoring for malicious activity, it is not a proactive guardrail technique for protecting against malicious user inputs.