|
23 | 23 | "CBT-Bench [@zhang2024cbtbench],\n", |
24 | 24 | "CategoricalHarmfulQA (CatQA) [@bhardwaj2024homer],\n", |
25 | 25 | "CoCoNot [@brahman2024coconot],\n", |
| 26 | + "CyberSecEval [@bhatt2023cyberseceval],\n", |
26 | 27 | "DarkBench [@darkbench2025],\n", |
27 | 28 | "DecodingTrust [@wang2023decodingtrust],\n", |
28 | 29 | "Do Anything Now [@shen2023donotanything],\n", |
|
122 | 123 | " 'coconot_contrast',\n", |
123 | 124 | " 'coconot_refusal',\n", |
124 | 125 | " 'comic_jailbreak',\n", |
| 126 | + " 'cyberseceval_mitre',\n", |
125 | 127 | " 'dangerous_qa',\n", |
126 | 128 | " 'dark_bench',\n", |
127 | 129 | " 'decoding_trust_toxicity',\n", |
|
341 | 343 | "# Memory has flexible querying capabilities\n", |
342 | 344 | "(await memory.get_seeds_async(harm_categories=[\"illegal\"], seed_type=\"objective\"))" |
343 | 345 | ] |
| 346 | + }, |
| 347 | + { |
| 348 | + "cell_type": "markdown", |
| 349 | + "id": "6", |
| 350 | + "metadata": {}, |
| 351 | + "source": [ |
| 352 | + "## CyberSecEval: Separate Tactics from Harms\n", |
| 353 | + "\n", |
| 354 | + "CyberSecEval's ten MITRE categories describe cyberattack tactics, not ten distinct harm categories.\n", |
| 355 | + "The loader preserves them in `metadata[\"mitre_category\"]` alongside the upstream technique ID/name.\n", |
| 356 | + "All prompts receive `COORDINATION_HARM`. C2, Evasion, Execution, Lateral Movement, Persistence and\n", |
| 357 | + "Privilege Escalation also receive `MALWARE`; Recon and Discovery are not automatically malware.\n", |
| 358 | + "Collection and Exfil receive additional malware/privacy labels only for curated, exact prompt\n", |
| 359 | + "matches. The pinned source has 39 `PPI` rows and 13 `PROPRIETARY_INFO` rows, with ten overlapping.\n", |
| 360 | + "Generic file transfer or collection does not by itself imply personal or confidential data.\n", |
| 361 | + "These are capability labels, not ground-truth judgments that every dual-use response is harmful.\n", |
| 362 | + "\n", |
| 363 | + "Load the complete dataset into memory first. The following example independently samples three\n", |
| 364 | + "prompts from each category, rather than sampling thirty globally and accidentally omitting a\n", |
| 365 | + "category. Keep selection in the calling workflow, not in the dataset loader." |
| 366 | + ] |
| 367 | + }, |
| 368 | + { |
| 369 | + "cell_type": "code", |
| 370 | + "execution_count": null, |
| 371 | + "id": "7", |
| 372 | + "metadata": {}, |
| 373 | + "outputs": [ |
| 374 | + { |
| 375 | + "data": { |
| 376 | + "text/plain": [ |
| 377 | + "{'C2': 3,\n", |
| 378 | + " 'Collection': 3,\n", |
| 379 | + " 'Discovery': 3,\n", |
| 380 | + " 'Evasion': 3,\n", |
| 381 | + " 'Execution': 3,\n", |
| 382 | + " 'Exfil': 3,\n", |
| 383 | + " 'Lateral Movement': 3,\n", |
| 384 | + " 'Persistence': 3,\n", |
| 385 | + " 'Privilege Escalation': 3,\n", |
| 386 | + " 'Recon': 3}" |
| 387 | + ] |
| 388 | + }, |
| 389 | + "execution_count": null, |
| 390 | + "metadata": {}, |
| 391 | + "output_type": "execute_result" |
| 392 | + } |
| 393 | + ], |
| 394 | + "source": [ |
| 395 | + "import random\n", |
| 396 | + "\n", |
| 397 | + "from pyrit.datasets.seed_datasets.remote import CyberSecEvalMitreCategory\n", |
| 398 | + "\n", |
| 399 | + "mitre_datasets = await SeedDatasetProvider.fetch_datasets_async(dataset_names=[\"cyberseceval_mitre\"])\n", |
| 400 | + "await memory.add_seed_datasets_to_memory_async(datasets=mitre_datasets, added_by=\"pyrit\")\n", |
| 401 | + "\n", |
| 402 | + "random_generator = random.Random(0)\n", |
| 403 | + "prompts_by_category = {}\n", |
| 404 | + "for category in CyberSecEvalMitreCategory:\n", |
| 405 | + " population = await memory.get_seeds_async(\n", |
| 406 | + " dataset_name=\"cyberseceval_mitre\", metadata={\"mitre_category\": category.value}\n", |
| 407 | + " )\n", |
| 408 | + " population = sorted(population, key=lambda seed: seed.value_sha256 or seed.value)\n", |
| 409 | + " prompts_by_category[category.value] = random_generator.sample(list(population), 3)\n", |
| 410 | + "\n", |
| 411 | + "{category: len(prompts) for category, prompts in prompts_by_category.items()}" |
| 412 | + ] |
| 413 | + }, |
| 414 | + { |
| 415 | + "cell_type": "markdown", |
| 416 | + "id": "8", |
| 417 | + "metadata": {}, |
| 418 | + "source": [ |
| 419 | + "Keep these category groups when executing and reporting. In a custom scenario, construct one\n", |
| 420 | + "`AtomicAttack` per category with `display_group` set to that category; the existing scenario reports\n", |
| 421 | + "then show separate results for Recon, Exfil, Persistence, and the other tactics.\n", |
| 422 | + "Supply authored `SeedObjective` goals when adapting these literal `SeedPrompt` messages to an\n", |
| 423 | + "`AttackSeedGroup`. Do not blindly promote `metadata[\"base_prompt\"]` to an objective: some upstream\n", |
| 424 | + "rows contain generation artifacts such as `#ERROR!`. This loader does not reproduce CyberSecEval's\n", |
| 425 | + "expansion/judge protocol or decide which responses are harmful." |
| 426 | + ] |
344 | 427 | } |
345 | 428 | ], |
346 | 429 | "metadata": { |
| 430 | + "jupytext": { |
| 431 | + "main_language": "python" |
| 432 | + }, |
347 | 433 | "language_info": { |
348 | 434 | "codemirror_mode": { |
349 | 435 | "name": "ipython", |
|
0 commit comments