A Lightweight Explainable Guardrail for Prompt Safety

Md Asiful Islam, Mihai Surdeanu


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.
Anthology ID:
2026.acl-long.2017
Volume:
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
43573–43591
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.2017/
DOI:
Bibkey:
Cite (ACL):
Md Asiful Islam and Mihai Surdeanu. 2026. A Lightweight Explainable Guardrail for Prompt Safety. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 43573–43591, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
A Lightweight Explainable Guardrail for Prompt Safety (Islam & Surdeanu, ACL 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.acl-long.2017.pdf
Checklist:
 2026.acl-long.2017.checklist.pdf