Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refrain Nemo-Guardrails to Send the Actual User Input to LLM #706

Open
minghongg opened this issue Aug 28, 2024 · 3 comments
Open

Refrain Nemo-Guardrails to Send the Actual User Input to LLM #706

minghongg opened this issue Aug 28, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@minghongg
Copy link

Hi team,

Is it possible to configure Nemo-Guardrails to avoid sending the actual user input to the LLM? I understand that the actual user input won't be sent if the input rails are triggered. However, is it also possible to prevent the user input from being sent, regardless of whether the input rails are triggered or not? Thanks!

@Drewwb
Copy link

Drewwb commented Aug 28, 2024

Yes, it is possible to configure NeMo Guardrails to avoid sending the actual user input to the LLM, regardless of whether input rails are triggered.

In your colang file you could add the following:

define user_input_passes_guardrails as user says something not offensive or inappropriate

when user_input_passes_guardrails:
    bot says "pass"
    action stop_processing  # This stops the input from being sent to the LLM

You could also chain another LLM to your guardrails:

  • Use a secondary LLM as a pre-processing step. I would call this an Observer.
  • This secondary LLM evaluates the user input against the defined guardrails.
  • It outputs a simple "pass" or "fail" result.
  • If the input passes, a sanitized or rephrased version of the input (not the original) is sent to the primary LLM. Or even just a simple "pass" is sent to the primary LLM.
  • If it fails, the input is blocked entirely. Or "fail" is sent to primary LLM

In essence, you would prompt your Observer LLM in a way that makes sure it doesn't output the user's input.

@Pouyanpi
Copy link
Collaborator

Pouyanpi commented Sep 2, 2024

@minghongg, do you mean that you want to use predefined flows only?

What do you want to do with the user input? It'd be great if you can explain your use case more

@Pouyanpi Pouyanpi added the question Further information is requested label Sep 2, 2024
@Pouyanpi Pouyanpi self-assigned this Sep 2, 2024
@drazvan
Copy link
Collaborator

drazvan commented Sep 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants