epi-recorder 2.1.3__tar.gz → 2.3.0__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 (146) hide show
  1. epi_recorder-2.3.0/CHANGELOG.md +171 -0
  2. epi_recorder-2.3.0/LICENSE +21 -0
  3. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/MANIFEST.in +2 -0
  4. epi_recorder-2.3.0/PKG-INFO +269 -0
  5. epi_recorder-2.3.0/README.md +224 -0
  6. epi_recorder-2.3.0/epi_analyzer/__init__.py +9 -0
  7. epi_recorder-2.3.0/epi_analyzer/detector.py +337 -0
  8. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/__init__.py +4 -0
  9. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/__main__.py +4 -0
  10. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/chat.py +21 -3
  11. epi_recorder-2.3.0/epi_cli/debug.py +107 -0
  12. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/keys.py +4 -0
  13. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/ls.py +5 -1
  14. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/main.py +8 -0
  15. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/record.py +4 -0
  16. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/run.py +12 -4
  17. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/verify.py +4 -0
  18. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_cli/view.py +4 -0
  19. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/__init__.py +5 -1
  20. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/container.py +68 -55
  21. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/redactor.py +4 -0
  22. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/schemas.py +6 -2
  23. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/serialize.py +4 -0
  24. epi_recorder-2.3.0/epi_core/storage.py +186 -0
  25. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_core/trust.py +4 -0
  26. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/__init__.py +13 -1
  27. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/api.py +211 -5
  28. epi_recorder-2.3.0/epi_recorder/async_api.py +151 -0
  29. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/bootstrap.py +4 -0
  30. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/environment.py +4 -0
  31. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/patcher.py +79 -19
  32. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/test_import.py +2 -0
  33. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder/test_script.py +2 -0
  34. epi_recorder-2.3.0/epi_recorder/wrappers/__init__.py +16 -0
  35. epi_recorder-2.3.0/epi_recorder/wrappers/base.py +79 -0
  36. epi_recorder-2.3.0/epi_recorder/wrappers/openai.py +178 -0
  37. epi_recorder-2.3.0/epi_recorder.egg-info/PKG-INFO +269 -0
  38. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder.egg-info/SOURCES.txt +23 -43
  39. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder.egg-info/top_level.txt +1 -0
  40. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_viewer_static/app.js +113 -7
  41. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_viewer_static/crypto.js +3 -0
  42. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_viewer_static/index.html +4 -2
  43. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_viewer_static/viewer_lite.css +3 -1
  44. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/advanced_demo.py +4 -0
  45. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/api_example.py +4 -0
  46. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/complete_demo_workflow.py +4 -0
  47. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/complete_example.py +5 -1
  48. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/complex_rag_demo.py +4 -0
  49. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/decorator_example.py +4 -0
  50. epi_recorder-2.3.0/examples/demo_mistake_detection.py +129 -0
  51. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/demo_python_api.py +4 -0
  52. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/demo_script.py +5 -1
  53. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/demo_workflow.py +4 -0
  54. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/hello_simple.py +4 -0
  55. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/live_demo_workflow.py +4 -0
  56. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/metadata_example.py +5 -1
  57. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/openai_example.py +5 -1
  58. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/quick_demo.py +5 -1
  59. epi_recorder-2.3.0/examples/quickstart.py +30 -0
  60. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/sentiment_analysis.py +5 -1
  61. epi_recorder-2.3.0/examples/simulate_agent.py +204 -0
  62. epi_recorder-2.3.0/examples/test_async.py +18 -0
  63. epi_recorder-2.3.0/examples/test_comprehensive.py +250 -0
  64. epi_recorder-2.3.0/examples/test_detector_comprehensive.py +148 -0
  65. epi_recorder-2.3.0/examples/test_real_workflow.py +24 -0
  66. epi_recorder-2.3.0/examples/test_sqlite_storage.py +57 -0
  67. epi_recorder-2.3.0/examples/test_thread_safety.py +51 -0
  68. epi_recorder-2.3.0/examples/test_with_llm.py +26 -0
  69. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/view_example.py +5 -1
  70. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/visualization_script.py +5 -1
  71. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/examples/zero_config_example.py +4 -0
  72. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/pyproject.toml +34 -13
  73. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/setup.py +4 -0
  74. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/__init__.py +4 -0
  75. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_all_cli_commands.py +4 -0
  76. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_api.py +4 -0
  77. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_api_integration.py +4 -0
  78. epi_recorder-2.3.0/tests/test_bootstrap.py +59 -0
  79. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_cli_comprehensive.py +4 -0
  80. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_cli_integration.py +4 -0
  81. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_container.py +5 -1
  82. epi_recorder-2.3.0/tests/test_environment_comprehensive.py +212 -0
  83. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_metadata_features.py +5 -1
  84. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_new_ux.py +4 -0
  85. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_patcher.py +4 -0
  86. epi_recorder-2.3.0/tests/test_patcher_comprehensive.py +88 -0
  87. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_real_workflow_api.py +4 -0
  88. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_redactor.py +4 -0
  89. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_serialize.py +4 -0
  90. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_trust.py +4 -0
  91. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/test_user_workflow.py +42 -37
  92. epi_recorder-2.3.0/tests/test_user_workflow_simple.py +132 -0
  93. epi_recorder-2.3.0/tests/test_wrappers.py +238 -0
  94. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/tests/user_journey_test.py +4 -0
  95. epi_recorder-2.1.3/CHANGELOG.md +0 -96
  96. epi_recorder-2.1.3/LICENSE +0 -201
  97. epi_recorder-2.1.3/PKG-INFO +0 -577
  98. epi_recorder-2.1.3/README.md +0 -537
  99. epi_recorder-2.1.3/epi_postinstall.py +0 -197
  100. epi_recorder-2.1.3/epi_recorder.egg-info/PKG-INFO +0 -577
  101. epi_recorder-2.1.3/tests/COMPREHENSIVE_REAL_TEST.py +0 -362
  102. epi_recorder-2.1.3/tests/ENTERPRISE_PLATFORM_TEST.py +0 -136
  103. epi_recorder-2.1.3/tests/FINAL_COMPREHENSIVE_TEST.py +0 -205
  104. epi_recorder-2.1.3/tests/REAL_USER_TEST.py +0 -314
  105. epi_recorder-2.1.3/tests/ULTIMATE_COMPLETE_TEST.py +0 -353
  106. epi_recorder-2.1.3/tests/comprehensive_test_v1.1.py +0 -174
  107. epi_recorder-2.1.3/tests/edge_case_simple.py +0 -162
  108. epi_recorder-2.1.3/tests/edge_case_test.py +0 -229
  109. epi_recorder-2.1.3/tests/full_system_test.py +0 -256
  110. epi_recorder-2.1.3/tests/my_test.py +0 -46
  111. epi_recorder-2.1.3/tests/quick_api_test.py +0 -15
  112. epi_recorder-2.1.3/tests/simulate_user.py +0 -118
  113. epi_recorder-2.1.3/tests/stress_test.py +0 -151
  114. epi_recorder-2.1.3/tests/test_100_percent.py +0 -454
  115. epi_recorder-2.1.3/tests/test_absolute_100.py +0 -341
  116. epi_recorder-2.1.3/tests/test_cli_record.py +0 -11
  117. epi_recorder-2.1.3/tests/test_cli_workflow.py +0 -33
  118. epi_recorder-2.1.3/tests/test_complete_workflow.py +0 -197
  119. epi_recorder-2.1.3/tests/test_comprehensive_e2e.py +0 -157
  120. epi_recorder-2.1.3/tests/test_context_debug.py +0 -56
  121. epi_recorder-2.1.3/tests/test_coverage_100.py +0 -264
  122. epi_recorder-2.1.3/tests/test_debug_record_path.py +0 -40
  123. epi_recorder-2.1.3/tests/test_decorator_debug.py +0 -19
  124. epi_recorder-2.1.3/tests/test_detailed_debug.py +0 -54
  125. epi_recorder-2.1.3/tests/test_final_100.py +0 -308
  126. epi_recorder-2.1.3/tests/test_final_validation.py +0 -159
  127. epi_recorder-2.1.3/tests/test_magic.py +0 -20
  128. epi_recorder-2.1.3/tests/test_matching_validation.py +0 -29
  129. epi_recorder-2.1.3/tests/test_metadata_fix.py +0 -37
  130. epi_recorder-2.1.3/tests/test_record_vs_class.py +0 -42
  131. epi_recorder-2.1.3/tests/test_redaction_only.py +0 -23
  132. epi_recorder-2.1.3/tests/test_signing.py +0 -26
  133. epi_recorder-2.1.3/tests/test_signing_debug.py +0 -63
  134. epi_recorder-2.1.3/tests/test_signing_verbose.py +0 -35
  135. epi_recorder-2.1.3/tests/test_simple.py +0 -17
  136. epi_recorder-2.1.3/tests/test_simple_context.py +0 -24
  137. epi_recorder-2.1.3/tests/test_steps_format.py +0 -29
  138. epi_recorder-2.1.3/tests/test_trace_exit.py +0 -48
  139. epi_recorder-2.1.3/tests/test_user_demo.py +0 -31
  140. epi_recorder-2.1.3/tests/test_user_workflow_simple.py +0 -183
  141. epi_recorder-2.1.3/tests/torture_test.py +0 -66
  142. epi_recorder-2.1.3/tests/verify_improvements.py +0 -101
  143. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder.egg-info/dependency_links.txt +0 -0
  144. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder.egg-info/entry_points.txt +0 -0
  145. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/epi_recorder.egg-info/requires.txt +0 -0
  146. {epi_recorder-2.1.3 → epi_recorder-2.3.0}/setup.cfg +0 -0
@@ -0,0 +1,171 @@
1
+ # Changelog
2
+
3
+ All notable changes to EPI Recorder are documented here.
4
+
5
+ EPI follows [Semantic Versioning](https://semver.org/) and treats version changes as
6
+ **corrections to evidence guarantees**, not just feature updates.
7
+
8
+ ---
9
+
10
+ ## [3.0.0] – Planned
11
+
12
+ > **Status:** Pre-RFC. This is a directional commitment, not a release.
13
+
14
+ ### Intent
15
+
16
+ v3.0.0 will finalize EPI as a **stable evidence specification**.
17
+
18
+ #### Planned Changes
19
+
20
+ - **Removal of legacy patching**
21
+ - `legacy_patching=True` will no longer be supported
22
+ - All evidence capture will be explicit
23
+
24
+ - **Stabilized evidence specification**
25
+ - Manifest schema frozen
26
+ - Backward-compatibility guarantees for `.epi` files
27
+
28
+ - **Forward-compatibility primitives**
29
+ - Versioned step schemas
30
+ - Extension mechanism for custom evidence types
31
+
32
+ - **Trust model refinements** (under consideration)
33
+ - Organization-level key management
34
+ - Multi-party signing
35
+ - Delegation chains
36
+
37
+ #### Design Philosophy
38
+
39
+ v3.0.0 is not about features. It is about **guarantees**.
40
+
41
+ After v3.0.0, the `.epi` format should be:
42
+ - readable by any future version
43
+ - verifiable without the original tooling
44
+ - suitable for long-term archival
45
+
46
+ ---
47
+
48
+ ## [2.3.0] – 2026-02-06
49
+
50
+ ### ⚠️ Design Correction (Migration Required)
51
+
52
+ This release clarifies EPI's role as an **evidence system**, not a passive logger.
53
+
54
+ #### Breaking
55
+ - **Implicit monkey-patching disabled by default**
56
+ - Automatic interception of LLM calls is no longer enabled
57
+ - Evidence capture is now **explicit by design**
58
+
59
+ #### Rationale
60
+ Evidence systems must be:
61
+ - intentional
62
+ - reviewable in code
63
+ - stable across SDK versions
64
+
65
+ Implicit interception was convenient but fragile.
66
+ Explicit capture provides stronger evidentiary guarantees.
67
+
68
+ #### Added
69
+ - **Explicit evidence API**
70
+ - `log_llm_call(response)` — structured capture of LLM responses
71
+ - `log_chat(data)` — simplified, framework-agnostic capture
72
+ - **Wrapper clients**
73
+ - `wrap_openai()` — proxy wrapper enabling capture without SDK modification
74
+ - **TracedOpenAI**
75
+ - Fully wrapped OpenAI client with automatic evidence capture
76
+
77
+ #### Deprecated
78
+ - `legacy_patching=True`
79
+ - Temporary compatibility flag
80
+ - Will be removed in v3.0.0
81
+
82
+ ---
83
+
84
+ ## [2.2.1] – 2026-02-06
85
+
86
+ ### Fixed
87
+ - Guaranteed creation of `steps.jsonl` at recording start
88
+ - Updated tests to match current evidence specification
89
+ - Removed brittle test return semantics
90
+
91
+ ### Added
92
+ - `unpatch_all()` to restore original methods in legacy patching mode
93
+ - Viewer support for error-level evidence steps:
94
+ - `llm.error`
95
+ - `http.request`
96
+ - `http.response`
97
+ - `http.error`
98
+
99
+ ### Changed
100
+ - Evidence spec version bumped to 2.2.1
101
+
102
+ ---
103
+
104
+ ## [2.2.0] – 2026-01-30
105
+
106
+ ### Clarified Scope
107
+ - EPI's primary artifact is a **portable execution evidence file (.epi)**
108
+ - Debugging tools are treated as **secondary consumers** of evidence
109
+
110
+ ### Added
111
+ - Thread-safe recording using `contextvars`
112
+ - Crash-safe SQLite-based evidence storage
113
+ - `epi debug` — heuristic analysis of recorded evidence
114
+ - Async recording API for concurrent workflows
115
+
116
+ ### Changed
117
+ - License standardized to MIT
118
+ - Documentation updated to emphasize execution evidence
119
+
120
+ ### Technical
121
+ - Replaced global state with context-isolated recording
122
+ - Introduced atomic, append-only storage guarantees
123
+
124
+ ---
125
+
126
+ ## [2.1.3] – 2026-01-24
127
+
128
+ ### Added
129
+ - Google Gemini evidence capture
130
+ - `epi chat` — natural language querying of evidence files
131
+
132
+ ### Fixed
133
+ - Windows terminal compatibility issues
134
+ - Improved error classification and reporting
135
+ - Reduced SDK deprecation noise
136
+
137
+ ---
138
+
139
+ ## [2.1.2] – 2026-01-17
140
+
141
+ ### Security
142
+ - Client-side, offline signature verification in embedded viewer
143
+ - Canonical serialization and public-key inclusion in evidence manifests
144
+
145
+ ### Changed
146
+ - Viewer trust indicators updated
147
+ - Evidence specification versioned
148
+
149
+ ---
150
+
151
+ ## [2.1.1] – 2025-12-16
152
+
153
+ ### Added
154
+ - Reliable `python -m epi_cli` fallback
155
+ - Automatic PATH repair on Windows
156
+ - Universal install scripts
157
+ - Self-healing `epi doctor` diagnostics
158
+
159
+ ### Fixed
160
+ - Windows Unicode terminal issues
161
+ - Packaging and installer reliability
162
+
163
+ ---
164
+
165
+ ## [2.1.0] – 2025-12-15
166
+
167
+ ### Initial Release
168
+ - Portable `.epi` evidence format
169
+ - Cryptographic sealing with Ed25519
170
+ - Embedded offline viewer
171
+ - Zero-config CLI recording
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 EPI Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -18,3 +18,5 @@ global-exclude *.pyo
18
18
  global-exclude __pycache__
19
19
  global-exclude *.so
20
20
  global-exclude .DS_Store
21
+
22
+
@@ -0,0 +1,269 @@
1
+ Metadata-Version: 2.4
2
+ Name: epi-recorder
3
+ Version: 2.3.0
4
+ Summary: Verifiable execution evidence for AI systems. Portable, cryptographically signed artifacts.
5
+ Author-email: EPI Labs <mohdibrahim@epilabs.org>
6
+ Maintainer-email: Mohd Ibrahim Afridi <mohdibrahim@epilabs.org>
7
+ License: MIT
8
+ Project-URL: Homepage, https://epilabs.org
9
+ Project-URL: Documentation, https://epilabs.org/docs
10
+ Project-URL: Repository, https://github.com/mohdibrahimaiml/epi-recorder
11
+ Project-URL: Issues, https://github.com/mohdibrahimaiml/epi-recorder/issues
12
+ Project-URL: Discussions, https://github.com/mohdibrahimaiml/epi-recorder/discussions
13
+ Keywords: evidence,forensics,audit,compliance,cryptography,ai,llm,verification,artifact,execution-trace,reproducibility,tamper-evident
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Legal Industry
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Security :: Cryptography
25
+ Classifier: Topic :: System :: Logging
26
+ Classifier: Typing :: Typed
27
+ Classifier: Framework :: Pydantic
28
+ Classifier: Framework :: Pydantic :: 2
29
+ Requires-Python: >=3.11
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: pydantic>=2.0.0
33
+ Requires-Dist: cryptography>=41.0.0
34
+ Requires-Dist: cbor2>=5.6.0
35
+ Requires-Dist: typer[all]>=0.12.0
36
+ Requires-Dist: rich>=13.0.0
37
+ Requires-Dist: google-generativeai>=0.4.0
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
40
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
41
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
42
+ Requires-Dist: black>=24.0.0; extra == "dev"
43
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ <p align="center">
47
+ <img src="https://raw.githubusercontent.com/mohdibrahimaiml/epi-recorder/main/docs/assets/logo.png" alt="EPI Logo" width="180"/>
48
+ <br>
49
+ <h1 align="center">EPI</h1>
50
+ <p align="center"><strong>Verifiable Execution Evidence for AI Systems / AI Agents</strong></p>
51
+ <p align="center">
52
+ <em>A portable, cryptographically sealed artifact format for AI execution records.</em>
53
+ </p>
54
+ </p>
55
+
56
+ <p align="center">
57
+ <a href="https://pypi.org/project/epi-recorder/"><img src="https://img.shields.io/pypi/v/epi-recorder?style=for-the-badge&color=00d4ff&label=PyPI" alt="PyPI"/></a>
58
+ <a href="https://github.com/mohdibrahimaiml/epi-recorder"><img src="https://img.shields.io/badge/python-3.11%2B-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python"/></a>
59
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License"/></a>
60
+ </p>
61
+
62
+ ---
63
+
64
+ ## What is EPI?
65
+
66
+ EPI (Evidence Package for AI) is a **file format** for capturing and verifying AI execution evidence.
67
+
68
+ An `.epi` file is to AI execution what PDF is to documents:
69
+ - **Self-contained** — prompts, responses, environment, viewer — all in one file
70
+ - **Universally viewable** — opens in any browser, no software required
71
+ - **Tamper-evident** — Ed25519 signatures prove the record wasn't altered
72
+
73
+ EPI is designed for **adversarial review**: audits, incident response, compliance, litigation.
74
+
75
+ ---
76
+
77
+ ## Design Guarantees
78
+
79
+ EPI artifacts provide the following guarantees:
80
+
81
+ | Guarantee | Implementation |
82
+ |:----------|:---------------|
83
+ | **Explicitness** | Evidence capture is intentional and reviewable in source code |
84
+ | **Portability** | Single file, no external dependencies, works offline |
85
+ | **Offline Verifiability** | Signature verification requires no network or cloud services |
86
+ | **Adversarial Review** | Format assumes the reviewer does not trust the producer |
87
+
88
+ These are not features. They are **constraints** that define what EPI is.
89
+
90
+ ---
91
+
92
+ ## Quick Start
93
+
94
+ ```bash
95
+ pip install epi-recorder
96
+ ```
97
+
98
+ ### Capture Evidence (Explicit API)
99
+
100
+ ```python
101
+ from epi_recorder import record
102
+
103
+ with record("evidence.epi") as epi:
104
+ response = client.chat.completions.create(model="gpt-4", messages=[...])
105
+ epi.log_llm_call(response) # Explicit capture
106
+ ```
107
+
108
+ ### Capture Evidence (Wrapper Client)
109
+
110
+ ```python
111
+ from epi_recorder import record, wrap_openai
112
+ from openai import OpenAI
113
+
114
+ client = wrap_openai(OpenAI())
115
+
116
+ with record("evidence.epi"):
117
+ response = client.chat.completions.create(...) # Captured via wrapper
118
+ ```
119
+
120
+ ### Verify Evidence
121
+
122
+ ```bash
123
+ epi verify evidence.epi
124
+ ```
125
+
126
+ ---
127
+
128
+ ## The `.epi` Artifact Format
129
+
130
+ An `.epi` file is a ZIP archive with a defined structure. See [docs/EPI-SPEC.md](docs/EPI-SPEC.md) for the full specification.
131
+
132
+ ```
133
+ evidence.epi
134
+ ├── mimetype # "application/epi+zip"
135
+ ├── manifest.json # Metadata + Ed25519 signature
136
+ ├── steps.jsonl # Execution steps (NDJSON)
137
+ ├── env.json # Runtime environment snapshot
138
+ └── viewer/
139
+ └── index.html # Self-contained offline viewer
140
+ ```
141
+
142
+ The embedded viewer allows any recipient to:
143
+ - View the complete execution timeline
144
+ - Verify cryptographic integrity
145
+ - Inspect individual steps
146
+
147
+ No software installation required.
148
+
149
+ ---
150
+
151
+ ## CLI Reference
152
+
153
+ ### Primary Commands
154
+
155
+ | Command | Purpose |
156
+ |:--------|:--------|
157
+ | `epi run <script.py>` | Capture execution evidence to `.epi` |
158
+ | `epi verify <file.epi>` | Verify artifact integrity and signature |
159
+ | `epi view <file.epi>` | Open artifact in browser viewer |
160
+ | `epi keys list` | Manage signing keys |
161
+
162
+ ### Secondary Tools
163
+
164
+ These tools consume evidence artifacts for analysis:
165
+
166
+ | Command | Purpose |
167
+ |:--------|:--------|
168
+ | `epi debug <file.epi>` | Heuristic analysis (loops, errors, inefficiencies) |
169
+ | `epi chat <file.epi>` | Natural language querying via LLM |
170
+
171
+ > **Note:** `debug` and `chat` are convenience tools built on top of the evidence format.
172
+ > They are not part of the core specification.
173
+
174
+ ---
175
+
176
+ ## Cryptographic Properties
177
+
178
+ | Property | Implementation |
179
+ |:---------|:---------------|
180
+ | **Signatures** | Ed25519 (RFC 8032) |
181
+ | **Hashing** | SHA-256 content addressing |
182
+ | **Key Storage** | Local keyring, user-controlled |
183
+ | **Verification** | Client-side, zero external dependencies |
184
+
185
+ Signatures are **optional but recommended**. Unsigned artifacts are still valid but cannot prove origin.
186
+
187
+ ---
188
+
189
+ ## When to Use EPI
190
+
191
+ ### Appropriate Use Cases
192
+
193
+ - Post-incident forensics
194
+ - Compliance documentation
195
+ - Audit trails for autonomous systems
196
+ - Reproducibility evidence for research
197
+ - Litigation-grade execution records
198
+
199
+ ### Not Designed For
200
+
201
+ - Real-time monitoring dashboards
202
+ - High-frequency telemetry
203
+ - System health metrics
204
+ - Application performance monitoring
205
+
206
+ EPI produces **artifacts**, not **streams**.
207
+
208
+ ---
209
+
210
+ ## Supported Providers
211
+
212
+ | Provider | Capture Method |
213
+ |:---------|:---------------|
214
+ | OpenAI | Wrapper client or explicit API |
215
+ | Anthropic | Explicit API |
216
+ | Google Gemini | Explicit API |
217
+ | Any HTTP-based LLM | Explicit API via `log_llm_call()` |
218
+
219
+ EPI does not depend on provider-specific integrations. The explicit API works with any response format.
220
+
221
+ ---
222
+
223
+ ## v2.3.0 — Design Correction
224
+
225
+ This release corrects EPI's evidence capture model.
226
+
227
+ | Before (v2.2.x) | After (v2.3.0) |
228
+ |:----------------|:---------------|
229
+ | Implicit monkey-patching | Explicit capture |
230
+ | Fragile to SDK changes | Stable across versions |
231
+ | Hidden instrumentation | Reviewable in source |
232
+
233
+ **Rationale:** Evidence systems must be intentional. Implicit capture was convenient but violated the explicitness guarantee.
234
+
235
+ **Migration:** Replace implicit capture with `epi.log_llm_call(response)` or `wrap_openai()`.
236
+
237
+ **Legacy mode:** `record(legacy_patching=True)` is deprecated and will be removed in v3.0.
238
+
239
+ ---
240
+
241
+ ## Release History
242
+
243
+ | Version | Date | Summary |
244
+ |:--------|:-----|:--------|
245
+ | **2.3.0** | 2026-02-06 | Explicit capture, wrapper clients, design correction |
246
+ | **2.2.0** | 2026-01-30 | SQLite storage, async support, context isolation |
247
+ | **2.1.3** | 2026-01-24 | Gemini capture, evidence querying |
248
+ | **2.1.0** | 2025-12-15 | Initial release |
249
+
250
+ See [CHANGELOG.md](./CHANGELOG.md) for full details.
251
+
252
+ ---
253
+
254
+ ## Contributing
255
+
256
+ ```bash
257
+ git clone https://github.com/mohdibrahimaiml/epi-recorder.git
258
+ cd epi-recorder
259
+ pip install -e ".[dev]"
260
+ pytest
261
+ ```
262
+
263
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
264
+
265
+ ---
266
+
267
+ ## License
268
+
269
+ MIT License. See [LICENSE](./LICENSE).
@@ -0,0 +1,224 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/mohdibrahimaiml/epi-recorder/main/docs/assets/logo.png" alt="EPI Logo" width="180"/>
3
+ <br>
4
+ <h1 align="center">EPI</h1>
5
+ <p align="center"><strong>Verifiable Execution Evidence for AI Systems / AI Agents</strong></p>
6
+ <p align="center">
7
+ <em>A portable, cryptographically sealed artifact format for AI execution records.</em>
8
+ </p>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://pypi.org/project/epi-recorder/"><img src="https://img.shields.io/pypi/v/epi-recorder?style=for-the-badge&color=00d4ff&label=PyPI" alt="PyPI"/></a>
13
+ <a href="https://github.com/mohdibrahimaiml/epi-recorder"><img src="https://img.shields.io/badge/python-3.11%2B-blue?style=for-the-badge&logo=python&logoColor=white" alt="Python"/></a>
14
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License"/></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ ## What is EPI?
20
+
21
+ EPI (Evidence Package for AI) is a **file format** for capturing and verifying AI execution evidence.
22
+
23
+ An `.epi` file is to AI execution what PDF is to documents:
24
+ - **Self-contained** — prompts, responses, environment, viewer — all in one file
25
+ - **Universally viewable** — opens in any browser, no software required
26
+ - **Tamper-evident** — Ed25519 signatures prove the record wasn't altered
27
+
28
+ EPI is designed for **adversarial review**: audits, incident response, compliance, litigation.
29
+
30
+ ---
31
+
32
+ ## Design Guarantees
33
+
34
+ EPI artifacts provide the following guarantees:
35
+
36
+ | Guarantee | Implementation |
37
+ |:----------|:---------------|
38
+ | **Explicitness** | Evidence capture is intentional and reviewable in source code |
39
+ | **Portability** | Single file, no external dependencies, works offline |
40
+ | **Offline Verifiability** | Signature verification requires no network or cloud services |
41
+ | **Adversarial Review** | Format assumes the reviewer does not trust the producer |
42
+
43
+ These are not features. They are **constraints** that define what EPI is.
44
+
45
+ ---
46
+
47
+ ## Quick Start
48
+
49
+ ```bash
50
+ pip install epi-recorder
51
+ ```
52
+
53
+ ### Capture Evidence (Explicit API)
54
+
55
+ ```python
56
+ from epi_recorder import record
57
+
58
+ with record("evidence.epi") as epi:
59
+ response = client.chat.completions.create(model="gpt-4", messages=[...])
60
+ epi.log_llm_call(response) # Explicit capture
61
+ ```
62
+
63
+ ### Capture Evidence (Wrapper Client)
64
+
65
+ ```python
66
+ from epi_recorder import record, wrap_openai
67
+ from openai import OpenAI
68
+
69
+ client = wrap_openai(OpenAI())
70
+
71
+ with record("evidence.epi"):
72
+ response = client.chat.completions.create(...) # Captured via wrapper
73
+ ```
74
+
75
+ ### Verify Evidence
76
+
77
+ ```bash
78
+ epi verify evidence.epi
79
+ ```
80
+
81
+ ---
82
+
83
+ ## The `.epi` Artifact Format
84
+
85
+ An `.epi` file is a ZIP archive with a defined structure. See [docs/EPI-SPEC.md](docs/EPI-SPEC.md) for the full specification.
86
+
87
+ ```
88
+ evidence.epi
89
+ ├── mimetype # "application/epi+zip"
90
+ ├── manifest.json # Metadata + Ed25519 signature
91
+ ├── steps.jsonl # Execution steps (NDJSON)
92
+ ├── env.json # Runtime environment snapshot
93
+ └── viewer/
94
+ └── index.html # Self-contained offline viewer
95
+ ```
96
+
97
+ The embedded viewer allows any recipient to:
98
+ - View the complete execution timeline
99
+ - Verify cryptographic integrity
100
+ - Inspect individual steps
101
+
102
+ No software installation required.
103
+
104
+ ---
105
+
106
+ ## CLI Reference
107
+
108
+ ### Primary Commands
109
+
110
+ | Command | Purpose |
111
+ |:--------|:--------|
112
+ | `epi run <script.py>` | Capture execution evidence to `.epi` |
113
+ | `epi verify <file.epi>` | Verify artifact integrity and signature |
114
+ | `epi view <file.epi>` | Open artifact in browser viewer |
115
+ | `epi keys list` | Manage signing keys |
116
+
117
+ ### Secondary Tools
118
+
119
+ These tools consume evidence artifacts for analysis:
120
+
121
+ | Command | Purpose |
122
+ |:--------|:--------|
123
+ | `epi debug <file.epi>` | Heuristic analysis (loops, errors, inefficiencies) |
124
+ | `epi chat <file.epi>` | Natural language querying via LLM |
125
+
126
+ > **Note:** `debug` and `chat` are convenience tools built on top of the evidence format.
127
+ > They are not part of the core specification.
128
+
129
+ ---
130
+
131
+ ## Cryptographic Properties
132
+
133
+ | Property | Implementation |
134
+ |:---------|:---------------|
135
+ | **Signatures** | Ed25519 (RFC 8032) |
136
+ | **Hashing** | SHA-256 content addressing |
137
+ | **Key Storage** | Local keyring, user-controlled |
138
+ | **Verification** | Client-side, zero external dependencies |
139
+
140
+ Signatures are **optional but recommended**. Unsigned artifacts are still valid but cannot prove origin.
141
+
142
+ ---
143
+
144
+ ## When to Use EPI
145
+
146
+ ### Appropriate Use Cases
147
+
148
+ - Post-incident forensics
149
+ - Compliance documentation
150
+ - Audit trails for autonomous systems
151
+ - Reproducibility evidence for research
152
+ - Litigation-grade execution records
153
+
154
+ ### Not Designed For
155
+
156
+ - Real-time monitoring dashboards
157
+ - High-frequency telemetry
158
+ - System health metrics
159
+ - Application performance monitoring
160
+
161
+ EPI produces **artifacts**, not **streams**.
162
+
163
+ ---
164
+
165
+ ## Supported Providers
166
+
167
+ | Provider | Capture Method |
168
+ |:---------|:---------------|
169
+ | OpenAI | Wrapper client or explicit API |
170
+ | Anthropic | Explicit API |
171
+ | Google Gemini | Explicit API |
172
+ | Any HTTP-based LLM | Explicit API via `log_llm_call()` |
173
+
174
+ EPI does not depend on provider-specific integrations. The explicit API works with any response format.
175
+
176
+ ---
177
+
178
+ ## v2.3.0 — Design Correction
179
+
180
+ This release corrects EPI's evidence capture model.
181
+
182
+ | Before (v2.2.x) | After (v2.3.0) |
183
+ |:----------------|:---------------|
184
+ | Implicit monkey-patching | Explicit capture |
185
+ | Fragile to SDK changes | Stable across versions |
186
+ | Hidden instrumentation | Reviewable in source |
187
+
188
+ **Rationale:** Evidence systems must be intentional. Implicit capture was convenient but violated the explicitness guarantee.
189
+
190
+ **Migration:** Replace implicit capture with `epi.log_llm_call(response)` or `wrap_openai()`.
191
+
192
+ **Legacy mode:** `record(legacy_patching=True)` is deprecated and will be removed in v3.0.
193
+
194
+ ---
195
+
196
+ ## Release History
197
+
198
+ | Version | Date | Summary |
199
+ |:--------|:-----|:--------|
200
+ | **2.3.0** | 2026-02-06 | Explicit capture, wrapper clients, design correction |
201
+ | **2.2.0** | 2026-01-30 | SQLite storage, async support, context isolation |
202
+ | **2.1.3** | 2026-01-24 | Gemini capture, evidence querying |
203
+ | **2.1.0** | 2025-12-15 | Initial release |
204
+
205
+ See [CHANGELOG.md](./CHANGELOG.md) for full details.
206
+
207
+ ---
208
+
209
+ ## Contributing
210
+
211
+ ```bash
212
+ git clone https://github.com/mohdibrahimaiml/epi-recorder.git
213
+ cd epi-recorder
214
+ pip install -e ".[dev]"
215
+ pytest
216
+ ```
217
+
218
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
219
+
220
+ ---
221
+
222
+ ## License
223
+
224
+ MIT License. See [LICENSE](./LICENSE).
@@ -0,0 +1,9 @@
1
+ """EPI Analyzer package - Agent mistake detection"""
2
+
3
+ from .detector import MistakeDetector
4
+
5
+ __all__ = ['MistakeDetector']
6
+
7
+
8
+
9
+