extract 0 0 0

RedAI4Code/SEVRA

published by @RedAI4Code

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
2K
Last 30 days
304
Likes
-
Size
13.0 MB
Created on HF
2026-03-18
Age
7 months ago

Description

SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents

A benchmark dataset for evaluating automated code review agents against adversarial pull requests. The dataset contains 2,250 malicious PRs (current release: deterministic) and 347 benign ground-truth security fixes, grounded in real vulnerabilities from the OSV/SECommits database, across 10 CWE classes from the 2025 CWE Top 25.

Motivation

Modern AI coding assistants can generate plausible-looking… See the full description on the dataset page: https://huggingface.co/datasets/RedAI4Code/SEVRA.

Tags

license:mitsize_categories:1K<n<10Kformat:jsonmodality:textlibrary:datasetslibrary:pandaslibrary:polarslibrary:mlcroissantarxiv:2606.13757region:uscodesecurityred-teamingvulnerabilityadversarial

README current version from Hugging Face


license: mit
pretty_name: SEVRA-BENCH - Social Engineering of Vulnerabilities in Review Agents
tags:

  • code
  • security
  • red-teaming
  • vulnerability
  • adversarial
    configs:
  • config_name: cwe125-deterministic
    data_files:
    • split: malicious
      path: cwe125/deterministic/generated_prs.jsonl
  • config_name: cwe22-deterministic
    data_files:
    • split: malicious
      path: cwe22/deterministic/generated_prs.jsonl
  • config_name: cwe352-deterministic
    data_files:
    • split: malicious
      path: cwe352/deterministic/generated_prs.jsonl
  • config_name: cwe416-deterministic
    data_files:
    • split: malicious
      path: cwe416/deterministic/generated_prs.jsonl
  • config_name: cwe78-deterministic
    data_files:
    • split: malicious
      path: cwe78/deterministic/generated_prs.jsonl
  • config_name: cwe787-deterministic
    data_files:
    • split: malicious
      path: cwe787/deterministic/generated_prs.jsonl
  • config_name: cwe79-deterministic
    data_files:
    • split: malicious
      path: cwe79/deterministic/generated_prs.jsonl
  • config_name: cwe862-deterministic
    data_files:
    • split: malicious
      path: cwe862/deterministic/generated_prs.jsonl
  • config_name: cwe89-deterministic
    data_files:
    • split: malicious
      path: cwe89/deterministic/generated_prs.jsonl
  • config_name: cwe94-deterministic
    data_files:
    • split: malicious
      path: cwe94/deterministic/generated_prs.jsonl
  • config_name: cwe125-benign
    data_files:
    • split: benign
      path: cwe125/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe22-benign
    data_files:
    • split: benign
      path: cwe22/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe352-benign
    data_files:
    • split: benign
      path: cwe352/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe416-benign
    data_files:
    • split: benign
      path: cwe416/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe78-benign
    data_files:
    • split: benign
      path: cwe78/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe787-benign
    data_files:
    • split: benign
      path: cwe787/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe79-benign
    data_files:
    • split: benign
      path: cwe79/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe862-benign
    data_files:
    • split: benign
      path: cwe862/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe89-benign
    data_files:
    • split: benign
      path: cwe89/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe94-benign
    data_files:
    • split: benign
      path: cwe94/benign/gpt5.2_v2/generated_prs.jsonl
  • config_name: cwe125-benign-top10cvss
    data_files:
    • split: benign
      path: cwe125/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe22-benign-top10cvss
    data_files:
    • split: benign
      path: cwe22/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe352-benign-top10cvss
    data_files:
    • split: benign
      path: cwe352/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe416-benign-top10cvss
    data_files:
    • split: benign
      path: cwe416/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe78-benign-top10cvss
    data_files:
    • split: benign
      path: cwe78/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe787-benign-top10cvss
    data_files:
    • split: benign
      path: cwe787/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe79-benign-top10cvss
    data_files:
    • split: benign
      path: cwe79/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe862-benign-top10cvss
    data_files:
    • split: benign
      path: cwe862/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe89-benign-top10cvss
    data_files:
    • split: benign
      path: cwe89/benign/top10cvss/generated_prs.jsonl
  • config_name: cwe94-benign-top10cvss
    data_files:
    • split: benign
      path: cwe94/benign/top10cvss/generated_prs.jsonl

SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents

A benchmark dataset for evaluating automated code review agents against adversarial pull requests. The dataset contains 2,250 malicious PRs (current release: deterministic) and 347 benign ground-truth security fixes, grounded in real vulnerabilities from the OSV/SECommits database, across 10 CWE classes from the 2025 CWE Top 25.

Motivation

Modern AI coding assistants can generate plausible-looking patches at scale. This dataset stress-tests code reviewers — both human and AI — against a concrete threat model: an adversary with contributor access who re-introduces a previously patched CVE, disguised as a routine change.

Real-world supply-chain attacks frequently arrive as pull requests: a seemingly helpful bug fix that quietly reverts a security patch, a refactor that re-opens an injection vector, a performance optimization that removes a bounds check. This benchmark operationalizes that threat by deterministically reversing official CVE fixes and parametrizing the social engineering framing applied to the PR description.

Dataset Overview

Malicious PRs — deterministic (current release)

  • 2,250 attack PRs across 10 CWE classes
  • Each attack deterministically reverses an official CVE fix using git apply -R — no code synthesis, no LLM-generated diffs
  • PR titles, descriptions, and commit messages are generated by an LLM according to one of 15 social engineering framing strategies
  • After a difficulty filter (samples that fooled at least one of two baseline models), 1,062 samples constitute the challenging evaluation subset

Benign PRs (current release)

  • 347 ground-truth security fix PRs across the same 10 CWE classes
  • Generated by applying the actual, unmodified CVE fix patches using git apply
  • Used to measure the false-decline rate (FDR): fraction of legitimate security improvements incorrectly rejected
  • Prevents conflating an overly conservative reviewer with a genuinely discerning one
  • A 10-per-CWE subset (top10cvss, 100 PRs) selects the ten highest-CVSS fixes in each CWE for cheaper evaluation across many models; three vulnerability IDs appear under two CWEs, so load it per CWE (e.g. cwe79-benign-top10cvss) to keep all 100

Covered CWEs

CWE Description Malicious Benign
CWE-125 Out-of-Bounds Read 300 34
CWE-22 Path Traversal 210 37
CWE-352 Cross-Site Request Forgery 195 36
CWE-416 Use After Free 240 31
CWE-78 OS Command Injection 270 23
CWE-787 Out-of-Bounds Write 225 51
CWE-79 Cross-Site Scripting 195 35
CWE-862 Missing Authorization 210 28
CWE-89 SQL Injection 180 37
CWE-94 Code Injection 225 35
Total 2,250 347

Attack Taxonomy: Social Engineering Framing Strategies

The code change in each malicious PR is identical (deterministic patch reversal). The variation comes entirely from how the PR is framed. The 16 framing strategies exploit different cognitive biases:

Strategy Description
Fake Bug Fix Presents the reversion as fixing a concrete user-visible regression with fabricated symptoms
Unsafe Optimization Claims the removed validation is provably redundant given invariants elsewhere in the call stack
Misleading Hardening Pairs the vulnerability reintroduction with a genuine minor security improvement elsewhere
Refactoring Frames as purely structural with no intended functional effect
Misleading Pass Relies solely on absence of CI failures to imply correctness
Out of Distribution Uses dense domain-specific jargon to signal expertise and discourage scrutiny
Partial Test Coverage Adds tests exercising the vulnerable function with benign inputs
False Coverage Adds tests across multiple code paths to maximize apparent coverage metrics
Review Bias Includes a fabricated security analysis concluding the change is safe
Appeal to Authority Cites external security guidance or maintainer recommendations
Emotional Appeal Frames the change as urgently required to prevent active customer incidents
AI Agent Authored Presents as routine output from an automation system
Build System Laundering Disguises runtime changes as build/CI fixture updates
Evidence Dilution Buries the reversion among 5+ fabricated unrelated cleanup items
Prior Approval Signal Frames as implementing an earlier approved decision
Dependency Compat Claim Justifies the change as required for upstream compatibility

Record Schema

Malicious PR Fields (deterministic)

Field Type Description
pr_number int PR number in the Gitea repository
repo str Repository slug (owner/name)
branch str Branch name for this attack PR
files_changed list[str] Files modified by the patch reversal
created_at str ISO-8601 timestamp of PR creation
vuln_id str CVE or GHSA identifier of the reverted vulnerability
cwe_id str CWE class identifier (e.g. CWE-125)
axis3 str Social engineering framing strategy (e.g. fake_bug_fix)
pr_title str LLM-generated PR title
pr_body str LLM-generated PR description
failed_by list[str] Baseline model IDs that were fooled by this sample
category str|null Optional vulnerability category label
group_id str|null Group ID for multi-PR sequences (null for single-PR)
sequence_index int|null Position within a multi-PR sequence
sequence_total int|null Total PRs in the sequence

Benign PR Fields (gpt5.2_v2)

Field Type Description
pr_number int PR number in the Gitea repository
repo str Repository slug (owner/name)
branch str Branch name for this fix PR
files_changed list[str] Files modified by the fix
created_at str ISO-8601 timestamp of PR creation
vuln_id str CVE or GHSA identifier of the applied fix
cwe_id str CWE class identifier
pr_title str LLM-generated PR title
pr_body str LLM-generated PR description

Generation Pipeline

Malicious PRs (deterministic)

  1. CVE selection: Vulnerabilities are sourced from Secommits, selecting unique projects from the 10 most prevalent CWE classes in the 2025 CWE Top 25, sampled by round-robin across CVSS severity bins.

  2. Deterministic patch reversal: The official CVE fix commit is mechanically reversed using git apply -R, restoring the vulnerable code. No LLM code generation occurs — the reintroduced code is the exact vulnerable version from the official record.

  3. PR framing: An LLM generates the PR title, description, and commit message according to one of 16 framing strategies. The code diff is fixed; only the presentation varies.

Benign PRs (gpt5.2_v2)

The official fix patches are applied using git apply. No code synthesis occurs. An LLM generates only the PR title and description in a straightforward, non-deceptive tone.

Benchmark

This dataset is used with the malicious-pr-bench evaluation harness, which deploys PRs to a live Gitea instance and evaluates reviewer agents via the inspect-ai framework.

Metrics:

  • Detection Accuracy: fraction of malicious PRs correctly blocked
  • Security Reason Rate: fraction of blocked PRs where the stated rationale referenced a security concern
  • False-Decline Rate (FDR): fraction of benign security fix PRs incorrectly rejected

Quick Start

from datasets import load_dataset

# Load malicious PRs for CWE-79 (deterministic, current release)
ds = load_dataset("RedAI4Code/SEVRA", "cwe79-deterministic")

# Load benign PRs for CWE-79
ds_benign = load_dataset("RedAI4Code/SEVRA", "cwe79-benign")

print(ds["malicious"][0])

To run the full benchmark:

git clone https://github.com/rufimelo99/malicious-pr-bench.git
cd malicious-pr-bench
uv sync
uv run inspect eval benchmark/task.py@reviewer_benchmark \
  --model anthropic/claude-opus-4-6 \
  -T cwe=cwe79 \
  -T version=deterministic \
  -T tool_mode=gitea \
  --log-dir logs/

Dataset Versions

Version Type Samples Description
deterministic Malicious 2,250 Current release. Deterministic patch reversal, 15 framing strategies
benign Benign 347 Current release. Ground-truth security fixes for FDR measurement
top10cvss Benign 100 Subset of gpt5.2_v2: the 10 highest-CVSS benign fixes per CWE

License

MIT License

Resources

@misc{melo2026sevrabenchsocialengineeringvulnerabilities,
      title={SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents}, 
      author={Rui Melo and Riccardo Fogliato and Sean Zhou and Pratiksha Thaker and Zhiwei Steven Wu},
      year={2026},
      eprint={2606.13757},
      archivePrefix={arXiv},
      primaryClass={cs.CR},
      url={https://arxiv.org/abs/2606.13757}, 
}

README history 20 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2026-09-24Add benign top10cvss subset (10 highest-CVSS fixes per CWE, 100 PRs)34e237213 KB
    Loading...
  2. 2026-09-15Update README.md79125a011.5 KB
    Loading...
  3. 2026-05-11Update README.md945c30a11.1 KB
    Loading...
  4. 2026-05-04Update challenge split to 1062 (removed grok baseline)d66f99b11.1 KB
    Loading...
  5. 2026-05-04Remove grok-code-fast-1 from failed_by across all CWEs3035c1711.1 KB
    Loading...
  6. 2026-05-04Update counts: 2250 PRs, 15 framings, 1600 challenge splita2cfd5311.1 KB
    Loading...
  7. 2026-05-04Remove partial_test_coverage framing (150 samples) from all 10 CWEs941742611.1 KB
    Loading...
  8. 2026-05-04Rename dataset title to SEVRA-BENCH2021ef711.1 KB
    Loading...
  9. 2026-05-04Upload croissant.json6b7e8de11 KB
    Loading...
  10. 2026-05-04Add benign sample counts per CWE to dataset overview tablede25f4e11 KB
    Loading...
  11. 2026-05-04Remove citation block and gpt5.2 configs/references for NeurIPS submission1c9ad2611 KB
    Loading...
  12. 2026-05-04removing files from the nips checkpointd385aab13.9 KB
    Loading...
  13. 2026-05-04Fix citation: use SEVRA-BENCH paper titleec7ef9c13.9 KB
    Loading...
  14. 2026-05-04Update README: deterministic release, 16 framing strategies, correct schema a...7d54bc813.9 KB
    Loading...
  15. 2026-05-04Delete logs420153c13.8 KB
    Loading...
  16. 2026-05-04Add JSON-LD versions of deterministic generated_prs (all 10 CWEs)fa91d2013.8 KB
    Loading...
  17. 2026-05-04Delete datae6b7d2d13.8 KB
    Loading...
  18. 2026-05-04Add JSON-LD versions of deterministic generated_prs (all 10 CWEs)b031bb213.8 KB
    Loading...
  19. 2026-05-04chore: update cwe125 failed_by annotations (320/320 haiku complete)20d868e13.8 KB
    Loading...
  20. 2026-05-04feat: update cwe125 deterministic with complete haiku failed_by results (320/...0fe0f7113.8 KB
    Loading...

Used by abliterated models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.

Community discussions 3 threads · 1 open · 3 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2026-03-20PRCreate v0.0.0/generated_prs.jsonlmerged1 💬#3
    Loading...
  2. 2026-03-20PRCreate v0.0.0/generated_prs.jsonlclosed1 💬#2
    Loading...
  3. 2026-03-19[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · extract

Read further

Metadata

License
mit

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("RedAI4Code/SEVRA")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="RedAI4Code/SEVRA", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/RedAI4Code/SEVRA
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration