arXiv:2610.30742cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.30742

UniGuard: Multi-View Guardrail Learning for Cross-Interface Safety Generalization

Viet-Thanh Pham, Thuy-Trang Vu, Junae Kim, Rollin Omari, Dinh Phung, Gholamreza Haffari, Lizhen Qu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Guardrail models are increasingly used as safety layers for LLMs and agentic systems, but most are trained on fixed prompt or response interfaces and become unreliable when the same safety case appears as a conversation, agent trajectory, multi-agent trace, or policy-conditioned input. We propose UNIGUARD, a training framework that learns interface-invariant safety representations from multiple semantically aligned views of the same safety case. We also construct the UNIGUARD-FT dataset by transforming 1,000 public safety cases into prompt, response, multi-turn conversation, agent-trace, and multi-agent-trace views, and train UNIGUARD-0.6B with classification, supervised contrastive learning, and asymmetric confidence calibration losses. Across unseen-interface benchmarks ATBench, PolicyGuardBench, and DynaBench, UNIGUARD-0.6B improves over its pretrained guardrail by 45.12 F1 points on average and reduces expected calibration error by 35.41 points, while remaining competitive with much larger guardrails such as Claude-Sonnet-4.5 and GPT-5.2 - despite being a 0.6B model and trained only with synthetic data.

1 Introduction

Guardrail models serve as lightweight safety layers for large language models (LLMs) and agentic systems, typically classifying a user prompt, assistant response, or user-assistant exchange as safe, unsafe, or as belonging to a finer-grained harm category (Markov et al., 2023a; Lin et al., 2023; Han et al., 2024). Recent guardrails, such as Llama Guard (Fedorov et al., 2024), ShieldGemma (Zeng et al., 2024), and Qwen3Guard (Zhao et al., 2025) flag unsafe prompts and responses with high accuracy, and can be conditioned on natural-language safety policies at inference time. Yet a single safety case rarely stays in a single interface: a user intent to leak protected data can surface as a direct prompt, as a tool call buried inside an agent trajectory, or as an unauthorised disclosure produced by one agent in a multi-agent system (Yao et al., 2023; Hoover et al., 2026). A guardrail trained on one interface frequently fails on the others, even when the underlying harm is identical.

Existing guardrails face two limitations with a common root. First, generalisation is fragmented across interfaces. Most guardrails are trained on prompt or response classification, while agentic and policy-aware deployments require trajectory-level or policy-conditioned reasoning. Specialised models partially close these gaps: DynaGuard for user-defined policies, AgentDoG for agent trajectories, PolicyGuard-4B for policy violations (Hoover et al., 2026; Liu et al., 2026a; Wen et al., 2025). However, each is only anchored to its training interface and collapses on the others, leaving practitioners to stitch together a zoo of guardrails.

Second, confidence is unreliable under interface shift. Guardrails act as routers – auto-blocking, auto-passing, or deferring – so routing depends on predicted probabilities, not top-1 labels alone. Yet a guardrail can attain high F1 while assigning probabilities unrelated to its empirical accuracy (Guo et al., 2017): all public guardrails we test exhibit expected calibration error above 30 points on at least one unseen interface (Table 2). Overconfident errors auto-accept harm; underconfident correct ones flood the review queue. And both compound under view shift, where the model is most likely to be wrong precisely when it is most confident. Both limitations admit the same supervision signal: rendering the same latent safety case into multiple aligned views yields cross-view agreement that encourages interface-invariant representations and provides a free reliability target for calibration.

Building on this observation, we formulate guardrail training as multi-view representation

∗^{*}Corresponding author.

learning (Xu et al., 2013). We propose UNI-GUARD, a framework that treats prompts, responses, conversations, agent traces, and multi-agent traces as semantically aligned views of latent safety cases. We instantiate the framework by constructing UNI-GUARD-FT, sampling 1,000 public safety cases and rendering each into multiple views, then training a guardrail with three coupled objectives: supervised classification preserves baseline behaviour on individual views; supervised contrastive learning aligns same-case, same-label views to enforce interface invariance; and asymmetric confidence calibration uses cross-view agreement as a reliability target, penalising overconfidence more strongly than underconfidence to suit guardrail deployment.

We train UNI-GUARD-0.6B, a compact guardrail initialised from Qwen3Guard-Gen-0.6B, and evaluate it on three unseen-interface benchmarks: AT-Bench, DynaBench, and PolicyGuardBench (Li et al., 2026; Hoover et al., 2026; Wen et al., 2025), alongside six standard prompt and response benchmarks (Aegis 2.0, WildGuardTest, SafeRLHF, BeaverTails, OpenAI Moderation, ToxicChat (Ghosh et al., 2025; Han et al., 2024; Ji et al., 2025, 2023)). In summary, our contributions are:

• We propose UNI-GUARD, a multi-view guardrail learning framework that uses cross-view agreement as a shared supervision signal for both cross-interface generalisation and confidence calibration.

• We construct UNI-GUARD-FT, a multi-view guardrail dataset rendering 1,000 base safety cases into prompt, response, conversation, agent-trace, and multi-agent-trace views, together with failure-mode annotations and a public release plan.

• We train UNI-GUARD-0.6B and show that it improves over its 0.6B base guardrail by +45.12 F1 and -35.41 Expected Calibration Error (ECE) on the unseen-interface benchmarks, retains performance on six prompt and response benchmarks, and remains competitive with much larger proprietary guardrails, despite using only 600M parameters and entirely synthetic data.