flow injection detection
"""
Reject, omit, or sanitize injection attempts from the bot.
This rail operates on the $bot_message.
"""
response = await InjectionDetectionAction(text=$bot_message)
join_separator = ", "
injection_detection_action = $config.rails.config.injection_detection.action
if response["is_injection"]
if $config.enable_rails_exceptions
send InjectionDetectionRailException(message="Output not allowed. The output was blocked by the 'injection detection' flow.")
else if injection_detection_action == "reject"
bot "I'm sorry, the desired output triggered rule(s) designed to mitigate exploitation of {{ response.detections | join(join_separator) }}."
abort
else if injection_detection_action == "omit" or injection_detection_action == "sanitize"
$bot_message = response["text"]
else
$bot_message = response["text"]
← Back to catalog
Injection Detection (NeMo Guardrail)
flow injection detection """ Reject, omit, or sanitize injection attempts from the bot. This rail operates on the $bot_message. """ response = await I
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-10
#guardrail#nemo#rails#colang