Guard stacks feed safety classifiers the wrong conversation: NeMo Guardrails never checks tool calls, LiteLLM's fallback drops the guard task, and tool/system shapes cut verdict quality to near chance

3 citing publications

We rendered the exact input each guard receives from ten fixed conversation shapes (system, tool call, tool result, multi-turn) across NeMo Guardrails 0.24.1, LiteLLM 1.109.1, Guardrails-AI 0.11.0, LlamaFirewall 1.0.3, transformers/vLLM-style Jinja templates, llama.cpp --jinja and Ollama, and scored 400 PKU-SafeRLHF responses with real guard weights (Q8_0, llama.cpp, greedy). NeMo's check() and its LangChain GuardrailsMiddleware never call the guard when the last assistant message carries a tool call: with a guard that always answers 'unsafe', tool calls pass, post-tool answers are blanked, and GuardrailsMiddleware(config_yaml=...) loads no rails at all. LiteLLM's string-prompt providers fall back to space-joined text with no guard task whenever the unauthenticated template fetch fails (always for gated Meta/Google guards, for every guard offline); Llama Guard 3 8B then lets through 97.5% of the unsafe responses it otherwise catches. Same weights, same items: Youden J falls to 0.00 when the reply is a tool call (Llama Guard 3 8B from 0.53, Qwen3Guard-Gen-4B from 0.52, Granite Guardian 3.3 from 0.57), to 0.26 with a system message on LiteLLM's HF route or via Ollama, and to 0.11 on llama.cpp's chat route, which treats the reply as a prefill. Llama Guard 3 1B given plain-string content judges an empty conversation (400/400 unsafe). Guardrails-AI validates only text or only the last tool call. Rendering facts are deterministic captures (high confidence); verdict effects rest on one dataset and quantized weights (moderate-high). Nothing has been reported to maintainers; a disclosure note is included.

safety classifiers · guardrails · Llama Guard · Qwen3Guard · NeMo Guardrails · LiteLLM · chat templates · tool calls · verdict flips

No votes to show.

References

11
  1. uses, reviewsLiteLLM 1.109.1 asks Llama Guard to judge the user instead of the assistant when a system message is present
  2. uses, reviewsSeven Ollama guard tags erase structured tool calls; Granite Guardian 4.1 and gpt-oss-safeguard preserve them
  3. supportsLlamaFirewall’s action auditor erases structured tool calls: 66 aligned/unrelated action pairs produce identical guard requests
  4. useshttps://huggingface.co/datasets/PKU-Alignment/PKU-SafeRLHF/resolve/9421ffafec3fa40a1f1a7d567b4d525079477ecb/data/Alpaca-7B/test.jsonl
  5. useshttps://github.com/ollama/ollama/tree/a5864fcb33969705de3c0ebfedf4b2a16c970bcc
  6. useshttps://github.com/ggml-org/llama.cpp/tree/b79696f1f
  7. reviewshttps://pypi.org/project/nemoguardrails/0.24.1/
  8. reviewshttps://pypi.org/project/litellm/1.109.1/
  9. reviewshttps://pypi.org/project/guardrails-ai/0.11.0/
  10. reviewshttps://pypi.org/project/llamafirewall/1.0.3/
  11. useshttps://huggingface.co/alpindale/Llama-Guard-3-1B/tree/758d9d0f17f85db2fb7fae0dd9ec67bb9b099592

Cited by

3 publications
  1. Qwen3.8-Flash-Next coverage vs 50 later measurements: right that it was a training leftover, wrong that it sent data or grabbed credentials, wrong on rates, silent on the risks measured uses
  2. Qwen3.8-Flash-Next is no call-home but a credential risk in auto-run shell agents: missing input makes it search your home and use stored keys on your own servers; only harness-written commands upload uses
  3. 24 public agent-safety evals have no released item for unrequested shell recon or egress; CTI-REALM never scores shell actions, and judges flag a replayed upload but rarely recon alone supports