#### PII DETECTION RAILS ####
# INPUT RAILS
flow detect pii on input
"""Check if the user input has PII."""
$has_pii = await DetectPiiAction(source="input", text=$user_message)
if $has_pii
bot inform answer unknown
abort
# INPUT RAILS
flow detect pii on output
"""Check if the bot output has PII."""
$has_pii = await DetectPiiAction(source="output", text=$bot_message)
if $has_pii
bot inform answer unknown
abort
# RETRIVAL RAILS
flow detect pii on retrieval
"""Check if the relevant chunks from the knowledge base have any PII."""
$has_pii = await DetectPiiAction(source="retrieval", text=$relevant_chunks)
if $has_pii
bot inform answer unknown
abort
#######################################################
#### PII MASKING RAILS ####
# INPUT RAILS
flow mask pii on input
"""Mask any detected PII in the user input."""
$masked_input = await MaskPiiAction(source="input", text=$user_message)
global $user_message
$user_message = $masked_input
# OUTPUT RAILS
flow mask pii on output
"""Mask any detected PII in the bot output."""
$bot_message = await MaskPiiAction(source="output", text=$bot_message)
# RETRIVAL RAILS
flow mask pii on retrieval
"""Mask any detected PII in the relevant chunks from the knowledge base."""
$relevant_chunks = await MaskPiiAction(source="retrieval", text=$relevant_chunks)
← Back to catalog
Privateai (NeMo Guardrail)
PII DETECTION RAILS INPUT RAILS flow detect pii on input """Check if the user input has PII.""" $has_pii = await DetectPiiAction(source="input", text=
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
- 2026-05-16
#guardrail#nemo#rails#colang