Skip to main content

CASE-Bench: Context-Aware SafEty Benchmark for Large Language Models

CASE-Bench evaluates LLMs as context-aware safety judges. It pairs 450 potentially harmful queries (from SORRY-Bench, 45 categories) with two Contextual Integrity-formalized contexts each (one safe, one unsafe), yielding 900 query-context samples. Human majority votes (21 annotators per sample via MTurk) provide ground-truth labels. Models output a binary safe/unsafe verdict; scoring measures overall accuracy and per-class recall against human majority labels. Child-related crimes samples are always labeled unsafe regardless of context.

Overview

⚠️ External evaluation. Code lives in an upstream repository. inspect_evals lists it for discoverability; review the upstream repo and pinned commit before running.

Source: barlowa124/inspect-case-bench@7625b0c

CASE-Bench evaluates LLMs as context-aware safety judges. It pairs 450 potentially harmful queries (from SORRY-Bench, 45 categories) with two Contextual Integrity-formalized contexts each (one safe, one unsafe), yielding 900 query-context samples. Human majority votes (21 annotators per sample via MTurk) provide ground-truth labels. Models output a binary safe/unsafe verdict; scoring measures overall accuracy and per-class recall against human majority labels. Child-related crimes samples are always labeled unsafe regardless of context.

Usage

Installation

This is an externally-maintained evaluation. Clone the upstream repository at the pinned commit and install its dependencies:

git clone https://github.com/barlowa124/inspect-case-bench
cd inspect-case-bench
git checkout 7625b0cada735906cfd01b0407dba9c48e828d1c
uv sync

Running evaluations

CLI

uv run inspect eval src/inspect_case_bench/case_bench.py@case_bench --model openai/gpt-5-nano

Python

from inspect_ai import eval
from inspect_case_bench.case_bench import case_bench

eval(case_bench(), model="openai/gpt-5-nano")

View logs

Log viewing (inspect view) and default-model setup are documented in the Inspect Evals README.

More information

For the dataset, scorer, task parameters, and validation, see the upstream repo: barlowa124/inspect-case-bench.

Options

You can control a variety of options from the command line. For example:

uv run inspect eval src/inspect_case_bench/case_bench.py@case_bench --limit 10 --sample-shuffle
uv run inspect eval src/inspect_case_bench/case_bench.py@case_bench --max-connections 10
uv run inspect eval src/inspect_case_bench/case_bench.py@case_bench --temperature 0.5

See uv run inspect eval --help for all available options.

More command-line options: Inspect docs ↗

Static checks

Results of inspect-evals-lint at the registered commit. Rule names link to their documentation; findings link to the file at that commit. These checks describe structure and conventions, not whether the evaluation measures what it claims.

Loading lint results…