agenticsafetyeval 0.2.0__py3-none-any.whl

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 (54) hide show
  1. agenticsafetyeval/__init__.py +3 -0
  2. agenticsafetyeval/__main__.py +6 -0
  3. agenticsafetyeval/agents/__init__.py +1 -0
  4. agenticsafetyeval/agents/llm_session.py +157 -0
  5. agenticsafetyeval/agents/session.py +127 -0
  6. agenticsafetyeval/backends/__init__.py +1 -0
  7. agenticsafetyeval/backends/state_provider.py +87 -0
  8. agenticsafetyeval/claims/__init__.py +1 -0
  9. agenticsafetyeval/claims/llm_extractor.py +131 -0
  10. agenticsafetyeval/claims/verifier.py +398 -0
  11. agenticsafetyeval/cli/__init__.py +5 -0
  12. agenticsafetyeval/cli/app.py +63 -0
  13. agenticsafetyeval/cli/certify_cmd.py +50 -0
  14. agenticsafetyeval/cli/common.py +121 -0
  15. agenticsafetyeval/cli/judge_cmd.py +167 -0
  16. agenticsafetyeval/cli/matrix_cmd.py +117 -0
  17. agenticsafetyeval/cli/regrade_cmd.py +70 -0
  18. agenticsafetyeval/cli/report_cmd.py +59 -0
  19. agenticsafetyeval/cli/run_cmd.py +328 -0
  20. agenticsafetyeval/cli/scaffold.py +90 -0
  21. agenticsafetyeval/cli/scenario_cmd.py +57 -0
  22. agenticsafetyeval/conformance.py +177 -0
  23. agenticsafetyeval/core/__init__.py +1 -0
  24. agenticsafetyeval/core/models.py +130 -0
  25. agenticsafetyeval/harness/__init__.py +1 -0
  26. agenticsafetyeval/harness/session_runner.py +299 -0
  27. agenticsafetyeval/judges/__init__.py +25 -0
  28. agenticsafetyeval/judges/llm_judge.py +114 -0
  29. agenticsafetyeval/judges/transcript.py +66 -0
  30. agenticsafetyeval/llm/__init__.py +33 -0
  31. agenticsafetyeval/llm/client.py +421 -0
  32. agenticsafetyeval/llm/parsing.py +31 -0
  33. agenticsafetyeval/llm/prompts.py +51 -0
  34. agenticsafetyeval/mocks/__init__.py +1 -0
  35. agenticsafetyeval/mocks/banking_session.py +264 -0
  36. agenticsafetyeval/py.typed +1 -0
  37. agenticsafetyeval/reporting/__init__.py +29 -0
  38. agenticsafetyeval/reporting/html.py +44 -0
  39. agenticsafetyeval/reporting/report.py +95 -0
  40. agenticsafetyeval/reporting/sink.py +117 -0
  41. agenticsafetyeval/reporting/site.py +42 -0
  42. agenticsafetyeval/scenarios/__init__.py +1 -0
  43. agenticsafetyeval/scenarios/loader.py +79 -0
  44. agenticsafetyeval/scoring/__init__.py +1 -0
  45. agenticsafetyeval/scoring/invariants.py +124 -0
  46. agenticsafetyeval/scoring/state.py +23 -0
  47. agenticsafetyeval/trace/__init__.py +1 -0
  48. agenticsafetyeval/trace/recorder.py +127 -0
  49. agenticsafetyeval-0.2.0.dist-info/METADATA +519 -0
  50. agenticsafetyeval-0.2.0.dist-info/RECORD +54 -0
  51. agenticsafetyeval-0.2.0.dist-info/WHEEL +4 -0
  52. agenticsafetyeval-0.2.0.dist-info/entry_points.txt +2 -0
  53. agenticsafetyeval-0.2.0.dist-info/licenses/LICENSE +201 -0
  54. agenticsafetyeval-0.2.0.dist-info/licenses/NOTICE +5 -0
@@ -0,0 +1,519 @@
1
+ Metadata-Version: 2.5
2
+ Name: agenticsafetyeval
3
+ Version: 0.2.0
4
+ Summary: State-verified safety evaluation for black-box session AI agents.
5
+ Author: Rammohan Srikanth Cirigiri
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright [yyyy] [name of copyright owner]
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+ License-File: LICENSE
208
+ License-File: NOTICE
209
+ Keywords: ai-agents,black-box,evaluation,safety
210
+ Classifier: Development Status :: 2 - Pre-Alpha
211
+ Classifier: License :: OSI Approved :: Apache Software License
212
+ Classifier: Programming Language :: Python :: 3
213
+ Classifier: Programming Language :: Python :: 3.11
214
+ Classifier: Programming Language :: Python :: 3.12
215
+ Classifier: Programming Language :: Python :: 3.13
216
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
217
+ Requires-Python: >=3.11
218
+ Requires-Dist: pydantic<3,>=2.8
219
+ Requires-Dist: pyyaml<7,>=6
220
+ Requires-Dist: typer<1,>=0.12
221
+ Provides-Extra: analysis
222
+ Requires-Dist: matplotlib<4,>=3.9; extra == 'analysis'
223
+ Requires-Dist: numpy<3,>=2; extra == 'analysis'
224
+ Requires-Dist: pandas<3,>=2.2; extra == 'analysis'
225
+ Requires-Dist: scipy<2,>=1.14; extra == 'analysis'
226
+ Provides-Extra: dev
227
+ Requires-Dist: mypy<2,>=1.11; extra == 'dev'
228
+ Requires-Dist: pytest-cov<7,>=5; extra == 'dev'
229
+ Requires-Dist: pytest<9,>=8.3; extra == 'dev'
230
+ Requires-Dist: ruff<1,>=0.7; extra == 'dev'
231
+ Requires-Dist: types-pyyaml<7,>=6.0; extra == 'dev'
232
+ Provides-Extra: litellm
233
+ Requires-Dist: litellm<2,>=1.50; extra == 'litellm'
234
+ Provides-Extra: models
235
+ Requires-Dist: anthropic<1,>=0.40; extra == 'models'
236
+ Requires-Dist: openai<3,>=1.50; extra == 'models'
237
+ Requires-Dist: python-dotenv<2,>=1; extra == 'models'
238
+ Description-Content-Type: text/markdown
239
+
240
+ <p align="center">
241
+ <picture>
242
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/brand/agenticsafetyeval-logo-horizontal-dark.svg">
243
+ <source media="(prefers-color-scheme: light)" srcset="docs/assets/brand/agenticsafetyeval-logo-horizontal.svg">
244
+ <img src="docs/assets/brand/agenticsafetyeval-logo-horizontal.svg" alt="agentic-safety-eval — State-Verified Agent Safety Evaluation" width="560">
245
+ </picture>
246
+ </p>
247
+
248
+ <p align="center">
249
+ <a href="https://github.com/rcirigiri/agentic-safety-eval/actions/workflows/ci.yml"><img src="https://github.com/rcirigiri/agentic-safety-eval/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
250
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License: Apache-2.0"></a>
251
+ <img src="https://img.shields.io/badge/python-3.11%2B-blue" alt="Python 3.11+">
252
+ <a href="https://github.com/rcirigiri/agentic-safety-eval/stargazers"><img src="https://img.shields.io/github/stars/rcirigiri/agentic-safety-eval?style=social" alt="GitHub stars"></a>
253
+ </p>
254
+
255
+ <p align="center">
256
+ <strong>State-verified safety evaluation for black-box AI agents.</strong><br>
257
+ An open-source framework that grades state-changing agents against the system of record.
258
+ </p>
259
+
260
+ <p align="center">
261
+ <a href="docs/developer_guide.md">Developer Guide</a> ·
262
+ <a href="#quick-start">Quick Start</a> ·
263
+ <a href="paper/">Paper</a> ·
264
+ <a href="safeorderbench/">SafeOrderBench</a> ·
265
+ <a href="docs/llm_judge.md">LLM Judge</a> ·
266
+ <a href="docs/customers.md">Who It's For</a>
267
+ </p>
268
+
269
+ ## Quick start
270
+
271
+ ```bash
272
+ python -m pip install -e .
273
+ agenticsafetyeval run --domain banking --agent session-reference # 16-scenario demo suite
274
+ ```
275
+
276
+ ## Why agentic-safety-eval?
277
+
278
+ - **State-verified** — the grade is the final state read back from the
279
+ system of record, never the agent's reply or its tool trace.
280
+ - **Say–do gap, measured** — every verifiable claim an agent makes is
281
+ extracted and checked against the state in force when it was spoken:
282
+ `verified`, `contradicted`, or `unverifiable`.
283
+ - **Deterministic** — scoring is plain Python over authorized end
284
+ states. No model decides pass/fail; LLM judges are advisory and are
285
+ themselves graded against the deterministic verdict.
286
+ - **Model-agnostic** — OpenAI, Anthropic, Gemini, Azure, Bedrock, local
287
+ and OpenAI-compatible endpoints through one `TextClient` protocol.
288
+ - **Trust-labeled** — every result carries a `provider_trust` tier
289
+ (harness / auditor / self-reported), so a pass always says *who ran
290
+ the ruler*.
291
+
292
+ agentic-safety-eval drives an agent with a scripted scenario
293
+ — customer utterances for conversational agents; events such as
294
+ data-feed updates, configuration or settings changes, scheduled
295
+ triggers, and the passage of time for event-driven or autonomous
296
+ agents that act without a conversation — lets the agent act inside its
297
+ own system, then reads the resulting state back from the system of
298
+ record and evaluates both:
299
+
300
+ 1. whether the final state is one the scenario author authorized (or
301
+ satisfies the scenario's pass rules); and
302
+ 2. where the agent makes verifiable statements — replies,
303
+ notifications, status responses, or reports — whether those
304
+ statements match that final state. Where an agent has no statement
305
+ surface, grading is state-only, including consistency between
306
+ independent records of the same events.
307
+
308
+ SafeOrderBench is the companion scenario set used to exercise the harness.
309
+
310
+ agentic-safety-eval is **framework-first**: organizations are expected to
311
+ evaluate their own agents by authoring their own scenarios — against
312
+ their own systems, policies, and test data — and running them through
313
+ this harness. The domain packs shipped in this repository are
314
+ reference benchmarks and worked examples of that model, not a growing
315
+ catalog of maintained domain products.
316
+
317
+ > **Status:** Pre-release research software. Results are benchmark
318
+ > findings, not safety certifications: a passing run shows what an agent
319
+ > did on these scenarios, not that it is safe in production.
320
+
321
+ **Getting started:** the [developer guide](docs/developer_guide.md) covers
322
+ how to evaluate your own agent, write scenarios, and grade an LLMJudge.
323
+ The [LLM judge explainer](docs/llm_judge.md) covers, in plain terms,
324
+ what the judge is for and why its verdict never grades an agent.
325
+ The [use-case catalog](docs/use_cases.md) lists what can be tested. The
326
+ [adoption guide](docs/adoption.md) covers the ladder from a first run to
327
+ comparing vendors. The [customer guide](docs/customers.md) names who the
328
+ product is for and how each of them runs the exam. A product-style
329
+ website lives in [`site/`](site/README.md) (static, no build step).
330
+
331
+ ## Who this is for
332
+
333
+ agentic-safety-eval is for any institution that will let an agent commit a
334
+ change on a system of record — and has to decide whether that agent may
335
+ do so. The grade is the sandbox ledger after the conversation, not the
336
+ chat transcript. Every end user below owns the go/no-go decision, the
337
+ sandbox, the evidence, or the consumption of that evidence:
338
+
339
+ | Audience | Who they are | What they decide or do |
340
+ |---|---|---|
341
+ | **Enterprise decision-makers** | Banks, credit unions, payments fintechs, processors, and BaaS platforms — buyers, product owners, procurement & third-party risk | Which vendor or embedded agent may move customer money, on what limits; score every bidder on the identical exam and file the run records |
342
+ | **Builders & release gatekeepers** | AI platform, agent engineering, QA/evaluation, security & red teams, model risk & compliance | Whether a model, prompt, or tool change may ship — `agenticsafetyeval run` as a CI gate against their own scenario suites, with tolerances set by the second line (e.g. zero tolerance for executed injection or duplicate payment) |
343
+ | **Operators & assurance** | Operations, support & incident management; internal audit; independent auditors and system integrators | Turn each production incident into a regression scenario; re-perform saved runs — the hash-linked trace is the audited artifact; operate the StateProvider at auditor tier so results count as certified evidence |
344
+ | **Counterparties** | Agent vendors & ISVs; foundation-model and agent-platform providers | Supply the session endpoint and sandbox and keep the exam in CI after acceptance; gate model versions by per-scenario pass rates on the same pack |
345
+ | **Evidence consumers** | Regulators & supervisors; researchers & open-source contributors | Read run records and trust-tier labels (a pass is not a regulatory approval); reproduce public comparisons and contribute paired scenarios |
346
+
347
+ Any other transactional domain uses the same framework by authoring
348
+ its own pack against its own system and test data — no centrally
349
+ released pack is required. Full detail, including how a buyer runs the
350
+ procurement exam end to end, is in the
351
+ [customer guide](docs/customers.md) and the
352
+ [vendor review playbook](docs/vendor_review_playbook.md).
353
+
354
+ ## Reference benchmarks and scenario packs
355
+
356
+ The framework is the product; packs are how a domain is expressed in
357
+ it. A **domain pack** defines one world — its state, its
358
+ StateProvider, its authorized outcomes — and organizations author
359
+ packs (or private scenario sets) for their own domains, systems, and
360
+ test data. One pack ships with this repository:
361
+
362
+ | Pack | World / scope | Status |
363
+ |---|---|---|
364
+ | SafeOrderBench | Banking ledger (accounts, payees, transfers) | Released — 16 scenarios · **Actively maintained** (flagship; the pack behind the paper and the pilots) |
365
+
366
+ No other domain packs are shipped or maintained. Organizations
367
+ express new domains as packs (or private scenario sets) that they
368
+ author and own themselves; maintenance levels for the shipped pack
369
+ are stated in the
370
+ [pack maintenance policy](docs/pack_maintenance_policy.md).
371
+
372
+ ## How evaluation works
373
+
374
+ There is exactly one evaluation model (Agent Contract Profile C,
375
+ `docs/agent_contract.md`):
376
+
377
+ ```text
378
+ StateProvider.reset() → seed(scenario initial state)
379
+ → per customer turn: agent.say(text) → reply (+ untrusted metadata)
380
+ → StateProvider.snapshot() → final state
381
+ → deterministic scoring + hash-linked trace
382
+ ```
383
+
384
+ The harness provides **no tools** to the agent, executes **no calls** on
385
+ its behalf, and applies **no gate**. The agent's internal actions are
386
+ invisible; the grade is the final state read from the sandbox system of
387
+ record, never the agent's reply. Scoring is deterministic Python — no
388
+ model decides pass/fail. Language models appear only as the agent under
389
+ test (inside the vendor system), as a claim extractor, and as an
390
+ LLMJudge whose own accuracy is measured against the deterministic
391
+ verdict.
392
+
393
+ ## Command line
394
+
395
+ ```bash
396
+ python -m pip install -e .
397
+ agenticsafetyeval run --domain banking --agent session-reference # demo suite
398
+ agenticsafetyeval run --agent your.module:YourSessionAgent --state-provider your.module:YourProvider
399
+ agenticsafetyeval certify-agent --agent your.module:YourSessionAgent
400
+ agenticsafetyeval certify-state-provider --provider your.module:YourProvider
401
+ agenticsafetyeval explain-scenario safeorderbench/public/banking/confirmation_gate/benign_transfer_001.yaml
402
+ agenticsafetyeval report artifacts/cli_runs
403
+ ```
404
+
405
+ `run` writes one JSON record (full trace + score) per scenario run and
406
+ exits non-zero if any selected scenario fails, so it can gate a CI job
407
+ (see `action.yml` and the `Dockerfile`). Use `--repeats N` for
408
+ nondeterministic agents; the leaderboard reports per-scenario pass rates.
409
+
410
+ ## Repository layout
411
+
412
+ ```text
413
+ agentic-safety-eval/
414
+ ├── .github/workflows/ Continuous integration
415
+ ├── docs/ Agent contract, guides, use-case catalog
416
+ ├── examples/ Black-box usage examples
417
+ ├── safeorderbench/
418
+ │ ├── audits/ Independent review records
419
+ │ ├── examples/ Dataset-format examples
420
+ │ ├── initial_states/ Synthetic snapshots by domain
421
+ │ ├── public/ Public scenarios by domain
422
+ │ ├── schemas/ Machine-readable dataset schemas
423
+ │ └── splits/ Public manifests and held-out hash
424
+ ├── scripts/ Maintenance entry points
425
+ ├── src/agenticsafetyeval/
426
+ │ ├── agents/ Session-agent interface (say -> reply)
427
+ │ ├── backends/ StateProvider (seed / snapshot / reset)
428
+ │ ├── claims/ Claim extraction and verification
429
+ │ ├── cli/ Command-line entry points
430
+ │ ├── core/ Shared schemas and protocols
431
+ │ ├── harness/ Black-box scenario execution
432
+ │ ├── judges/ LLMJudge evaluation adapters
433
+ │ ├── llm/ Evaluation-side text-model clients
434
+ │ ├── mocks/ Demo session agents for validation
435
+ │ ├── reporting/ Reports, leaderboard, static site
436
+ │ ├── scenarios/ Scenario parsing and validation
437
+ │ ├── scoring/ Deterministic final-state scoring
438
+ │ └── trace/ Immutable, hash-linked execution evidence
439
+ └── tests/
440
+ ├── fixtures/
441
+ ├── integration/
442
+ ├── invariants/
443
+ └── unit/
444
+ ```
445
+
446
+ ## Development
447
+
448
+ ```bash
449
+ python -m venv .venv
450
+ python -m pip install -e ".[dev]"
451
+ pytest
452
+ agenticsafetyeval --help
453
+ ```
454
+
455
+ ## Scoring model
456
+
457
+ - **Final state.** A run's snapshot must equal one of the scenario's
458
+ `authorized_final_states`. Every adversarial scenario is paired with a benign control, so
459
+ an agent that refuses everything cannot score perfectly.
460
+ - **Claims.** Statements extracted from replies are verified against the
461
+ final snapshot: asserted attributes that do not appear are
462
+ contradicted; claims about transient mid-run conditions are
463
+ unverifiable from a final snapshot and are reported as such.
464
+ - **Evidence.** Every run is recorded as a hash-linked trace
465
+ (`run_started`, customer/agent turns, seeded and final state,
466
+ `run_aborted` if the agent crashed); `verify_trace` recomputes the
467
+ chain. Agent crashes and exchange-limit overruns are scored, not
468
+ hidden.
469
+ - **Metadata is untrusted.** Anything the agent reports about itself is
470
+ recorded as a claim to be checked, never as ground truth.
471
+ - **Provider trust is explicit.** The StateProvider is the trust root:
472
+ the harness aborts if the post-seed snapshot differs from the seeded
473
+ state, snapshots after every turn, and checks state invariants
474
+ (e.g. balance conservation) itself. Every record is labeled by who
475
+ operated the provider (`provider_trust`: `harness` / `auditor` /
476
+ `self_reported`) — results from an evaluatee-operated provider are
477
+ self-reported, not certified. See
478
+ [docs/trust_model.md](docs/trust_model.md) and the
479
+ [vendor review playbook](docs/vendor_review_playbook.md).
480
+
481
+ ## Research boundary
482
+
483
+ agentic-safety-eval evaluates an agent during a controlled benchmark run
484
+ against a sandbox. It does not intercept, block, or repair anything in
485
+ production, and it cannot see the agent's internal actions — only the
486
+ utterances it receives, the replies it returns, and the final state.
487
+
488
+ ## Vision
489
+
490
+ > agentic-safety-eval evaluates whether AI agents act within their authorized
491
+ > mandate and report their actions truthfully — verified against
492
+ > independently observed system state — across payments, commerce, and
493
+ > other state-changing workflows.
494
+
495
+ That is the direction the framework generalizes toward. The flagship
496
+ reference benchmark today is banking (SafeOrderBench) — the pack
497
+ behind the paper and the pilots; further domains are expressed as packs
498
+ authored by the organizations that own them — with their own state
499
+ providers, paired adversarial and benign scenarios, and test data —
500
+ rather than as centrally maintained packs in this repository. Provider
501
+ trust is disclosed on
502
+ every record (`harness` / `auditor` / `self_reported`), so readers can
503
+ tell independently observed results from self-reported ones.
504
+
505
+ ## License
506
+
507
+ Apache License 2.0. SafeOrderBench licensing and its datasheet will be
508
+ finalized before the first public dataset release.
509
+
510
+ ## Authors
511
+
512
+ <p>
513
+ <a href="mailto:ram.cirigiri@gmail.com">
514
+ <img src="docs/assets/brand/author-card.png" alt="Author: Rammohan Srikanth Cirigiri — ram.cirigiri@gmail.com" width="640">
515
+ </a>
516
+ </p>
517
+
518
+ **Rammohan Srikanth Cirigiri** — Creator & maintainer, agentic-safety-eval
519
+ ([ram.cirigiri@gmail.com](mailto:ram.cirigiri@gmail.com))
@@ -0,0 +1,54 @@
1
+ agenticsafetyeval/__init__.py,sha256=U6Os9m5vc5kHsGfXBXK4v8hEFb70eSaTRG18vlCnPG4,92
2
+ agenticsafetyeval/__main__.py,sha256=S_oyTuTCcGl28lSW8L6l45120lcurUjlrs8IL1QLmPo,162
3
+ agenticsafetyeval/conformance.py,sha256=26zeBF6t_Cz34Ow4I4s1uImlmwHfTd_XFyOx-xH8vF0,6451
4
+ agenticsafetyeval/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
5
+ agenticsafetyeval/agents/__init__.py,sha256=5V8Q8H5kPIJAXXs7k2pgg5G3DW9qhqxSBI0p2TBI5bg,58
6
+ agenticsafetyeval/agents/llm_session.py,sha256=TZbsc70falhK0cQ1J6-Srq8z8uOLoUbmGb92vV8l1gE,7354
7
+ agenticsafetyeval/agents/session.py,sha256=z96ANkcw4B-q29UrV3o7d0OJmhQSususclrRTMF-nGg,4607
8
+ agenticsafetyeval/backends/__init__.py,sha256=yj4GFqb4MxVp3iqGGA2twVHq91bzEr_paKzBXnLm6lY,75
9
+ agenticsafetyeval/backends/state_provider.py,sha256=H_DxPnxf4xzq8-pRuI2RPSLEuUmWFLH2A8IeBEMfXow,3026
10
+ agenticsafetyeval/claims/__init__.py,sha256=xGGpdga298XmUcAwhf5FHa3P7zeFN-nGBk92QUsA8C8,71
11
+ agenticsafetyeval/claims/llm_extractor.py,sha256=CylRKuMYr0WKSf6b7aROyLwtn96glcYOuM2n22BwikI,4306
12
+ agenticsafetyeval/claims/verifier.py,sha256=2F-EEOmNuykzVFLHpwszB5xTsT5aQf39sPwG2NhkmP0,15261
13
+ agenticsafetyeval/cli/__init__.py,sha256=6SSjIU49odBh2-y3KKD8l4RfUwPx9TXQhmjpN2chCB8,130
14
+ agenticsafetyeval/cli/app.py,sha256=AB8sb7LTtq7qlX9rKCcUak1It3xCiSOIUOseh0oScBw,1821
15
+ agenticsafetyeval/cli/certify_cmd.py,sha256=L1_LsA8hsk-poCPTmY6CApqOByYgRA3cvEHWvCFbHpQ,2056
16
+ agenticsafetyeval/cli/common.py,sha256=ybnXLs-U1VptTlyj9ys1Umed_Q9BaGxIBOPQRWHVX7g,4525
17
+ agenticsafetyeval/cli/judge_cmd.py,sha256=_cIwH4S9TLpjz3c1klGYKvZDMBS9k17sOThJUW1XFjQ,6376
18
+ agenticsafetyeval/cli/matrix_cmd.py,sha256=kXcuPTKo8LjjWtHBq1X5yTpHYfPRMY5Y76EmolvoMZ4,5186
19
+ agenticsafetyeval/cli/regrade_cmd.py,sha256=mpSZO96ki3hB7uP8L4tR4ZguVQ_neEJJ9ppu2yBz168,2775
20
+ agenticsafetyeval/cli/report_cmd.py,sha256=T_Cl4UdRDyyvLf_fXW6spN6SSW3ayPob-fuhzsUuVe0,2275
21
+ agenticsafetyeval/cli/run_cmd.py,sha256=JtXuYuvUUf5m-VNQ2hOQ6SdG880BlnFKMe4UuF7YI2k,13168
22
+ agenticsafetyeval/cli/scaffold.py,sha256=3V4EJIPcPzbC0fu392ShP6-2nZ7DfMAV1g0Azpdc_IQ,2992
23
+ agenticsafetyeval/cli/scenario_cmd.py,sha256=LVU5f9DXfi98n3E2Lck0zD9kABny1f7o4FsOwKJguvQ,2237
24
+ agenticsafetyeval/core/__init__.py,sha256=DQeJbZ2OH9TvcgIL8JdO7vN0hRbHPcZcy5b3sysYM-Q,56
25
+ agenticsafetyeval/core/models.py,sha256=wQ7oYtyoIW6JbsYaREaEEiHONwpOfDZ0MycgH-wBqJw,4910
26
+ agenticsafetyeval/harness/__init__.py,sha256=ayetPWl4K6MFe7nJmaadUYC3U4b7Tumb-znKYPYu7ZQ,49
27
+ agenticsafetyeval/harness/session_runner.py,sha256=5iKSbdU8IrdSP8ScmhFoSYUxrqV2REPkzZi-UY0Aoo4,11822
28
+ agenticsafetyeval/judges/__init__.py,sha256=60CKAvnaF_UAjX7D-qzhJWgLVp6crzD-oZNe2KcBcj0,516
29
+ agenticsafetyeval/judges/llm_judge.py,sha256=AxRzZ4bS1MB5Al-Z0q_kbouqIa0-bv7tRzSjLb8sEl4,3792
30
+ agenticsafetyeval/judges/transcript.py,sha256=V4bw26TSJNQTfZYA3Ah7cjLVfZZGPz8bNk_yCvUWwrs,2488
31
+ agenticsafetyeval/llm/__init__.py,sha256=exHH0RwmbzmPaEv9cyqB5m5e_xpQhsKC9_iO0LZt4Nk,768
32
+ agenticsafetyeval/llm/client.py,sha256=4vFs7csswaBMB135V2YHyZgPhjYfJhnlAD0-3Ph6I5I,16437
33
+ agenticsafetyeval/llm/parsing.py,sha256=8_Yi3wmZwSTkOHAZucz8B3ftNlWSvp6UsYM1r-ZjvgI,1063
34
+ agenticsafetyeval/llm/prompts.py,sha256=uzBe7smQkqYheB1sBHUrUOjtJnwdG-6KgWrH0OGs1Yc,2435
35
+ agenticsafetyeval/mocks/__init__.py,sha256=5i721i3iOBfY5AskNAtOuX7bkOP3dG9ow89Zpt4VcpQ,68
36
+ agenticsafetyeval/mocks/banking_session.py,sha256=kQMo9-TGPeS-FQ_oLt9XD-pOrnm6cUUxhMFxB8WoTD0,11799
37
+ agenticsafetyeval/reporting/__init__.py,sha256=QgyF1pn41JFkWlJJjLx1iLiOaMUWXfm9dwvXWZmppEo,641
38
+ agenticsafetyeval/reporting/html.py,sha256=VbrTFLIEiEVfZVpT6XTg78bp0O25_SwM5xnC17Do5zI,1640
39
+ agenticsafetyeval/reporting/report.py,sha256=Gizd4AevTnv77ITH0o1jH3a7J5ImvelXilLYBhVantQ,3457
40
+ agenticsafetyeval/reporting/sink.py,sha256=QVhUkeyCGvnX-MS_byTQwSLEvHA7mEgakyVXjzsSzN0,3911
41
+ agenticsafetyeval/reporting/site.py,sha256=q-9wzlfuaGf7W5ACAr1CYVf4ODj99J18pGYPOCZUmUI,1713
42
+ agenticsafetyeval/scenarios/__init__.py,sha256=5tFBQTYZDplwpk4cSp7czmUpcIxqtUXr9gIafJk1Ca0,55
43
+ agenticsafetyeval/scenarios/loader.py,sha256=fyB3LZVtBdxQRzDn01HXrg6Dw26Y1R0Y5iIQV-Zzkn4,2568
44
+ agenticsafetyeval/scoring/__init__.py,sha256=sny4jq6nyCVM2Q8wkBfhacIHcL5brgFDe8hkmkATvqU,42
45
+ agenticsafetyeval/scoring/invariants.py,sha256=wj55Q43vXLZZrhUngwAtE4PwnwVyNXYcUa1Bl_jYuII,5382
46
+ agenticsafetyeval/scoring/state.py,sha256=ItzbHjWgpdUOMuhhZFo7p6fFAMdAW7QKAidKjjvPwXI,869
47
+ agenticsafetyeval/trace/__init__.py,sha256=0itgrzCRzx1vuIHcCyn1SkJqWV1bf3XPD2UYAQgm0lQ,72
48
+ agenticsafetyeval/trace/recorder.py,sha256=SyGlbdmQ2EwfY-fq-mqH8vn6uTOAjBJKLlzma48TiYQ,3890
49
+ agenticsafetyeval-0.2.0.dist-info/METADATA,sha256=t1srIjBDRIo-fwrHU0z9GLkwtuI-DIkKPzWJeF7QxzE,27893
50
+ agenticsafetyeval-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
51
+ agenticsafetyeval-0.2.0.dist-info/entry_points.txt,sha256=uNRzLGO4g6CMyM1pRne1T4Lhpj5udUZtJ8Smm4WK4wk,64
52
+ agenticsafetyeval-0.2.0.dist-info/licenses/LICENSE,sha256=zgQlaTrl2517uYfiLARAZbEOplOFnzD4F89arokdqGc,10455
53
+ agenticsafetyeval-0.2.0.dist-info/licenses/NOTICE,sha256=4tAu1xJT5DZNiLngxglWa42wh4Veju7w9DwA5P0xXso,146
54
+ agenticsafetyeval-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ agenticsafetyeval = agenticsafetyeval.cli:app