Commit 0ad9bf4
committed
fix: address review findings from 5 agents (18 items)
Pre-reviewed by 5 agents, 18 findings addressed:
Security (Critical):
- XML-escape all interpolated values in LLM prompt (prevent tag injection)
- Strip action_type/tool_name through InformationStripper before LLM
- Pass stripped description (not raw verdict.reason) to uncertainty checker
- Extend control-char regex to cover Unicode bidi overrides
Correctness (Major):
- Remove MemoryError/RecursionError re-raise inside TaskGroup (prevents
ExceptionGroup propagation)
- Clamp confidence score to max 1.0 (floating-point edge case)
- Filter empty/None provider responses from similarity computation
- Add uncertainty_check_error sentinel to metadata on failure
- Fix auto_reject_blocked=False path (was always auto-rejecting)
- Change _parse_response param from object to CompletionResponse
- Change _run_safety_classifier return type to bool (clearer contract)
Frontend:
- Replace IIFEs with precomputed variables (ESLint React Compiler rule)
- Add NaN guard for parseFloat on confidence scores
- Remove misleading 'Show original' toggle (description IS stripped)
Tests:
- Add factory wiring tests for SafetyClassifier/UncertaintyChecker
- Add auto_reject_blocked=False test
- Fix timeout test: asyncio.Event().wait() instead of sleep(100)1 parent 65814e6 commit 0ad9bf4
8 files changed
Lines changed: 314 additions & 94 deletions
File tree
- src/synthorg/security
- tests/unit
- engine
- security
- web/src/pages/approvals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
84 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| |||
374 | 389 | | |
375 | 390 | | |
376 | 391 | | |
377 | | - | |
| 392 | + | |
378 | 393 | | |
379 | 394 | | |
380 | 395 | | |
| |||
406 | 421 | | |
407 | 422 | | |
408 | 423 | | |
409 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
410 | 434 | | |
411 | 435 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
416 | 440 | | |
417 | 441 | | |
418 | 442 | | |
| |||
427 | 451 | | |
428 | 452 | | |
429 | 453 | | |
430 | | - | |
| 454 | + | |
431 | 455 | | |
432 | 456 | | |
433 | 457 | | |
434 | 458 | | |
435 | 459 | | |
436 | 460 | | |
437 | | - | |
| 461 | + | |
438 | 462 | | |
439 | 463 | | |
440 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
564 | 567 | | |
565 | 568 | | |
566 | 569 | | |
567 | | - | |
| 570 | + | |
568 | 571 | | |
569 | 572 | | |
570 | 573 | | |
571 | 574 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
588 | 589 | | |
589 | 590 | | |
| 591 | + | |
| 592 | + | |
590 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
591 | 598 | | |
592 | | - | |
| 599 | + | |
593 | 600 | | |
594 | 601 | | |
595 | 602 | | |
| |||
637 | 644 | | |
638 | 645 | | |
639 | 646 | | |
640 | | - | |
| 647 | + | |
641 | 648 | | |
642 | 649 | | |
643 | | - | |
644 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
645 | 655 | | |
646 | 656 | | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 657 | | |
652 | 658 | | |
653 | 659 | | |
| |||
658 | 664 | | |
659 | 665 | | |
660 | 666 | | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
670 | 677 | | |
671 | 678 | | |
672 | 679 | | |
| |||
675 | 682 | | |
676 | 683 | | |
677 | 684 | | |
678 | | - | |
679 | | - | |
680 | | - | |
| 685 | + | |
681 | 686 | | |
682 | 687 | | |
683 | 688 | | |
684 | | - | |
| 689 | + | |
685 | 690 | | |
686 | 691 | | |
687 | 692 | | |
688 | 693 | | |
689 | 694 | | |
690 | | - | |
| 695 | + | |
691 | 696 | | |
692 | 697 | | |
693 | 698 | | |
| |||
703 | 708 | | |
704 | 709 | | |
705 | 710 | | |
| 711 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
| |||
366 | 373 | | |
367 | 374 | | |
368 | 375 | | |
369 | | - | |
370 | | - | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
| |||
376 | 381 | | |
377 | 382 | | |
378 | 383 | | |
379 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
380 | 396 | | |
381 | 397 | | |
382 | 398 | | |
| |||
0 commit comments