simpleaudit 0.2.3__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. {simpleaudit-0.2.3/simpleaudit.egg-info → simpleaudit-0.3.1}/PKG-INFO +23 -17
  2. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/README.md +10 -10
  3. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/pyproject.toml +20 -7
  4. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/__init__.py +22 -0
  5. simpleaudit-0.3.1/simpleaudit/auditor.py +99 -0
  6. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/experiment.py +16 -0
  7. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/model_auditor.py +120 -11
  8. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/repeated_results.py +63 -6
  9. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/bullshitbench_v1_v2.py +19 -0
  10. simpleaudit-0.3.1/simpleaudit/stats.py +74 -0
  11. simpleaudit-0.3.1/simpleaudit/targets/__init__.py +31 -0
  12. simpleaudit-0.3.1/simpleaudit/targets/base.py +79 -0
  13. simpleaudit-0.3.1/simpleaudit/targets/callable.py +56 -0
  14. simpleaudit-0.3.1/simpleaudit/targets/http.py +150 -0
  15. simpleaudit-0.3.1/simpleaudit/targets/model.py +134 -0
  16. simpleaudit-0.3.1/simpleaudit/tracing/__init__.py +81 -0
  17. simpleaudit-0.3.1/simpleaudit/tracing/auth.py +175 -0
  18. simpleaudit-0.3.1/simpleaudit/tracing/context.py +126 -0
  19. simpleaudit-0.3.1/simpleaudit/tracing/otlp.py +553 -0
  20. simpleaudit-0.3.1/simpleaudit/tracing/provider.py +222 -0
  21. simpleaudit-0.3.1/simpleaudit/tracing/selection.py +166 -0
  22. simpleaudit-0.3.1/simpleaudit/tracing/shared.py +517 -0
  23. simpleaudit-0.3.1/simpleaudit/tracing/store.py +111 -0
  24. {simpleaudit-0.2.3 → simpleaudit-0.3.1/simpleaudit.egg-info}/PKG-INFO +23 -17
  25. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit.egg-info/SOURCES.txt +19 -0
  26. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit.egg-info/requires.txt +8 -1
  27. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_fragility.py +63 -0
  28. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_repeated_experiments.py +48 -0
  29. simpleaudit-0.3.1/tests/test_stats.py +91 -0
  30. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_target_api_key.py +17 -5
  31. simpleaudit-0.3.1/tests/test_targets.py +326 -0
  32. simpleaudit-0.3.1/tests/test_tracing.py +813 -0
  33. simpleaudit-0.3.1/tests/test_tracing_auth.py +213 -0
  34. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/LICENSE +0 -0
  35. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/setup.cfg +0 -0
  36. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/checklist.py +0 -0
  37. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/cli.py +0 -0
  38. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/context_marks.py +0 -0
  39. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/cross_judge.py +0 -0
  40. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/__init__.py +0 -0
  41. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/abstention.py +0 -0
  42. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/binary_abstention.py +0 -0
  43. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/checklist.py +0 -0
  44. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/compose.py +0 -0
  45. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/default.py +0 -0
  46. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/factuality.py +0 -0
  47. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/harm.py +0 -0
  48. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/helpfulness.py +0 -0
  49. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/helsedir_sexhealth_no.py +0 -0
  50. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/helsedir_sexhealth_no_rag.py +0 -0
  51. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/judges/safety.py +0 -0
  52. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/perturbations.py +0 -0
  53. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/reframing.py +0 -0
  54. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/results.py +0 -0
  55. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/__init__.py +0 -0
  56. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/arbeidstilsynet_arbeidstid.py +0 -0
  57. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/bullshitbench_health.py +0 -0
  58. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/health.py +0 -0
  59. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/hei_refusal.py +0 -0
  60. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/helfo.py +0 -0
  61. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/helpmed.py +0 -0
  62. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/human_rights_education.py +0 -0
  63. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/human_rights_fair_trial.py +0 -0
  64. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/human_rights_water.py +0 -0
  65. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/blank_chart.png +0 -0
  66. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/illegible_label.png +0 -0
  67. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/injection.png +0 -0
  68. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/make_images.py +0 -0
  69. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/product_a.png +0 -0
  70. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/product_b.png +0 -0
  71. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/quarterly_revenue.png +0 -0
  72. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/images/truncated_axis.png +0 -0
  73. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/lanekassen.py +0 -0
  74. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/nav_aap.py +0 -0
  75. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/nb_kryss_ordning.py +0 -0
  76. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/rag.py +0 -0
  77. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/safety.py +0 -0
  78. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/skatteetaten.py +0 -0
  79. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/skatteetaten_legitimasjon.py +0 -0
  80. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/system_prompt.py +0 -0
  81. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/toll_reisegodskvote.py +0 -0
  82. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/ung.py +0 -0
  83. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/scenarios/vision_integrity.py +0 -0
  84. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/spans.py +0 -0
  85. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/utils.py +0 -0
  86. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/visualization/scenario_viewer.html +0 -0
  87. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/visualization/server.py +0 -0
  88. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/visualization/thumbnail.png +0 -0
  89. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit/visualization/visualizer.html +0 -0
  90. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit.egg-info/dependency_links.txt +0 -0
  91. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit.egg-info/entry_points.txt +0 -0
  92. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/simpleaudit.egg-info/top_level.txt +0 -0
  93. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_anthropic_judge_default_path.py +0 -0
  94. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_audit_flow.py +0 -0
  95. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_basic.py +0 -0
  96. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_checklist.py +0 -0
  97. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_checklist_judge.py +0 -0
  98. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_checklist_pipeline.py +0 -0
  99. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_checklist_reframing.py +0 -0
  100. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_cross_judge.py +0 -0
  101. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_custom_prompts.py +0 -0
  102. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_document_expansion.py +0 -0
  103. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_experiment_streaming.py +0 -0
  104. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_fakes.py +0 -0
  105. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_file_uri.py +0 -0
  106. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_generation_params.py +0 -0
  107. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_json_format.py +0 -0
  108. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_compose.py +0 -0
  109. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_notes.py +0 -0
  110. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_output_contract.py +0 -0
  111. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_postprocess.py +0 -0
  112. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_registry.py +0 -0
  113. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_response_schema.py +0 -0
  114. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_judge_robustness_pipeline.py +0 -0
  115. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_model_auditor.py +0 -0
  116. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_perturbations.py +0 -0
  117. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_reframing.py +0 -0
  118. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_rejudge.py +0 -0
  119. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_resumable_experiments.py +0 -0
  120. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_scenario_data.py +0 -0
  121. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_scenario_pack_conventions.py +0 -0
  122. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_spans.py +0 -0
  123. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_strip_thinking.py +0 -0
  124. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_token_counting.py +0 -0
  125. {simpleaudit-0.2.3 → simpleaudit-0.3.1}/tests/test_vision_integrity_pack.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simpleaudit
3
- Version: 0.2.3
3
+ Version: 0.3.1
4
4
  Summary: Lightweight AI Safety Auditing Framework
5
5
  Author: SimpleAudit Contributors
6
6
  License: MIT
7
- Project-URL: Homepage, https://github.com/kelkalot/simpleaudit
8
- Project-URL: Documentation, https://github.com/kelkalot/simpleaudit#readme
9
- Project-URL: Repository, https://github.com/kelkalot/simpleaudit
10
- Project-URL: Issues, https://github.com/kelkalot/simpleaudit/issues
7
+ Project-URL: Homepage, https://github.com/simulamet/simpleaudit
8
+ Project-URL: Documentation, https://github.com/simulamet/simpleaudit#readme
9
+ Project-URL: Repository, https://github.com/simulamet/simpleaudit
10
+ Project-URL: Issues, https://github.com/simulamet/simpleaudit/issues
11
11
  Project-URL: PyPI, https://pypi.org/project/simpleaudit/
12
12
  Keywords: ai,safety,audit,red-team,llm,rag,testing
13
13
  Classifier: Development Status :: 4 - Beta
@@ -19,21 +19,27 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3.13
20
20
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
21
  Classifier: Topic :: Software Development :: Testing
22
- Requires-Python: >=3.11
22
+ Requires-Python: <3.14,>=3.11
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: any-llm-sdk>=1.14.0
26
26
  Requires-Dist: fsspec>=2023.1.0
27
27
  Requires-Dist: tqdm>=4.66.0
28
+ Provides-Extra: tracing
29
+ Requires-Dist: aiohttp>=3.9; extra == "tracing"
30
+ Requires-Dist: grpcio>=1.60; extra == "tracing"
31
+ Requires-Dist: opentelemetry-proto>=1.20; extra == "tracing"
28
32
  Provides-Extra: plot
29
33
  Requires-Dist: matplotlib>=3.5.0; extra == "plot"
30
34
  Provides-Extra: visualize
31
35
  Requires-Dist: fastapi>=0.104.0; extra == "visualize"
32
36
  Requires-Dist: uvicorn[standard]>=0.24.0; extra == "visualize"
33
37
  Provides-Extra: dev
34
- Requires-Dist: pytest>=7.0.0; extra == "dev"
38
+ Requires-Dist: pytest<9,>=8; extra == "dev"
35
39
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
36
40
  Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
41
+ Requires-Dist: pytest-xdist<3.8,>=3.6; extra == "dev"
42
+ Requires-Dist: pytest-testmon<3,>=2; extra == "dev"
37
43
  Requires-Dist: black>=23.0.0; extra == "dev"
38
44
  Requires-Dist: ruff>=0.1.0; extra == "dev"
39
45
  Provides-Extra: all
@@ -42,7 +48,7 @@ Dynamic: license-file
42
48
 
43
49
  <div align="center">
44
50
 
45
- [![DPG Badge](https://img.shields.io/badge/Verified-DPG-3333AB?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMzEiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMSAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjIwMDggMjEuMzY3OEwxMC4xNzM2IDE4LjAxMjRMMTEuNTIxOSAxNi40MDAzTDEzLjk5MjggMTguNDU5TDE5LjYyNjkgMTIuMjExMUwyMS4xOTA5IDEzLjYxNkwxNC4yMDA4IDIxLjM2NzhaTTI0LjYyNDEgOS4zNTEyN0wyNC44MDcxIDMuMDcyOTdMMTguODgxIDUuMTg2NjJMMTUuMzMxNCAtMi4zMzA4MmUtMDVMMTEuNzgyMSA1LjE4NjYyTDUuODU2MDEgMy4wNzI5N0w2LjAzOTA2IDkuMzUxMjdMMCAxMS4xMTc3TDMuODQ1MjEgMTYuMDg5NUwwIDIxLjA2MTJMNi4wMzkwNiAyMi44Mjc3TDUuODU2MDEgMjkuMTA2TDExLjc4MjEgMjYuOTkyM0wxNS4zMzE0IDMyLjE3OUwxOC44ODEgMjYuOTkyM0wyNC44MDcxIDI5LjEwNkwyNC42MjQxIDIyLjgyNzdMMzAuNjYzMSAyMS4wNjEyTDI2LjgxNzYgMTYuMDg5NUwzMC42NjMxIDExLjExNzdMMjQuNjI0MSA5LjM1MTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==)](https://www.digitalpublicgoods.net/r/simpleaudit) [![PyPI version](https://badge.fury.io/py/simpleaudit.svg)](https://pypi.org/project/simpleaudit/) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Release](https://github.com/kelkalot/simpleaudit/actions/workflows/tests.yml/badge.svg)](https://github.com/kelkalot/simpleaudit/actions/workflows/tests.yml) [![Last Commit](https://img.shields.io/github/last-commit/kelkalot/simpleaudit)](https://github.com/kelkalot/simpleaudit/commits/main)
51
+ [![DPG Badge](https://img.shields.io/badge/Verified-DPG-3333AB?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMzEiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMSAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjIwMDggMjEuMzY3OEwxMC4xNzM2IDE4LjAxMjRMMTEuNTIxOSAxNi40MDAzTDEzLjk5MjggMTguNDU5TDE5LjYyNjkgMTIuMjExMUwyMS4xOTA5IDEzLjYxNkwxNC4yMDA4IDIxLjM2NzhaTTI0LjYyNDEgOS4zNTEyN0wyNC44MDcxIDMuMDcyOTdMMTguODgxIDUuMTg2NjJMMTUuMzMxNCAtMi4zMzA4MmUtMDVMMTEuNzgyMSA1LjE4NjYyTDUuODU2MDEgMy4wNzI5N0w2LjAzOTA2IDkuMzUxMjdMMCAxMS4xMTc3TDMuODQ1MjEgMTYuMDg5NUwwIDIxLjA2MTJMNi4wMzkwNiAyMi44Mjc3TDUuODU2MDEgMjkuMTA2TDExLjc4MjEgMjYuOTkyM0wxNS4zMzE0IDMyLjE3OUwxOC44ODEgMjYuOTkyM0wyNC44MDcxIDI5LjEwNkwyNC42MjQxIDIyLjgyNzdMMzAuNjYzMSAyMS4wNjEyTDI2LjgxNzYgMTYuMDg5NUwzMC42NjMxIDExLjExNzdMMjQuNjI0MSA5LjM1MTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==)](https://www.digitalpublicgoods.net/r/simpleaudit) [![PyPI version](https://badge.fury.io/py/simpleaudit.svg)](https://pypi.org/project/simpleaudit/) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Release](https://github.com/simulamet/simpleaudit/actions/workflows/tests.yml/badge.svg)](https://github.com/simulamet/simpleaudit/actions/workflows/tests.yml) [![Last Commit](https://img.shields.io/github/last-commit/simulamet/simpleaudit)](https://github.com/simulamet/simpleaudit/commits/main)
46
52
 
47
53
  <img width="300px" alt="simpleaudit-logo" src="https://github.com/user-attachments/assets/2ed38ae0-f834-4934-bcc4-48fe441b8b2b" />
48
54
 
@@ -58,7 +64,7 @@ Developed by [Simula](https://www.simula.no/) and [SimulaMet](https://www.simula
58
64
  SimpleAudit is a simple, extensible, local-first framework for multilingual auditing and red-teaming of AI systems via adversarial probing. It supports open models running locally (no APIs required) and can optionally run evaluations against API-hosted models. SimpleAudit does not collect or transmit user data by default and is designed for minimal setup.
59
65
  </div>
60
66
 
61
- See the [standards and best practices for creating custom test scenarios](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/scenarios/simpleaudit_scenario_guidelines_v1.0.md).
67
+ See the [standards and best practices for creating custom test scenarios](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/scenarios/simpleaudit_scenario_guidelines_v1.0.md).
62
68
 
63
69
  <img alt="simpleaudit_example_gemma_model" src="https://github.com/user-attachments/assets/05c45a62-74e7-4aa3-a3cd-41bad0cc8233" />
64
70
 
@@ -114,7 +120,7 @@ pip install -U simpleaudit[plot]
114
120
  **Install from GitHub** (for latest development features):
115
121
 
116
122
  ```bash
117
- pip install -U git+https://github.com/kelkalot/simpleaudit.git
123
+ pip install -U git+https://github.com/simulamet/simpleaudit.git
118
124
  ```
119
125
 
120
126
  ## Quick Start
@@ -169,7 +175,7 @@ pip install 'simpleaudit[visualize]'
169
175
  simpleaudit serve --results_dir ./my_audit_results
170
176
  ```
171
177
  This will spin-up a local web server to explore results with scenario details. 👉 [Check for live demo.](https://simulamet-simpleauditvisualization.hf.space)
172
- See [visualization/README.md](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/visualization/README.md) for more options and features.
178
+ See [visualization/README.md](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/visualization/README.md) for more options and features.
173
179
 
174
180
  To share results as a single self-contained HTML file (no server, no JSON upload), use `simpleaudit export-html ./audit_results.json` or the **Download HTML** button in the visualizer.
175
181
 
@@ -182,7 +188,7 @@ If the command fails:
182
188
  - **Weird import/module error** — stale cache. Run `uv cache clean` and retry.
183
189
  </Troubleshooting>
184
190
 
185
- [![simpleaudit-visualization-ui](https://github.com/user-attachments/assets/f9bbb891-a847-48d4-85d6-6d6d99c9e017)](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/visualization/README.md)
191
+ [![simpleaudit-visualization-ui](https://github.com/user-attachments/assets/f9bbb891-a847-48d4-85d6-6d6d99c9e017)](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/visualization/README.md)
186
192
 
187
193
  ### Running Experiments
188
194
 
@@ -1144,7 +1150,7 @@ Contributions welcome! Areas of interest:
1144
1150
  - More target adapters
1145
1151
  - Documentation improvements
1146
1152
 
1147
- Don't hesitate to contact us or [open issues](https://github.com/kelkalot/simpleaudit/issues) if you have questions, feedback, or encounter any problems.
1153
+ Don't hesitate to contact us or [open issues](https://github.com/simulamet/simpleaudit/issues) if you have questions, feedback, or encounter any problems.
1148
1154
 
1149
1155
  ## Main Contributors
1150
1156
  [Michael A. Riegler](https://www.simula.no/people/michael) (Simula) \
@@ -1184,10 +1190,10 @@ If you use SimpleAudit in research or procurement, please cite the methodology p
1184
1190
 
1185
1191
  ## Governance & Compliance
1186
1192
 
1187
- - 📋 [Digital Public Good Compliance](https://github.com/kelkalot/simpleaudit/blob/main/DPG.md) — SDG alignment, ownership, standards
1188
- - 🤝 [Code of Conduct](https://github.com/kelkalot/simpleaudit/blob/main/CODE_OF_CONDUCT.md) — Community guidelines and responsible use
1189
- - 🔒 [Security Policy](https://github.com/kelkalot/simpleaudit/blob/main/SECURITY.md) — Vulnerability reporting and security considerations
1193
+ - 📋 [Digital Public Good Compliance](https://github.com/simulamet/simpleaudit/blob/main/DPG.md) — SDG alignment, ownership, standards
1194
+ - 🤝 [Code of Conduct](https://github.com/simulamet/simpleaudit/blob/main/CODE_OF_CONDUCT.md) — Community guidelines and responsible use
1195
+ - 🔒 [Security Policy](https://github.com/simulamet/simpleaudit/blob/main/SECURITY.md) — Vulnerability reporting and security considerations
1190
1196
 
1191
1197
  ## License
1192
1198
 
1193
- MIT License - see [LICENSE](https://github.com/kelkalot/simpleaudit/blob/main/LICENSE) for details.
1199
+ MIT License - see [LICENSE](https://github.com/simulamet/simpleaudit/blob/main/LICENSE) for details.
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- [![DPG Badge](https://img.shields.io/badge/Verified-DPG-3333AB?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMzEiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMSAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjIwMDggMjEuMzY3OEwxMC4xNzM2IDE4LjAxMjRMMTEuNTIxOSAxNi40MDAzTDEzLjk5MjggMTguNDU5TDE5LjYyNjkgMTIuMjExMUwyMS4xOTA5IDEzLjYxNkwxNC4yMDA4IDIxLjM2NzhaTTI0LjYyNDEgOS4zNTEyN0wyNC44MDcxIDMuMDcyOTdMMTguODgxIDUuMTg2NjJMMTUuMzMxNCAtMi4zMzA4MmUtMDVMMTEuNzgyMSA1LjE4NjYyTDUuODU2MDEgMy4wNzI5N0w2LjAzOTA2IDkuMzUxMjdMMCAxMS4xMTc3TDMuODQ1MjEgMTYuMDg5NUwwIDIxLjA2MTJMNi4wMzkwNiAyMi44Mjc3TDUuODU2MDEgMjkuMTA2TDExLjc4MjEgMjYuOTkyM0wxNS4zMzE0IDMyLjE3OUwxOC44ODEgMjYuOTkyM0wyNC44MDcxIDI5LjEwNkwyNC42MjQxIDIyLjgyNzdMMzAuNjYzMSAyMS4wNjEyTDI2LjgxNzYgMTYuMDg5NUwzMC42NjMxIDExLjExNzdMMjQuNjI0MSA5LjM1MTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==)](https://www.digitalpublicgoods.net/r/simpleaudit) [![PyPI version](https://badge.fury.io/py/simpleaudit.svg)](https://pypi.org/project/simpleaudit/) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Release](https://github.com/kelkalot/simpleaudit/actions/workflows/tests.yml/badge.svg)](https://github.com/kelkalot/simpleaudit/actions/workflows/tests.yml) [![Last Commit](https://img.shields.io/github/last-commit/kelkalot/simpleaudit)](https://github.com/kelkalot/simpleaudit/commits/main)
3
+ [![DPG Badge](https://img.shields.io/badge/Verified-DPG-3333AB?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMzEiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMSAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjIwMDggMjEuMzY3OEwxMC4xNzM2IDE4LjAxMjRMMTEuNTIxOSAxNi40MDAzTDEzLjk5MjggMTguNDU5TDE5LjYyNjkgMTIuMjExMUwyMS4xOTA5IDEzLjYxNkwxNC4yMDA4IDIxLjM2NzhaTTI0LjYyNDEgOS4zNTEyN0wyNC44MDcxIDMuMDcyOTdMMTguODgxIDUuMTg2NjJMMTUuMzMxNCAtMi4zMzA4MmUtMDVMMTEuNzgyMSA1LjE4NjYyTDUuODU2MDEgMy4wNzI5N0w2LjAzOTA2IDkuMzUxMjdMMCAxMS4xMTc3TDMuODQ1MjEgMTYuMDg5NUwwIDIxLjA2MTJMNi4wMzkwNiAyMi44Mjc3TDUuODU2MDEgMjkuMTA2TDExLjc4MjEgMjYuOTkyM0wxNS4zMzE0IDMyLjE3OUwxOC44ODEgMjYuOTkyM0wyNC44MDcxIDI5LjEwNkwyNC42MjQxIDIyLjgyNzdMMzAuNjYzMSAyMS4wNjEyTDI2LjgxNzYgMTYuMDg5NUwzMC42NjMxIDExLjExNzdMMjQuNjI0MSA5LjM1MTI3WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==)](https://www.digitalpublicgoods.net/r/simpleaudit) [![PyPI version](https://badge.fury.io/py/simpleaudit.svg)](https://pypi.org/project/simpleaudit/) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Release](https://github.com/simulamet/simpleaudit/actions/workflows/tests.yml/badge.svg)](https://github.com/simulamet/simpleaudit/actions/workflows/tests.yml) [![Last Commit](https://img.shields.io/github/last-commit/simulamet/simpleaudit)](https://github.com/simulamet/simpleaudit/commits/main)
4
4
 
5
5
  <img width="300px" alt="simpleaudit-logo" src="https://github.com/user-attachments/assets/2ed38ae0-f834-4934-bcc4-48fe441b8b2b" />
6
6
 
@@ -16,7 +16,7 @@ Developed by [Simula](https://www.simula.no/) and [SimulaMet](https://www.simula
16
16
  SimpleAudit is a simple, extensible, local-first framework for multilingual auditing and red-teaming of AI systems via adversarial probing. It supports open models running locally (no APIs required) and can optionally run evaluations against API-hosted models. SimpleAudit does not collect or transmit user data by default and is designed for minimal setup.
17
17
  </div>
18
18
 
19
- See the [standards and best practices for creating custom test scenarios](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/scenarios/simpleaudit_scenario_guidelines_v1.0.md).
19
+ See the [standards and best practices for creating custom test scenarios](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/scenarios/simpleaudit_scenario_guidelines_v1.0.md).
20
20
 
21
21
  <img alt="simpleaudit_example_gemma_model" src="https://github.com/user-attachments/assets/05c45a62-74e7-4aa3-a3cd-41bad0cc8233" />
22
22
 
@@ -72,7 +72,7 @@ pip install -U simpleaudit[plot]
72
72
  **Install from GitHub** (for latest development features):
73
73
 
74
74
  ```bash
75
- pip install -U git+https://github.com/kelkalot/simpleaudit.git
75
+ pip install -U git+https://github.com/simulamet/simpleaudit.git
76
76
  ```
77
77
 
78
78
  ## Quick Start
@@ -127,7 +127,7 @@ pip install 'simpleaudit[visualize]'
127
127
  simpleaudit serve --results_dir ./my_audit_results
128
128
  ```
129
129
  This will spin-up a local web server to explore results with scenario details. 👉 [Check for live demo.](https://simulamet-simpleauditvisualization.hf.space)
130
- See [visualization/README.md](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/visualization/README.md) for more options and features.
130
+ See [visualization/README.md](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/visualization/README.md) for more options and features.
131
131
 
132
132
  To share results as a single self-contained HTML file (no server, no JSON upload), use `simpleaudit export-html ./audit_results.json` or the **Download HTML** button in the visualizer.
133
133
 
@@ -140,7 +140,7 @@ If the command fails:
140
140
  - **Weird import/module error** — stale cache. Run `uv cache clean` and retry.
141
141
  </Troubleshooting>
142
142
 
143
- [![simpleaudit-visualization-ui](https://github.com/user-attachments/assets/f9bbb891-a847-48d4-85d6-6d6d99c9e017)](https://github.com/kelkalot/simpleaudit/blob/main/simpleaudit/visualization/README.md)
143
+ [![simpleaudit-visualization-ui](https://github.com/user-attachments/assets/f9bbb891-a847-48d4-85d6-6d6d99c9e017)](https://github.com/simulamet/simpleaudit/blob/main/simpleaudit/visualization/README.md)
144
144
 
145
145
  ### Running Experiments
146
146
 
@@ -1102,7 +1102,7 @@ Contributions welcome! Areas of interest:
1102
1102
  - More target adapters
1103
1103
  - Documentation improvements
1104
1104
 
1105
- Don't hesitate to contact us or [open issues](https://github.com/kelkalot/simpleaudit/issues) if you have questions, feedback, or encounter any problems.
1105
+ Don't hesitate to contact us or [open issues](https://github.com/simulamet/simpleaudit/issues) if you have questions, feedback, or encounter any problems.
1106
1106
 
1107
1107
  ## Main Contributors
1108
1108
  [Michael A. Riegler](https://www.simula.no/people/michael) (Simula) \
@@ -1142,10 +1142,10 @@ If you use SimpleAudit in research or procurement, please cite the methodology p
1142
1142
 
1143
1143
  ## Governance & Compliance
1144
1144
 
1145
- - 📋 [Digital Public Good Compliance](https://github.com/kelkalot/simpleaudit/blob/main/DPG.md) — SDG alignment, ownership, standards
1146
- - 🤝 [Code of Conduct](https://github.com/kelkalot/simpleaudit/blob/main/CODE_OF_CONDUCT.md) — Community guidelines and responsible use
1147
- - 🔒 [Security Policy](https://github.com/kelkalot/simpleaudit/blob/main/SECURITY.md) — Vulnerability reporting and security considerations
1145
+ - 📋 [Digital Public Good Compliance](https://github.com/simulamet/simpleaudit/blob/main/DPG.md) — SDG alignment, ownership, standards
1146
+ - 🤝 [Code of Conduct](https://github.com/simulamet/simpleaudit/blob/main/CODE_OF_CONDUCT.md) — Community guidelines and responsible use
1147
+ - 🔒 [Security Policy](https://github.com/simulamet/simpleaudit/blob/main/SECURITY.md) — Vulnerability reporting and security considerations
1148
1148
 
1149
1149
  ## License
1150
1150
 
1151
- MIT License - see [LICENSE](https://github.com/kelkalot/simpleaudit/blob/main/LICENSE) for details.
1151
+ MIT License - see [LICENSE](https://github.com/simulamet/simpleaudit/blob/main/LICENSE) for details.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simpleaudit"
7
- version = "0.2.3"
7
+ version = "0.3.1"
8
8
  description = "Lightweight AI Safety Auditing Framework"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -23,7 +23,7 @@ classifiers = [
23
23
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
24
  "Topic :: Software Development :: Testing",
25
25
  ]
26
- requires-python = ">=3.11"
26
+ requires-python = ">=3.11,<3.14"
27
27
  dependencies = [
28
28
  "any-llm-sdk>=1.14.0",
29
29
  "fsspec>=2023.1.0",
@@ -34,25 +34,38 @@ dependencies = [
34
34
  simpleaudit = "simpleaudit.cli:main"
35
35
 
36
36
  [project.optional-dependencies]
37
+ # OTLP trace ingestion (simpleaudit.tracing). The core audit engine works with
38
+ # no tracing; install this extra to run the builtin OTLP receiver (HTTP-JSON
39
+ # and gRPC) that captures spans from instrumented targets.
40
+ tracing = [
41
+ "aiohttp>=3.9",
42
+ "grpcio>=1.60",
43
+ "opentelemetry-proto>=1.20",
44
+ ]
37
45
  plot = ["matplotlib>=3.5.0"]
38
46
  visualize = [
39
47
  "fastapi>=0.104.0",
40
48
  "uvicorn[standard]>=0.24.0",
41
49
  ]
42
50
  dev = [
43
- "pytest>=7.0.0",
51
+ # pytest is pinned <9 because pytest-testmon 2.x is not yet compatible with
52
+ # pytest 9 (same pin as Studio).
53
+ "pytest>=8,<9",
44
54
  "pytest-asyncio>=0.21.0",
45
55
  "pytest-cov>=4.0.0",
56
+ # xdist is pinned <3.8 because 3.8+ pulls in `greenlet` (same pin as Studio).
57
+ "pytest-xdist>=3.6,<3.8",
58
+ "pytest-testmon>=2,<3",
46
59
  "black>=23.0.0",
47
60
  "ruff>=0.1.0",
48
61
  ]
49
62
  all = ["simpleaudit[plot,visualize,dev]"]
50
63
 
51
64
  [project.urls]
52
- Homepage = "https://github.com/kelkalot/simpleaudit"
53
- Documentation = "https://github.com/kelkalot/simpleaudit#readme"
54
- Repository = "https://github.com/kelkalot/simpleaudit"
55
- Issues = "https://github.com/kelkalot/simpleaudit/issues"
65
+ Homepage = "https://github.com/simulamet/simpleaudit"
66
+ Documentation = "https://github.com/simulamet/simpleaudit#readme"
67
+ Repository = "https://github.com/simulamet/simpleaudit"
68
+ Issues = "https://github.com/simulamet/simpleaudit/issues"
56
69
  PyPI = "https://pypi.org/project/simpleaudit/"
57
70
 
58
71
  [tool.setuptools.packages.find]
@@ -35,6 +35,15 @@ except PackageNotFoundError:
35
35
  __author__ = "SimpleAudit Contributors"
36
36
 
37
37
  from .model_auditor import ModelAuditor
38
+ from .auditor import Auditor
39
+ from .targets import (
40
+ CallableTarget,
41
+ HTTPAppTarget,
42
+ ModelTarget,
43
+ Target,
44
+ TargetContext,
45
+ TargetResponse,
46
+ )
38
47
  from .results import AuditResults, AuditResult
39
48
  from .scenarios import get_scenarios, list_scenario_packs
40
49
  from .judges import build_judge, customize_judge, get_judge, list_judge_configs
@@ -44,8 +53,10 @@ from .repeated_results import (
44
53
  ModelStabilityReport,
45
54
  RepeatedExperimentResults,
46
55
  ScenarioStats,
56
+ aggregate_severities,
47
57
  )
48
58
  from .cross_judge import CrossJudgeExperiment, CrossJudgeResults, compare_judges
59
+ from .stats import DEFAULT_Z, two_proportion_z, wilson_interval
49
60
  from .reframing import (
50
61
  PanelResults,
51
62
  PanelVerdict,
@@ -75,6 +86,13 @@ from .perturbations import (
75
86
 
76
87
  __all__ = [
77
88
  "ModelAuditor",
89
+ "Auditor",
90
+ "Target",
91
+ "TargetContext",
92
+ "TargetResponse",
93
+ "ModelTarget",
94
+ "HTTPAppTarget",
95
+ "CallableTarget",
78
96
  "AuditResults",
79
97
  "AuditResult",
80
98
  "get_scenarios",
@@ -89,6 +107,10 @@ __all__ = [
89
107
  "ModelStabilityReport",
90
108
  "ScenarioStats",
91
109
  "FRAGILE_THRESHOLD_DEFAULT",
110
+ "aggregate_severities",
111
+ "wilson_interval",
112
+ "two_proportion_z",
113
+ "DEFAULT_Z",
92
114
  "CrossJudgeExperiment",
93
115
  "CrossJudgeResults",
94
116
  "compare_judges",
@@ -0,0 +1,99 @@
1
+ """
2
+ Auditor — the primary, target-agnostic entry point.
3
+
4
+ ``Auditor`` is the long-term primary class. It accepts any :class:`Target`
5
+ (model, HTTP app, callable) and any judge configuration, and delegates to the
6
+ full :class:`ModelAuditor` engine (scenarios, judges, findings, reports).
7
+
8
+ auditor = Auditor(
9
+ target=HTTPAppTarget(url="https://agent.example.com/chat",
10
+ response_path="answer"),
11
+ judge_model="gpt-4o",
12
+ judge_provider="openai",
13
+ )
14
+ results = await auditor.run_async("safety")
15
+
16
+ ``ModelAuditor`` remains available as a backwards-compatible convenience
17
+ wrapper for model-only audits.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ from typing import Any, Optional
23
+
24
+ from .model_auditor import ModelAuditor
25
+ from .targets import Target
26
+
27
+
28
+ class Auditor:
29
+ """Target-agnostic auditor.
30
+
31
+ Parameters
32
+ ----------
33
+ target:
34
+ Any :class:`~simpleaudit.targets.Target`. Required.
35
+ judge_model / judge_provider / judge_api_key / judge_base_url:
36
+ Judge LLM configuration (defaults to OpenAI).
37
+ **kwargs:
38
+ Forwarded to :class:`ModelAuditor` for advanced options (scenarios,
39
+ system_prompt, max_retries, on_turn, etc.).
40
+
41
+ Notes
42
+ -----
43
+ Because the engine's scenario/judge/report machinery lives in
44
+ :class:`ModelAuditor`, ``Auditor`` constructs one and overrides its target.
45
+ The ``model`` / ``provider`` / ``api_key`` / ``base_url`` arguments are
46
+ accepted for compatibility but are ignored when an explicit ``target`` is
47
+ provided (the target already knows how to reach the system under test).
48
+ """
49
+
50
+ def __init__(
51
+ self,
52
+ target: Target,
53
+ *,
54
+ judge_model: str = "gpt-4o",
55
+ judge_provider: str = "openai",
56
+ judge_api_key: Optional[str] = None,
57
+ judge_base_url: Optional[str] = None,
58
+ **kwargs: Any,
59
+ ) -> None:
60
+ if target is None:
61
+ raise ValueError("Auditor requires a target")
62
+
63
+ # Build the underlying engine. Since an explicit target is provided,
64
+ # skip creating the (unused) AnyLLM target client so we don't require
65
+ # an API key / network for a target we will never call.
66
+ ModelAuditor._skip_target_client = True
67
+ try:
68
+ self._engine = ModelAuditor(
69
+ model=kwargs.pop("model", "unused"),
70
+ provider=kwargs.pop("provider", "openai"),
71
+ judge_model=judge_model,
72
+ judge_provider=judge_provider,
73
+ judge_api_key=judge_api_key,
74
+ judge_base_url=judge_base_url,
75
+ **kwargs,
76
+ )
77
+ finally:
78
+ ModelAuditor._skip_target_client = False
79
+ self._engine.set_target(target)
80
+ self._target = target
81
+
82
+ @property
83
+ def target(self) -> Target:
84
+ return self._target
85
+
86
+ @property
87
+ def engine(self) -> ModelAuditor:
88
+ """The underlying :class:`ModelAuditor` engine (advanced access)."""
89
+ return self._engine
90
+
91
+ def __getattr__(self, name: str) -> Any:
92
+ # Delegate everything else (run_async, run, results, etc.) to the engine.
93
+ return getattr(self._engine, name)
94
+
95
+ async def run_async(self, *args: Any, **kwargs: Any) -> Any:
96
+ return await self._engine.run_async(*args, **kwargs)
97
+
98
+ def run(self, *args: Any, **kwargs: Any) -> Any:
99
+ return self._engine.run(*args, **kwargs)
@@ -328,18 +328,25 @@ class AuditExperiment:
328
328
  language: str,
329
329
  max_workers: int,
330
330
  on_turn: Optional[Callable[[int, int, str], None]] = None,
331
+ audit_run_id: Optional[str] = None,
332
+ trace_correlation: Optional[Any] = None,
331
333
  ) -> AuditResults:
332
334
  """Execute one rep with auto-retry on ERROR. Returns the final result."""
333
335
  attempts = 1 + self.max_retries_per_rep
334
336
  result: Optional[AuditResults] = None
335
337
  for attempt in range(attempts):
336
338
  auditor = ModelAuditor(**merged)
339
+ # trace_correlation may be a zero-arg callable (resolved per rep so
340
+ # the caller can swap in a fresh correlation at each rep boundary).
341
+ corr = trace_correlation() if callable(trace_correlation) else trace_correlation
337
342
  result = await auditor.run_async(
338
343
  scenarios,
339
344
  max_turns=max_turns,
340
345
  language=language,
341
346
  max_workers=max_workers,
342
347
  on_turn=on_turn,
348
+ audit_run_id=audit_run_id,
349
+ trace_correlation=corr,
343
350
  )
344
351
  if not any(r.severity == "ERROR" for r in result):
345
352
  break
@@ -360,6 +367,8 @@ class AuditExperiment:
360
367
  max_turns: Optional[int] = None,
361
368
  language: str = "English",
362
369
  on_turn: Optional[Callable[[int, int, str], None]] = None,
370
+ audit_run_id: Optional[str] = None,
371
+ trace_correlation: Optional[Any] = None,
363
372
  ) -> List[AuditResult]:
364
373
  """Run a single scenario N times for one model.
365
374
 
@@ -377,6 +386,11 @@ class AuditExperiment:
377
386
  ``(turn_index, max_turns, role)`` where role is "auditor",
378
387
  "target", or "judge". Called synchronously from within the
379
388
  asyncio event loop.
389
+ audit_run_id: Optional run id propagated to each rep's
390
+ ``run_async`` for trace correlation.
391
+ trace_correlation: Optional :class:`TraceCorrelation` shared
392
+ across reps; each rep records its ``turn_id -> trace_id``
393
+ links so the caller can fetch per-rep trace evidence.
380
394
 
381
395
  Returns:
382
396
  List of :class:`AuditResult`, one per completed rep. May be
@@ -428,6 +442,8 @@ class AuditExperiment:
428
442
  rep_result = await self._run_single_rep(
429
443
  merged, [scenario], max_turns, language, max_workers=1,
430
444
  on_turn=on_turn,
445
+ audit_run_id=audit_run_id,
446
+ trace_correlation=trace_correlation,
431
447
  )
432
448
 
433
449
  # Persist