English

A Lightweight Explainable Guardrail for Prompt Safety

Computation and Language 2026-04-28 v2 Artificial Intelligence

Abstract

We propose a lightweight explainable guardrail (LEG) method to detect unsafe prompts. LEG uses a multi-task learning architecture to jointly learn a prompt classifier and an explanation classifier, where the latter labels prompt words that explain the safe/unsafe overall decision. LEG is trained on synthetic explanation data, which is generated using a novel strategy that counteracts the confirmation biases of LLMs. Lastly, LEG's training process uses a novel loss that captures global explanation signals as a weak supervision and combines cross-entropy and focal losses with uncertainty-based weighting. LEG obtains equivalent or better performance than the state-of-the-art for both prompt classification and explainability, both in-domain and out-of-domain on three datasets, despite the fact that its model size is considerably smaller than current approaches.

Keywords

Cite

@article{arxiv.2602.15853,
  title  = {A Lightweight Explainable Guardrail for Prompt Safety},
  author = {Md Asiful Islam and Mihai Surdeanu},
  journal= {arXiv preprint arXiv:2602.15853},
  year   = {2026}
}
R2 v1 2026-07-01T10:40:22.073Z