Skip to content

SafePyramid: A hierarchical safety benchmark for in-context policy guardrailsSafePyramid: A Hierarchical Benchmark for In-context Policy Guardrailing

Paper Tracker· arXiv:2606.29887· Jiacheng Zhang, Haoyu He, Sen Zhang, Shen Wang, Xiaolei Xu, Yuhao Sun, Meng Shen, Feng LiuByteDance; The University of MelbourneIndexed by this site · 2026-10-08· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the SafePyramid benchmark to evaluate in-context policy guardrailing; the strongest model, GPT-5.5, achieves [email protected] of only 54.0%, 35.3%, and 12.9% on L0/L1/L2.

Questions
Real guardrails need to determine violations according to application-specific safety policies rather than fixed risk categories, but the authors argue that existing evaluations (e.g., DynaBench) are closer to instruction following and lack systematic evaluation of in-context policy guardrailing capability.
Methods
The authors build SafePyramid: 1,000 multi-turn conversations, 10 domains, 3,000 policies with 61,699 rules in total, split into three levels L0 (single-rule understanding), L1 (rule dependencies), and L2 (fictional new policy framework), evaluating violated-rule set prediction with RMR and RDR.
Experiments and results
Evaluating 10 frontier LLMs and 5 configurable guardrail models: GPT-5.5 has the highest average RMR at 54.2%, with [email protected] only 12.9% on L2; per-rule evaluation raises GPT-OSS-Safeguard-120B's average RMR from 23.6% to 52.4%; agent harness and higher reasoning levels also yield improvements.
Limitations and future work
In the Limitations section, the authors note: no human expert baseline, coverage of only the text modality, and limited policy coverage (domains, languages, jurisdictions). The experiments cover 10 LLMs and 5 guardrail models, and the harness ablation uses only the 900-case subset.
Experimental setupGPT-5.5、Claude-Opus-4.7 et al. · SafePyramid · RMR、[email protected] et al.
Evaluated models
GPT-5.5Claude-Opus-4.7Kimi-K2.6DeepSeek-V4-ProDoubao-Seed-2.0-ProGemini-3.5-FlashHunyuan-HY3-PreviewQwen-3.6-Max-PreviewGLM-5.1Grok-4.3GPT-OSS-Safeguard-120BGPT-OSS-Safeguard-20BFlexGuard-Qwen3-8BDynaGuard-8BShieldLM-14B-QwenGPT-5.4
Benchmarks
SafePyramid
Metrics
RMR[email protected]RDRRefusal Rate
AI summaryThe researchers propose SafePyramid, a safety benchmark for evaluating in-context policy guardrailing, containing 1000 multi-turn dialogues across 10 domains and 3000 application-specific policies, totaling 61699 natural language rules. The benchmark has three difficulty levels: L0 evaluates single-rule understanding, L1 evaluates reasoning about rule dependencies, and L2 evaluates adaptation to entirely new policy frameworks in context. The research team built and validated the benchmark with a multi-stage process and evaluated 10 frontier LLMs and 5 configurable policy guardrails, finding that in-context policy guardrailing remains highly challenging: the best-performing GPT-5.5 fully identifies all violated rules at only 54.0%, 35.3%, and 12.9% on L0, L1, and L2, respectively.

The researchers propose SafePyramid, a safety benchmark for evaluating in-context policy guardrailing, containing 1000 multi-turn dialogues across 10 domains and 3000 application-specific policies, totaling 61699 natural language rules. The benchmark has three difficulty levels: L0 evaluates single-rule understanding, L1 evaluates reasoning about rule dependencies, and L2 evaluates adaptation to entirely new policy frameworks in context. The research team built and validated the benchmark with a multi-stage process and evaluated 10 frontier LLMs and 5 configurable policy guardrails, finding that in-context policy guardrailing remains highly challenging: the best-performing GPT-5.5 fully identifies all violated rules at only 54.0%, 35.3%, and 12.9% on L0, L1, and L2, respectively.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose the in-context policy guardrailing evaluation problem: whether a guardrail can determine the set of violated rules according to an application policy given in context.

    Core question: can a guardrail, based on an application-specific safety policy provided in context at inference time, identify which rules a user–model interaction violates, rather than relying on predefined risk categories.

    • Problem scenario: the authors state that risk categories and safety standards vary greatly across applications (e.g., a short-video platform's youth safety policy), and the ideal approach is to adjust guardrail behavior by editing only the policy text, without redesigning the taxonomy and retraining the guardrail.
    • Shortcomings of existing evaluations: the authors consider DynaBench's rules to be mostly general response constraints (e.g., no emoji), closer to instruction following than safety policy enforcement; thus it remains unclear whether guardrails can enforce safety policies, what capabilities are needed, and how to evaluate them separately.
    • Core observation: the authors decompose in-context policy guardrailing into three capabilities—understanding a single rule, resolving dependencies among rules (exceptions/conditions), and adapting to new policy frameworks that appear after training.
    • What the paper proposes: the SafePyramid benchmark, containing 1,000 multi-turn conversations, 10 domains, 3,000 policies, and 61,699 distinct rules, evaluating the above three capabilities separately at three difficulty levels L0/L1/L2, and evaluating 10 frontier LLMs and 5 policy-configurable guardrail models.
    • Task form: rather than outputting a safe/unsafe binary classification, predict the complete violated-rule set (violated-rule set prediction).
  2. What related research exists?

    Related work falls into four groups: fixed-classification guardrails, configurable guardrails, LLM safety benchmarks, and instruction-following/rule-reasoning/in-context learning benchmarks.

    LLM guardrail models

    • Llama Guard series, ShieldGemma series, AEGIS, WildGuard, Granite Guardian, Qwen3Guard—classify inputs or outputs according to predefined risk taxonomies; the paper notes that their safety boundaries are limited by fixed taxonomies and are not suitable for in-context policy guardrailing.
    • ShieldLM (2024)—an early guardrail that supports user-provided rules at inference time; it is followed by GPT-OSS-Safeguard, DynaGuard, GSPR, FlexGuard. The paper notes that these methods differ greatly in how they handle user policies, indicating that policy-configurable guardrailing remains an ill-defined paradigm.

    LLM safety benchmarks

    • SafetyBench, HarmBench, etc.—evaluate refusal, toxicity, and jailbreak resistance; the paper notes that they define safety using fixed task labels or harm categories.
    • FlexBench (2026)—evaluates guardrail performance under different enforcement strengths from lenient to strict; the paper notes that it still centers on predefined risk taxonomies rather than contextual policies.
    • DynaBench (2026)—evaluates whether interactions violate user-defined instructions; the paper notes that its rules are more like instruction-following constraints than safety rule enforcement.

    Instruction-following, rule-reasoning, and in-context learning benchmarks

    • IFEval, FollowBench, SysBench, Collie—evaluate whether models satisfy lexical, formatting, or system-level constraints.
    • LegalBench, Logic-of-Thought—evaluate the ability to apply domain-specific rules in context.
    • CL-Bench and CL-Bench Life—evaluate whether models can learn from and use information in new contexts; the paper states that the confabulation framework design of L2 draws on CL-Bench.

    Baselines and comparisons: The 5 policy-configurable guardrail models evaluated in the paper (ShieldLM-14B-Qwen, GPT-OSS-Safeguard-20B/120B, DynaGuard-8B, FlexGuard-Qwen3-8B) are the comparison targets, and the evaluation benchmark is SafePyramid, proposed by the authors. Table 1 gives a feature comparison: the authors state that SafePyramid is the only safety benchmark whose task is predicting the set of violated rules and that evaluates the three capabilities separately. Authors' positioning: existing benchmarks cover only part of this setting, whereas SafePyramid is safety-centric and covers all three capabilities.

  3. How does the paper address this problem?

    SafePyramid uses a three-level hierarchy (L0 single rule, L1 rule dependencies, L2 fictional new framework) to evaluate three capabilities separately, with two evaluation protocols and two metrics.

    Overall approach: formalize in-context policy guardrailing as a violated-rule set prediction task, then use a three-level difficulty hierarchy to separately evaluate three capabilities; data is generated by frontier LLMs, with cross-model validation and human review.

    Problem setting

    • Given a multi-turn conversation C and a context policy P = {r1, …, rK} (K natural-language rules), the guardrail must predict the violated rule subset V̂ ⊆ {1, …, K} and compare it with the ground-truth set V⋆.
    • Unlike traditional safe/unsafe binary classification, this is a rule-level set prediction task.

    Three-level hierarchy design

    • L0 Understand a single rule: rules are mutually independent. decisive rules have sufficient conversational evidence to determine whether they are violated; distractor rules are topic-related but not actually triggered, used to test whether the model over-matches by surface similarity.
    • L1 Resolve rule dependencies: on top of L0 rules, add exception rules (when triggered, exempt/reinterpret the base rule and introduce an alternative standard) and conditional rules (when the condition is met, turn an originally compliant base rule into a violation); rule outcomes flip with context.
    • L2 Adapt to a new policy framework: rewrite the L1 policy with a completely fictional framework (new concepts, terminology, rule semantics) while preserving the underlying rule structure; the authors state this prevents models from relying on pretrained safety priors, and the fictional framework is a diagnostic abstraction rather than a claim that real policies are written this way.

    Data construction and quality control

    • 10 domains (academic integrity, content moderation, critical infrastructure, defamation, discrimination, fraud, intellectual property, privacy, sexual content, professional advice), 30 scenarios per domain for 300 total, instantiated as 1,000 conversations, averaging 12.8 turns each; each conversation is paired with three policies L0/L1/L2, totaling 3,000 policies and 61,699 distinct rules (Table 2).
    • Generation: Grok-4.1 generates conversations; GPT-5.4, Gemini-3.1-Pro, and Claude-Opus-4.6 generate L0, L1, and L2 policies respectively; schemas for each rule type are designed before generation.
    • Validation: three models other than the generating models act as validators, performing checklist-style yes/no checks, passing by majority vote and assigning labels, with validators required to cite evidence; afterward domain experts conduct two rounds of human review, and disagreement or ambiguous cases are removed directly; the authors report human–LLM validation agreement above 90%.

    Evaluation protocols and metrics

    • Per-policy (main protocol): the model reads the full policy and directly outputs the violated rule set, suited to frontier LLMs; per-rule: judge one target rule at a time (with relevant policy context pre-organized) and then aggregate, suited to guardrail models that can only output binary classifications, simpler but with higher inference cost.
    • Metrics: RMR@τ is the case-level match rate, mi(τ) = 1[max(FPi, FNi) ≤ ⌊ (1−τ)|Gi| ⌋], i.e., a case matches only if the number of false-positive/false-negative rules does not exceed the allowed deviation; the main metric RMR is the average over τ ∈ {0.7, 0.8, 0.9, 1.0}, and [email protected] is exact match. RDR is the micro-averaged set difference rate, RDR = (∑i (FPi + FNi))/(∑i |Pi ∪ Gi|), lower is better. Refusal cases are not counted in the metrics and are reported separately.
  4. What experiments did the paper conduct?

    10 frontier LLMs and 5 guardrail models are evaluated under two protocols; GPT-5.5 has the highest average RMR at 54.2%, and exact match on L2 is only 12.9%.

    Experimental setup

    • Models tested: 10 frontier LLMs (GPT-5.5, Claude-Opus-4.7, Kimi-K2.6, DeepSeek-V4-Pro, Doubao-Seed-2.0-Pro, Gemini-3.5-Flash, Hunyuan-HY3-Preview, Qwen-3.6-Max-Preview, GLM-5.1, Grok-4.3), each using its strongest available reasoning level; 5 policy-configurable guardrail models (GPT-OSS-Safeguard-120B/20B, FlexGuard-Qwen3-8B, DynaGuard-8B, ShieldLM-14B-Qwen).
    • Protocols: only the two GPT-OSS-Safeguard models support outputting an arbitrary violated-rule set, so they run both per-policy and per-rule; the other guardrail models run only per-rule.
    • Benchmark scale: 1,000 conversations × 3 levels = 3,000 cases; L0/L1/L2 average 16.1/28.7/33.0 rules per policy and 5.5/6.3/6.8 violated rules on average (Table 2).
    • Metrics: RMR (average over τ ∈ {0.7–1.0}), [email protected] (exact match), RDR (lower is better), Refusal Rate; refusal cases are not counted in the metrics.
    • Harness ablation: on a 900-case subset (30 random cases per domain per level), testing Codex (v0.130.0) + GPT-5.4, Claude Code (v2.1.142) + GPT-5.4, and Claude Code + Claude-Opus-4.7.
    • The paper does not report the number of repeated runs per case.

    Main results

    Per-policy evaluation (from Table 3; RMR / [email protected] / RDR are all in %, Avg. is the average over the three levels):

    Swipe horizontally to read the table

    ModelL0 RMRL1 RMRL2 RMRAvg. RMRAvg. [email protected]Avg. RDR
    GPT-5.570.756.832.954.234.919.7
    Claude-Opus-4.773.851.131.052.935.023.9
    Kimi-K2.668.354.133.152.331.321.4
    DeepSeek-V4-Pro70.854.530.652.231.721.7
    Doubao-Seed-2.0-Pro63.154.132.950.029.522.1
    Gemini-3.5-Flash61.453.933.549.628.123.3
    Qwen-3.6-Max-Preview68.946.526.447.429.229.4
    GLM-5.167.041.317.042.725.833.5
    Grok-4.370.639.411.940.625.136.0
    GPT-OSS-Safeguard-120B56.812.12.123.613.651.9

    The table omits Hunyuan-HY3-Preview (Avg. RMR 49.1) and GPT-OSS-Safeguard-20B (22.5).

    • The authors state: almost all models decline monotonically from L0 to L2, with the largest drop at L2, making adaptation to new policy frameworks the main bottleneck; guardrail models are competitive only at L0 and collapse at L1/L2.
    • Refusal rates: GPT-5.5 is 7.9%, Grok-4.3 only 0.2%, Gemini-3.5-Flash 0.4% (Table 3).
    • Exception: Claude-Opus-4.7's L0 RMR (73.8) is higher than GPT-5.5's (70.7), but its L1/L2 are lower than GPT-5.5's.

    Per-rule evaluation (Table 4)

    • What was tested: decomposing the task into per-rule binary classification with policy context pre-organized, compared with per-policy.
    • Results: GPT-OSS-Safeguard-120B's average RMR rises from 23.6% to 52.4%, and 20B's from 22.5% to 44.5%; GPT-5.5 rises only from 54.2% to 55.5% (RDR drops from 19.7% to 18.1%). ShieldLM-14B-Qwen's average RMR is only 0.6%, and DynaGuard-8B's is 6.5%.
    • Authors' interpretation: the bottleneck for small guardrail models is compositional handling of the full policy rather than single-rule understanding; frontier LLMs are less bottlenecked by policy context length; the L2 gap persists under per-rule, and the authors argue that context organization alone is insufficient to handle new-framework semantics.

    Reasoning-level and agent harness ablations

    • Reasoning level (Figure 4): for GPT-5.5 from low to xhigh level, L0 RMR changes little (annotated Δ=-1.8 over the 70.7→72.5 range; the two L0 values in the figure are 70.7 and 72.5), L1/L2 RMR increase by +5.5 and +14.5 percentage points respectively, and RDR decreases by 3.9 and 15.7 percentage points respectively; the authors state that additional reasoning budget mainly helps rule dependencies and framework adaptation.
    • Agent harness (Table 5, 900-case subset): GPT-5.4 without a harness has an average RMR of 56.0%, with Codex 58.0%, with Claude Code 57.9%; Claude-Opus-4.7 + Claude Code reaches 60.4% average RMR and 40.4% [email protected], with average RDR dropping from 23.5% to 17.4%. The authors state that harness gains concentrate at L1/L2, and Figure 14 shows positive gains in most domains (a few domains are negative, e.g., on Fraud the RMR change for GPT-5.4+Codex is -2.5).

    Cost and error attribution

    • Cost (Figure 5): GPT-5.5 evaluation cost is $1,078 (RMR 54.2), Claude-Opus-4.7 is $1,580 (52.9); DeepSeek-V4-Pro $96 (52.2), Kimi-K2.6 $210 (52.3), Gemini-3.5-Flash $345 (49.6), Hunyuan-HY3-Preview $11 (49.1). The authors state that cost and performance are not tightly coupled.
    • Error attribution (Figure 15, per-policy): among L0 errors, decisive rules often account for over 90%; at L1 the dominant error source shifts to exception rules; at L2 the share of conditional-rule errors rises, more markedly for GLM-5.1 and Grok-4.3.
    • Root-cause analysis (Appendix J, GPT-5.5 sample): the main cause of decisive false positives is surface-cue matching (54% of the sample), the main cause of distractor false positives is dropped qualifiers (58%), and the main cause of exception false positives is triggering when the activation condition is not met (43%); the same conditional template that is handled correctly at L1 is mistaken for the violated rule itself under the L2 fictional framework, with the conditional false-positive rate rising from 2% at L1 to 26% at L2 (Table 33, 34).

    Other ablations and analyses

    • RMR threshold breakdown (Appendix F, Table 28/29): a full breakdown of τ from 1.0 to 0.5 is given.
    • Per-domain performance (Appendix G, Figure 6–13): bar charts of RMR/[email protected]/RDR for each model across the 10 domains.
    • Per-domain harness effect (Appendix H, Figure 14): RMR changes are positive in most domains and negative in a few.
  5. What are some points that can be further explored?

    The authors list three limitations (no human baseline, text only, limited policy coverage) and corresponding future directions.

    Limitations and future directions noted by the authors

    • Lack of a human baseline (Section 5): the performance of trained human policy auditors on the same rule-matching task was not evaluated, so results only reflect model levels relative to the validated ground truth; future work could establish an expert human baseline and measure inter-annotator agreement under the same protocol.
    • Limited modality coverage (Section 5): only text conversations are covered, whereas real scenarios may involve multimodal evidence such as images, audio, video, and documents; the authors state that extending to multimodality is an important direction.
    • Limited policy coverage (Section 5): although 10 domains are covered, real organizations may have more domain-specific definitions, regional legal requirements, and evolving internal standards; future work could extend to more domains, languages, jurisdictions, and real policy variants.
    • Harness direction (Section 4.3, Section 6): the authors state that the gains from per-rule evaluation and agentic harnesses suggest that stronger guardrails may require better policy decomposition, context organization, and rule-level verification, and that designing more advanced agentic harnesses is a promising direction.

    Scope of experimental coverage

    • The models tested are 10 frontier LLMs and 5 policy-configurable guardrail models, 15 in total (Section 4.1).
    • The evaluation protocols are per-policy and per-rule; only GPT-OSS-Safeguard-120B/20B run both protocols, while ShieldLM-14B-Qwen, DynaGuard-8B, and FlexGuard-Qwen3-8B run only per-rule (Section 4.1).
    • The agent harness ablation is conducted on a 900-case subset (30 cases per domain per level), testing only two models, GPT-5.4 and Claude-Opus-4.7, and two harnesses, Codex and Claude Code (Section 4.1, Table 5).
    • The reasoning-level ablation reports only GPT-5.5's low and xhigh levels (Figure 4).
    • The paper does not report the number of repeated runs per case; human review reports agreement above 90% with LLM validation, but the specific number of reviewed samples is not reported (Section 3.5).
  6. Summarize the main content of the paper

    SafePyramid evaluates guardrails' ability to enforce context policies with a three-level hierarchy; the authors state that current models remain far from reliable enforcement.

    SafePyramid is a hierarchical benchmark for evaluating in-context policy guardrailing: the guardrail must predict, based on an application-specific policy given in the inference-time context, the complete set of rules violated in a multi-turn conversation.

    • Problem: The authors argue that existing safety benchmarks use fixed risk taxonomies, and that DynaBench and similar benchmarks are closer to instruction following, so they cannot systematically evaluate a guardrail's ability to enforce safety policies.
    • Method: 1,000 multi-turn conversations (10 domains, average 12.8 turns), 3,000 policies, 61,699 rules; L0 tests single-rule understanding (decisive/distractor), L1 adds exception/conditional to test rule dependencies, L2 uses a confabulation policy framework to test adaptation to new concepts; data is generated by 4 frontier LLMs, validated by cross-model majority voting and two rounds of expert manual review (agreement rate above 90%).
    • Main results (Table 3, per-policy): GPT-5.5 has the highest average RMR at 54.2%, with [email protected] of 54.0%, 35.3%, and 12.9% on L0/L1/L2 respectively; almost all models decrease monotonically from L0 to L2.
    • Guardrail models: GPT-OSS-Safeguard-120B has a per-policy average RMR of only 23.6%, rising to 52.4% under per-rule (Tables 3, 4); the authors state that the bottleneck is complete policy composition rather than single-rule understanding.
    • Improvement methods: GPT-5.5 with the xhigh reasoning level gains +14.5 percentage points in RMR on L2 (Figure 4); Claude-Opus-4.7 + Claude Code reaches an average RMR of 60.4% on the 900-case subset (Table 5).
    • Authors' conclusion: Current systems remain far from a reliable in-context policy guardrail, especially under rule dependencies and new policy concepts; stronger guardrails may require better policy decomposition, context organization, and rule-level verification.
Read originalarxiv.org