Auto-Tuning Safety Guardrails for Black-Box Large Language Models
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Large language models (LLMs) are increasingly deployed behind safety guardrails such as system prompts and content filters, especially in settings where product teams cannot modify model weights. In practice these guardrails are typically hand-tuned, brittle, and difficult to reproduce. This paper studies a simple but practical alternative: treat safety guardrail design itself as a hyperparameter optimization problem over a frozen base model. Concretely, I wrap Mistral-7B-Instruct with modular jailbreak and malware system prompts plus a ModernBERT-based harmfulness classifier, then evaluate candidate configurations on three public benchmarks covering malware generation, classic jailbreak prompts, and benign user queries. Each configuration is scored using malware and jailbreak attack success rate, benign harmful-response rate, and end-to-end latency. A 48-point grid search over prompt combinations and filter modes establishes a baseline. I then run a black-box Optuna study over the same space and show that it reliably rediscovers the best grid configurations while requiring an order of magnitude fewer evaluations and roughly 8x less wall-clock time. The results suggest that viewing safety guardrails as tunable hyperparameters is a feasible way to harden black-box LLM deployments under compute and time constraints.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 0 of its 3 references that are in the map. First posted on arXiv 14 Dec 2025.
Builds on
0 of 3 references.
No references here yet.
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Benchmarking LLM Guardrails in Handling Multilingual Toxicity
- 2025Evaluating the Robustness of Large Language Model Safety Guardrails Against Adversarial Attacks
- 2025Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets
- 2025OpenGuardrails: A Configurable, Unified, and Scalable Guardrails Platform for Large Language Models
- 2025AdaptiveGuard: Towards Adaptive Runtime Safety for LLM-Powered Software
- 2025Virus: Harmful Fine-tuning Attack for Large Language Models Bypassing Guardrail Moderation
- 2025SoK: Evaluating Jailbreak Guardrails for Large Language Models
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Models