Repository navigation
FEAT Add CyberSecEval MITRE dataset loader - #3028
Merged
Roman Lutz (romanlutz) merged 9 commits intoOct 12, 2026
Merged
Roman Lutz (romanlutz) merged 9 commits into
Roman Lutz (romanlutz) merged 9 commits into
Conversation
Add `_CyberSecEvalMitreDataset`, a remote loader for the MITRE benchmark of Meta's CyberSecEval (Purple Llama). It fetches the 1,000 English prompts from a pinned commit of meta-llama/PurpleLlama and emits one SeedPrompt per row, with a `CyberSecEvalMitreCategory` filter for the ten MITRE ATT&CK categories. The prompt value is the upstream `mutated_prompt`, which is what CyberSecEval sends to the model. The ATT&CK category, technique ID, technique name and `base_prompt` are kept in metadata. Closes microsoft#3003
Contributor
Author
|
@microsoft-github-policy-service agree |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
requested changes
Oct 9, 2026
Contributor
Author
|
Thanks for the review, Roman Lutz (@romanlutz)! Both points are addressed:
I also merged the latest |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Oct 12, 2026
Preserve MITRE tactics separately from canonical harms, annotate verified privacy prompts by exact fingerprints, and keep literal benchmark inputs unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
_CyberSecEvalMitreDataset, a remote loader for the English MITRE benchmark of Meta's CyberSecEval (Purple Llama). Closes #3003 and contributes the dataset-loading portion of the broader CyberSecEval parity tracked in #511. This is additive relative to v1.1.0; existing exports are retained.172c1074069eb88ec834124272c1b1c4f8893445. The benchmarks are MIT licensed.mutated_promptverbatim as a literalSeedPrompt, including its wrapper. Preservesbase_prompt,mitre_category,ttp_id, andttp_namein metadata, plus the harm-mapping version. Each seed's source identifies the pinned dataset file.CyberSecEvalMitreCategoryenum filter. Empty filters, empty results, malformed categories/base prompts, and non-string prompt values raise explicit errors. Empty/None prompt values retain the warning-and-skip behavior.asyncio.to_thread.COORDINATION_HARM; C2, Evasion, Execution, Lateral Movement, Persistence, and Privilege Escalation additionally receiveMALWARE. Recon and Discovery are not automatically classified as malware.PPI, 13 carryPROPRIETARY_INFO, with ten overlapping. The complete dataset has 642MALWARErows. Modified/custom prompt text does not inherit an exact-match privacy annotation.defaultbecause it is cybersecurity-specific.These are benchmark capability labels, not ground-truth judgments that every dual-use response is harmful. Upstream tactic/technique metadata is retained even where noisy, including one
TA0043tactic ID. Expansion/judging, false-refusal calibration, multilingual prompts, and a full CyberSecEval execution scenario remain out of scope. Literal prompts need separately authored objectives when adapted to standard attack scenarios; some upstream base prompts contain generation artifacts such as#ERROR!.Tests and Documentation
Added 48 loader tests covering literal values and metadata, all ten tactic mappings, filters, validation, origin, nonblocking fetching, exact-match privacy annotations, changed-text rejection of those annotations, real SQLite persistence/querying, and execution of the documented balanced-selection cell with mocked external I/O.
Updated the paired loading-datasets notebook/Python file, citation, and bibliography. The new example loads into memory, independently samples exactly three prompts per tactic (30 distinct prompts), and explains per-category
AtomicAttack.display_groupreporting. Existing notebook outputs are preserved.Validation performed on the implementation:
uv run --frozen --no-sync python -m pytest tests\unit\datasets\test_cyberseceval_mitre_dataset.py -q: 48 passed.uv run --frozen --no-sync python -m pytest tests\unit\datasets\test_cyberseceval_mitre_dataset.py tests\unit\datasets\test_seed_dataset_provider.py tests\unit\datasets\test_seed_dataset_metadata.py tests\unit\datasets\test_remote_dataset_origin.py tests\unit\models\test_harm_category.py -q: 357 passed, including after main integration.uv run --frozen --no-sync pre-commit run --files pyrit\datasets\seed_datasets\remote\cyberseceval_mitre_dataset.py tests\unit\datasets\test_cyberseceval_mitre_dataset.py doc\code\datasets\1_loading_datasets.py doc\code\datasets\1_loading_datasets.ipynb: passed, including Ruff, documentation hooks, and the full production type check.uv run --frozen --no-sync ty check pyrit\datasets\seed_datasets\remote\cyberseceval_mitre_dataset.py tests\unit\datasets\test_cyberseceval_mitre_dataset.py: passed.uv run --frozen --no-sync python -m build_scripts.validate_docs: passed, 166 references and no orphaned documentation files.uv run --frozen --no-sync jupytext --update --to ipynb doc\code\datasets\1_loading_datasets.py: passed. The new balanced-selection cell was separately executed against the real pinned source in the worktree's uv environment with isolated memory/cache, and its retained output was verified. The entire older notebook was not re-executed.uv run --frozen --no-sync python -: passed. All 42 curated fingerprints resolve to real source rows; all 1,000 literal values remain unchanged; stored/queryable counts areCOORDINATION_HARM=1000,MALWARE=642,PPI=39,PROPRIETARY_INFO=13; all ten sampled groups contain exactly three distinct prompts. Paired cell sources match and original outputs are unchanged.tests\end_to_end\test_all_datasets.py -k CyberSecEvalMitre -qcase, invoked withpytest.mainviauv run --frozen --no-sync python -and an isolated cache: 1 passed, 143 deselected.Latest main has been merged without rebasing or force-pushing. Required current-head CI is being checked before the normal protected squash merge.