AdaGuard: Adaptive Guardrail Models Supporting User-Defined PoliciesAdaGuard: An Adaptive Guard Model with User-defined Policies
The authors propose the AdaGuard guardrail model, which evaluates agent trajectories under user-defined policies; the 4B model achieves 89.30% binary classification accuracy on AdaptiveSafety.
At inference time, the guardrail model receives a user-defined policy (1–100 rules) and an agent interaction record, and determines which rules the behavior violates. The interaction record is placed in a delimited untrusted input region; instructions appearing in it (including injected instructions) serve only as evaluation evidence and do not automatically constitute an agent violation; the evaluation target does not include unobserved internal state.
- Existing guardrail models mostly use fixed risk taxonomies, which struggle to adapt to user-defined policies that vary with the application; the same agent operation is judged differently under different policies, requiring joint understanding of the policy and the trajectory and output of the complete set of violated rules.
- Construct the AdaptiveSafety dataset (10,939 training, 1,000 test), providing supervision through policy counterfactuals, behavior counterfactuals, and structural augmentation; first SFT then SafePO reinforcement learning, combining structured decision rewards with value-model-guided regional token weighting, to train AdaGuard at 0.6B/4B/8B.
- AdaGuard-8B achieves 89.50% accuracy and 77.10% exact rule match on AdaptiveSafety, outperforming the tested local baselines; on DynaBench it achieves 76.80% accuracy, below DynaGuard-8B's 80.11%, and the authors state that this evaluation does not demonstrate zero-shot transfer or overall superiority.
- The authors note that a gap remains on DynaBench, the change from SFT to RL is inconsistent across scales, and explanation quality was not independently verified; all evaluations are single runs with no statistical significance tests; the comparison between SFT and SafePO is descriptive, and ablations isolating each component are lacking.
- Evaluated models
- AdaGuard-0.6BAdaGuard-4BAdaGuard-8B
- Benchmarks
- AdaptiveSafetyDynaBench
- Metrics
- AccuracyPrecisionRecallF1Exact matchRule micro-F1
The authors propose AdaGuard, a set of guardrail models of sizes 0.6B, 4B, and 8B, which can evaluate at inference time whether an agent trajectory violates a user-provided policy. To support this capability, they construct the AdaptiveSafety dataset, containing 10,939 training samples and 1,000 test samples, covering policies with 1 to 100 rules, and combining policy and behavior counterfactuals, with explanations and complete violation rule sets for each sample. The training method SafePO is a reinforcement learning algorithm that uses structured rewards to evaluate prediction correctness, preserves group-relative advantages at the response level, and uses a separately trained value model to modulate token weights in explanation and judgment regions. The 4B model achieves 89.30% binary classification accuracy on AdaptiveSafety and 71.82% on DynaBench.
Paper analysis
What problem does this paper attempt to solve?
Evaluating agent trajectory violations under user-defined policies requires jointly understanding the policy and the behavior and outputting the complete set of violated rules.
Core problem: how to make a guardrail model, at inference time, evaluate agent trajectories against user-defined policies and output an overall analysis and the complete set of violated rule identifiers.
- Setting and importance: agents can call external tools to retrieve information and modify resources, and improper operations may leak privacy or alter external systems; when exposed to untrusted content, malicious instructions may also influence subsequent decisions and tool calls (according to the authors).
- Shortcomings of existing methods: the authors say Llama Guard, WildGuard, ShieldGemma and others rely on predefined safety standards, and fixed risk taxonomies cannot cover rules that change with the application; DynaGuard and YuFeng-XGuard support user-defined rules but focus on dialogue compliance and content safety, with insufficiently direct coverage of tool-mediated behavior evaluation.
- Core observation: the same logged operation can receive different judgments under different policies (example in Figure 1), so evaluation must jointly interpret the given policy and the trajectory, and policy identifiers are meaningful only within the current policy and do not represent globally fixed risk categories.
- The paper proposes: the AdaptiveSafety dataset (10,939 training and 1,000 test samples, with policies containing 1–100 rules), the SafePO reinforcement learning algorithm, and the AdaGuard guardrail model series at 0.6B/4B/8B.
- Evaluation setup: in the guardrail input, the policy is placed in the system instructions (trusted) and the interaction log is placed in a delimited untrusted input section; instructions appearing in the log (including injected instructions) serve only as evaluation evidence and do not automatically constitute agent violations; unobserved internal states are outside the scope of evaluation.
What related research exists?
Related work falls into three categories: fixed-taxonomy guardrails, adaptive guardrails, and typed decision interfaces; this paper focuses on identifying the complete set of violated rules for agent behavior.
Fixed-taxonomy guardrails and safety datasets
- Llama Guard (Inan et al., 2023), WildGuard (Han et al., 2024), ShieldGemma (Zeng et al., 2024)—input-output guardrails that detect harmful requests and unsafe responses.
- BeaverTails (Ji et al., 2023), ToxicChat (Lin et al., 2023), Aegis 2.0 (Ghosh et al., 2025)—datasets that annotate prompts and responses under predefined safety standards. The paper notes that such fixed taxonomies struggle to express rules that vary with the task.
Adaptive guardrails
- DynaGuard (Hoover et al., 2026)—evaluates text under user-defined policies and supports explanatory reasoning.
- YuFeng-XGuard (Lin et al., 2026)—supports dynamic risk definitions and reasoning explanations. The paper notes that the main focus of both remains dialogue compliance and content safety, and their evaluation of tool-mediated behavior is not direct enough.
Typed decision interfaces
- Jev (Jev Model Guide, 2026) and Laya (Convai Innovations, 2026)—let developers express policy checks as questions with probabilistic outputs, providing typed decision interfaces.
Agent risk background
- AgentHarm (Andriushchenko et al., 2025), AgentDojo (Debenedetti et al., 2024), InjecAgent (Zhan et al., 2024), etc. are cited to illustrate agent risk and prompt injection background; data construction is based on the authors' prior agent safety testing work (Feng et al., 2026).
Baselines and benchmarks: comparison baselines are Qwen3Guard-Gen-4B/8B, YuFeng-XGuard-Reason-8B, DynaGuard-4B/8B, Laya, Laya-Typed-Decisions (local models, Table 1), and GPT-5.2, Gemini-3.1-Flash-Lite, Jev (API, Table A1); evaluation benchmarks are AdaptiveSafety and DynaBench.
Authors' positioning: the above work established flexible policy specification and decision interfaces; this paper focuses on identifying, under a given policy, the complete set of rules that agent behavior violates.
How does the paper address this problem?
AdaptiveSafety counterfactual supervision + SFT initialization + SafePO reinforcement learning (structured rewards with value-guided region-wise weighting).
Overall approach: first use AdaptiveSafety for supervised initialization, establishing a mapping from (policy, interaction record) to holistic analysis and decision; then use SafePO reinforcement learning, with a structured decision reward distinguishing fully and partially correct decisions, and a value model to redistribute token weights within the analysis and decision regions (Figure 2).
Problem Formulation
- A policy is an ordered list p = [(ℓ1, r1), …, (ℓM, rM)], where rj is a natural-language rule and ℓj is a unique identifier within the policy; the number of rules M, descriptions, and identifiers vary with the input.
- The guardrail output y = (a, P): a holistic analysis a plus a sequence P of violation identifiers in policy order; outputs with no violation retain the marker NR; the serialized format is <analysis>…</analysis><label>…</label>.
- The target violation set S⋆(p, c) is jointly determined by rule conditions and record evidence; trajectories containing agent events evaluate agent behavior, while records containing only the user evaluate the request itself.
AdaptiveSafety Dataset and Supervised Initialization
- Based on prior work (Feng et al., 2026), agent interactions are collected from multiple sources and subjected to three types of augmentation: structural augmentation (changing rule order, local identifiers, and policy length, and adding related but unviolated rules), policy counterfactuals (changing permissions, conditions, thresholds, or exceptions while keeping the trajectory unchanged), and behavior counterfactuals (keeping the policy unchanged while changing record facts such as authorization, refusal and execution, and tool results).
- Each example is paired with a holistic analysis and a complete reference decision; there are 10,939 training and 1,000 test examples, with policies of 1–100 rules; related variants remain within the same split, and the test set is not used for training or checkpoint selection.
- The 0.6B/4B/8B actor is initialized from Qwen3Guard-Gen, and full-parameter SFT uses a weighted token-level NLL: <label> the entire segment has weight 4, other response tokens have weight 1, and prompt and padding are 0 (Appendix C).
Structured Reward and Group-Relative Optimization
- The reward distinguishes set membership from sequence order: exact match gets 1; correct set but wrong order gets 0.8 + 0.15·Fseq; the rest are scored as −0.5 + Fset + 0.25·Fseq; invalid responses (missing tags, out-of-range identifiers, mixing NR with identifiers, exceeding the generation limit) get −1. Fset is set F1, and Fseq is based on the longest common subsequence.
- For valid but non-exact-match responses, the length penalty increases linearly from 0 at 384 tokens to 0.05 at the 640-token limit; the reward measures only decision correctness and output structure and does not independently verify the factual correctness of the analysis.
- K = 8 responses are sampled per input, and within-group normalization gives the response-level advantage AGi = (Ri − R̄G(i)) / (σG(i) + 10−6); if rewards within a group are identical, the advantage is 0.
Value-Guided Regional Balancing
- The fixed weight shares of the analysis region and the decision region (including separators and end token) are mA = 1/3 and mV = 2/3; an independent value model predicts the final reward from causal prefixes, and the value differences between adjacent prefixes are used to construct positive modulation factors: positive-advantage responses emphasize where value rises, and negative-advantage responses emphasize where value falls, with normalization within each region to keep the total weight unchanged.
- The modulation strength κ ∈ [0,1] is adjusted per batch according to the value model's prediction error, falling back to fixed regional weighting when value estimates are poor; the value model shares no parameters with the actor, and only the actor is needed at inference time.
- The actor is updated with a clipped surrogate (ϵ = 0.1) and a KL regularizer against the frozen SFT model (β = 0.005); checkpoint selection uses separate development data and retains the SFT initialization as a candidate.
What experiments did the paper conduct?
Comparing 10 local models and 3 API models on AdaptiveSafety and DynaBench, AdaGuard-8B leads on AdaptiveSafety and trails DynaGuard-8B on DynaBench.
Experimental Setup
- Models under test: local models are AdaGuard-0.6B/4B/8B, Qwen3Guard-Gen-4B/8B, YuFeng-XGuard-Reason-8B, DynaGuard-4B/8B, Laya, Laya-Typed-Decisions (Table 1); API models are GPT-5.2, Gemini-3.1-Flash-Lite, Jev (Table A1).
- Datasets: AdaptiveSafety test set 1,000 examples (500 compliant, 500 violating); DynaBench test set 543 examples (276 compliant, 267 violating), each input accompanied by its policy.
- Metrics: binary classification Accuracy/Precision/Recall/F1 (violation as positive class); rule identification uses exact match (Exact) and within-policy micro-F1; invalid outputs count as binary classification errors, do not count toward exact match, and count as empty sets for micro.
- Inference settings: local generative models use BF16 greedy decoding, prompt budget 16,000 tokens; output budgets AdaGuard 512, DynaGuard 1,024, Qwen3Guard-Gen and YuFeng-XGuard 128 tokens; Laya uses SDK 0.3.5 native truncation (512/1,024 tokens), and the authors note its results should not be regarded as an estimate of full-context capability.
- Interface adaptation: Qwen3Guard-Gen retains its fixed taxonomy, with Controversial/Unsafe mapped to the positive class; DynaGuard uses native PASS/FAIL; these adapters only give binary classification decisions and do not participate in rule identification scoring.
- Number of runs: all evaluations are single runs; the authors report descriptive differences and make no significance claims (Appendix A.6).
Main Results
According to Table 1 (binary classification, %) and Table 2 (rule identification, %):
Swipe horizontally to read the table
Model AS Acc. AS F1 AS Exact DB Acc. DB F1 DB Exact Qwen3Guard-Gen-8B 58.90 38.93 not reported 51.93 4.40 not reported YuFeng-XGuard-Reason-8B 57.30 40.45 not reported 50.09 30.33 not reported DynaGuard-8B 64.10 67.03 not reported 80.11 77.31 not reported Laya-Typed-Decisions 52.30 66.24 8.50 50.09 4.91 49.36 AdaGuard-0.6B 82.60 80.71 68.10 51.38 60.71 44.94 AdaGuard-4B 89.30 88.53 76.60 71.82 71.82 63.72 AdaGuard-8B 89.50 88.67 77.10 76.80 76.05 70.72 (AS = AdaptiveSafety, DB = DynaBench; Qwen3Guard-Gen-4B, DynaGuard-4B, and Laya rows omitted; binary classification adapters have no rule identification scores.)
- The authors state that AdaGuard-8B exceeds the strongest non-AdaGuard baseline on AdaptiveSafety by 22.20 and 21.64 percentage points in accuracy and F1, respectively; its 96.25% precision indicates few false positives, but its recall (82.20%) is lower than Laya-Typed-Decisions (93.60%).
- On DynaBench, DynaGuard-8B's accuracy (80.11%) and F1 (77.31%) are higher than AdaGuard-8B's, but its recall is lower (68.91% vs. 74.91%); the authors state that this evaluation does not demonstrate zero-shot transfer or a consistent advantage.
- Figure 3 gives false positive and false negative rates normalized by compliant/violating examples respectively (values in the figure are unreadable in the text conversion).
API Model Comparison (Appendix A.1)
- What was tested: the binary classification and rule identification comparison was extended to GPT-5.2, Gemini-3.1-Flash-Lite, Jev (Table A1, A2), using the same examples but different interfaces and inference budgets.
- Results: on AdaptiveSafety, AdaGuard-8B exceeds all three on accuracy, F1, Exact, and micro-F1, leading Jev by 7.10 and 5.30 percentage points; GPT-5.2's recall of 93.80% is higher than AdaGuard-8B's 82.20%. On DynaBench, Jev has the highest accuracy (83.61%) and GPT-5.2 the highest F1 (81.30%), both exceeding AdaGuard-8B.
- Coverage differences (Table A3): Gemini has 103 invalid AdaptiveSafety outputs, and the local YuFeng run has 139 invalid outputs (36 on DynaBench); these protocol-related failures are counted in the main scores.
Training Stage Comparison (Figure 5, Table A4)
- What was tested: differences between the saved SFT checkpoint and the current SafePO checkpoint (descriptive comparison, not a controlled ablation; the input budget algorithm of the historical SFT evaluation differs).
- Results: on 8B, after SafePO, AdaptiveSafety accuracy 88.40%→89.50%, Exact 76.20%→77.10%, DynaBench accuracy 74.77%→76.80%, Exact 67.40%→70.72%. On 4B, AdaptiveSafety accuracy 89.90%→89.30%, Exact 77.20%→76.60%, DynaBench F1 73.15%→71.82% but Exact 63.35%→63.72%; on 0.6B, DynaBench F1 62.32%→60.71%.
- The authors state that these observations do not support SafePO improving on every metric at every scale.
Other Ablations and Analyses
- Policy length (Figure 4): with 51–100 rules, AdaGuard-8B accuracy is 88.40% and Exact 77.20%; Exact is non-monotonic with length, and the content and label composition differ across groups; 0.6B is less stable, especially on DynaBench.
- Evaluation scope (Table A5): AdaptiveSafety contains 117 user-request-only and 883 trajectory examples; AdaGuard-4B request-level accuracy is 91.45% and trajectory-level 89.01%, and 8B is 90.60% and 89.35% respectively.
- Component ablation: Appendix A.4 explicitly states that there is no component ablation isolating the reward term, value modulation, or regional budget.
What are some points that can be further explored?
The authors point out limitations including the DynaBench gap, inconsistent training gains, and unvalidated explanations; the experiments are a single run with no component ablations.
Limitations and Future Directions Noted by the Authors
- A gap remains relative to the specialized DynaGuard model on DynaBench, and this evaluation does not establish zero-shot transfer or a consistent advantage (Section 4, Section 6).
- The change from SFT to SafePO is inconsistent across model scales, which does not support the conclusion of improvement on every metric at every scale (Section 4, Appendix A.4).
- The factual correctness of the generated holistic analysis was not independently verified; the reward measures only decision correctness and output structure (Section 3.2, Section 6, Appendix A.6).
- Controlled component ablations are needed to determine which training choices bring gains (Section 6, Appendix A.6); Appendix A.4 states that the provided results contain no ablation isolating the reward term, value modulation, or regional budget.
- Broader deployment studies are needed to assess the reliability of guardrail-supported interventions; human review should be retained for consequential decisions, and performance should be evaluated against the policy of the target application (Section 6).
- The comparison between SFT and SafePO is descriptive: the input budget algorithm of the historical SFT evaluation differs, and it is not a rerun under the same protocol (Appendix A.4).
Experimental Coverage
- 13 models were tested in total: 10 local models (Table 1) plus 3 API models (Table A1).
- The evaluation benchmarks are two: AdaptiveSafety (1,000 examples) and DynaBench (543 examples); the paper does not report results on other benchmarks.
- All evaluations are single runs; the paper does not report training seed variation or statistical significance tests (Appendix A.6).
- Interfaces and context budgets differ across models: Laya results retain SDK native truncation, and at least one question per AdaptiveSafety example was truncated; server-side truncation for GPT-5.2 and Gemini is unknown (Appendix A.2).
- The policy length analysis covers four groups of 1–100 rules (n=205/390/155/250, Figure 4); the evaluation scope analysis distinguishes 117 request-only and 883 trajectory examples (Table A5).
Summarize the main content of the paper
AdaGuard: an agent trajectory guardrail under user-defined policies, trained with AdaptiveSafety data + SafePO, leading on AdaptiveSafety and with a gap on DynaBench.
A paper on a policy-adaptive guardrail model, addressing the problem that in agent deployment rules vary with the application and fixed risk taxonomies are insufficient.
- Problem: the same agent operation is judged differently under different user-defined policies; the guardrail needs to jointly understand the policy and the trajectory and output a holistic analysis and the complete set of violated rule identifiers.
- Data: AdaptiveSafety contains 10,939 training and 1,000 test examples, with policies of 1–100 rules; structural augmentation, policy counterfactuals, and behavior counterfactuals link changes in rules or behavior to the corresponding violation sets.
- Method: first weighted SFT initialized from Qwen3Guard-Gen (label segment weight 4), then SafePO reinforcement learning—a structured reward distinguishes set and order errors, and a value model redistributes token weights within the analysis region (weight 1/3) and the decision region (weight 2/3).
- Main results: AdaGuard-8B achieves 89.50% accuracy, 88.67% F1, and 77.10% exact rule match on AdaptiveSafety, outperforming the tested local baselines (Table 1, 2); 4B is 89.30% and 76.60%.
- External evaluation: on DynaBench, AdaGuard-8B accuracy is 76.80%, lower than DynaGuard-8B's 80.11%, but it supports rule attribution that the DynaGuard adapter lacks (Exact 70.72%); among API models, Jev (83.61%) and GPT-5.2 (F1 81.30%) exceed AdaGuard-8B on DynaBench.
- Authors' conclusion: the authors state that AdaGuard achieves strong detection and rule identification results on AdaptiveSafety, but the DynaBench gap, inconsistent training gains across scales, and unverified explanation quality delimit the scope of the conclusions; human review should be retained for consequential decisions in deployment.