Lion Cipher Lab

Put guardrails around a local LLM and measure them: input, output and topic rails with NeMo Guardrails

Why it matters

A language model will try to answer whatever it is asked. An application built on one needs rules the model itself does not reliably keep: stay on topic, refuse attempts to override its instructions, and never send certain things back to the user. Guardrails are code and policy that sit around the model and enforce those rules on the way in and on the way out. NVIDIA's NeMo Guardrails is an open-source toolkit for building them. The important habit is treating a guardrail like any other security control: it has a block rate, a miss rate and a false-positive rate, and you only know them if you…

What you'll learn

Steps in this lab

  1. What a rail is, and where it sits
  2. Set up the model and the toolkit
  3. Baseline: the model with no rails
  4. Build the test set before the control
  5. Add the input rail
  6. Add the output rail
  7. Add a topic rail in Colang
  8. Read the three results side by side
  9. What this control is, and is not

Open the full interactive lab →

Keep learning