OpenPrompts
← Back to catalog
NVIDIAGuardrailsSafety & Moderation

Gliner (NeMo Guardrail)

GLiNER PII DETECTION RAILS INPUT RAILS flow gliner detect pii on input """Check if the user input has PII using GLiNER.""" $has_pii = await GlinerDete

#### GLiNER PII DETECTION RAILS ####

# INPUT RAILS

flow gliner detect pii on input
  """Check if the user input has PII using GLiNER."""
  $has_pii = await GlinerDetectPiiAction(source="input", text=$user_message)

  if $has_pii
    bot refuse to respond
    abort


# OUTPUT RAILS

flow gliner detect pii on output
  """Check if the bot output has PII using GLiNER."""
  $has_pii = await GlinerDetectPiiAction(source="output", text=$bot_message)

  if $has_pii
    bot refuse to respond
    abort


# RETRIEVAL RAILS

flow gliner detect pii on retrieval
  """Check if the relevant chunks from the knowledge base have any PII using GLiNER."""
  $has_pii = await GlinerDetectPiiAction(source="retrieval", text=$relevant_chunks)

  if $has_pii
    bot refuse to respond
    abort


#######################################################


#### GLiNER PII MASKING RAILS ####

# INPUT RAILS

flow gliner mask pii on input
  """Mask any detected PII in the user input using GLiNER."""
  $masked_input = await GlinerMaskPiiAction(source="input", text=$user_message)

  global $user_message
  $user_message = $masked_input


# OUTPUT RAILS

flow gliner mask pii on output
  """Mask any detected PII in the bot output using GLiNER."""
  $bot_message = await GlinerMaskPiiAction(source="output", text=$bot_message)


# RETRIEVAL RAILS

flow gliner mask pii on retrieval
  """Mask any detected PII in the relevant chunks from the knowledge base using GLiNER."""
  $relevant_chunks = await GlinerMaskPiiAction(source="retrieval", text=$relevant_chunks)
Automated safety scan: no suspicious patterns found.

Heuristic text scan aligned to the OWASP Agentic Skills Top 10. How we scan

Provider
NVIDIA
Origin
Official
Type
Guardrails
License
Apache-2.0
Language
English
Added
2025-11-21
#guardrail#nemo#rails#colang