Commit 0ca7073
Add context support to red_team attack objectives for enhanced evaluation (#42128)
* Initial plan
* Implement context support in red_team attack objectives and evaluation
Co-authored-by: slister1001 <[email protected]>
* Add documentation and examples for red_team context support
Co-authored-by: slister1001 <[email protected]>
* Apply black formatting to red_team files
Co-authored-by: slister1001 <[email protected]>
* Update sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/red_team/_red_team.py
Co-authored-by: Copilot <[email protected]>
* Update sdk/evaluation/azure-ai-evaluation/samples/red_team_samples.py
Co-authored-by: Copilot <[email protected]>
* Add ISA and XPIA risk categories with similar processing to ProtectedMaterial
Co-authored-by: slister1001 <[email protected]>
* Change RiskCategory.ISA to RiskCategory.UngroundedAttributes
Co-authored-by: slister1001 <[email protected]>
* updates
* updates
* small indentation fix
* run code formatter
* updates for callback
* run code formatter
* code formatter
* updates for multiturn and crescendo with context
* small fix for crescendo
* remove _internalriskcategory typehints
* fix code format
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: slister1001 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Sydney Lister <[email protected]>1 parent c4f30f2 commit 0ca7073
File tree
18 files changed
+430
-83
lines changed- sdk/evaluation/azure-ai-evaluation
- azure/ai/evaluation
- _common/onedp/models
- red_team
- _utils
- samples
- data
- tests/unittests/test_redteam
18 files changed
+430
-83
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
1964 | 1966 | | |
1965 | 1967 | | |
1966 | 1968 | | |
1967 | 1969 | | |
1968 | 1970 | | |
1969 | 1971 | | |
| 1972 | + | |
| 1973 | + | |
1970 | 1974 | | |
1971 | 1975 | | |
1972 | 1976 | | |
1973 | 1977 | | |
1974 | 1978 | | |
1975 | 1979 | | |
1976 | 1980 | | |
| 1981 | + | |
1977 | 1982 | | |
1978 | 1983 | | |
1979 | 1984 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
51 | 64 | | |
52 | | - | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| |||
Lines changed: 25 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| 173 | + | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
| |||
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
| |||
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
| 394 | + | |
393 | 395 | | |
394 | 396 | | |
395 | 397 | | |
| |||
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
| |||
423 | 422 | | |
424 | 423 | | |
425 | 424 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 425 | + | |
430 | 426 | | |
431 | 427 | | |
432 | 428 | | |
| |||
438 | 434 | | |
439 | 435 | | |
440 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
| |||
492 | 495 | | |
493 | 496 | | |
494 | 497 | | |
| 498 | + | |
495 | 499 | | |
496 | 500 | | |
497 | 501 | | |
| |||
542 | 546 | | |
543 | 547 | | |
544 | 548 | | |
| 549 | + | |
545 | 550 | | |
546 | 551 | | |
547 | 552 | | |
548 | 553 | | |
549 | 554 | | |
550 | 555 | | |
| 556 | + | |
551 | 557 | | |
552 | 558 | | |
553 | 559 | | |
| |||
577 | 583 | | |
578 | 584 | | |
579 | 585 | | |
| 586 | + | |
580 | 587 | | |
581 | 588 | | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | 589 | | |
586 | 590 | | |
587 | 591 | | |
| |||
594 | 598 | | |
595 | 599 | | |
596 | 600 | | |
| 601 | + | |
597 | 602 | | |
598 | 603 | | |
599 | 604 | | |
| |||
606 | 611 | | |
607 | 612 | | |
608 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
609 | 621 | | |
610 | 622 | | |
611 | 623 | | |
| |||
0 commit comments