halo-record 0.1.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.
- halo_record-0.1.0/LICENSE +204 -0
- halo_record-0.1.0/PKG-INFO +140 -0
- halo_record-0.1.0/README.md +121 -0
- halo_record-0.1.0/pyproject.toml +39 -0
- halo_record-0.1.0/setup.cfg +4 -0
- halo_record-0.1.0/src/halo.py +19 -0
- halo_record-0.1.0/src/halo_record/__init__.py +56 -0
- halo_record-0.1.0/src/halo_record/access.py +239 -0
- halo_record-0.1.0/src/halo_record/anchor.py +163 -0
- halo_record-0.1.0/src/halo_record/canon.py +100 -0
- halo_record-0.1.0/src/halo_record/capture.py +166 -0
- halo_record-0.1.0/src/halo_record/cli.py +258 -0
- halo_record-0.1.0/src/halo_record/demo.py +159 -0
- halo_record-0.1.0/src/halo_record/halo-record.schema.json +146 -0
- halo_record-0.1.0/src/halo_record/hook.py +134 -0
- halo_record-0.1.0/src/halo_record/integrations/__init__.py +30 -0
- halo_record-0.1.0/src/halo_record/integrations/_common.py +91 -0
- halo_record-0.1.0/src/halo_record/integrations/gateway.py +77 -0
- halo_record-0.1.0/src/halo_record/integrations/langchain.py +83 -0
- halo_record-0.1.0/src/halo_record/integrations/langfuse.py +89 -0
- halo_record-0.1.0/src/halo_record/integrations/litellm.py +108 -0
- halo_record-0.1.0/src/halo_record/integrations/mcp.py +108 -0
- halo_record-0.1.0/src/halo_record/integrations/openai_agents.py +72 -0
- halo_record-0.1.0/src/halo_record/integrations/otel.py +139 -0
- halo_record-0.1.0/src/halo_record/record.py +241 -0
- halo_record-0.1.0/src/halo_record/redact.py +72 -0
- halo_record-0.1.0/src/halo_record/report.py +490 -0
- halo_record-0.1.0/src/halo_record/serve.py +405 -0
- halo_record-0.1.0/src/halo_record/session.py +28 -0
- halo_record-0.1.0/src/halo_record/trace.py +102 -0
- halo_record-0.1.0/src/halo_record/verify.py +106 -0
- halo_record-0.1.0/src/halo_record/witness.py +229 -0
- halo_record-0.1.0/src/halo_record.egg-info/PKG-INFO +140 -0
- halo_record-0.1.0/src/halo_record.egg-info/SOURCES.txt +47 -0
- halo_record-0.1.0/src/halo_record.egg-info/dependency_links.txt +1 -0
- halo_record-0.1.0/src/halo_record.egg-info/entry_points.txt +2 -0
- halo_record-0.1.0/src/halo_record.egg-info/top_level.txt +2 -0
- halo_record-0.1.0/tests/test_access.py +114 -0
- halo_record-0.1.0/tests/test_anchor.py +110 -0
- halo_record-0.1.0/tests/test_canon.py +84 -0
- halo_record-0.1.0/tests/test_concurrency.py +49 -0
- halo_record-0.1.0/tests/test_console_api.py +82 -0
- halo_record-0.1.0/tests/test_integrations.py +196 -0
- halo_record-0.1.0/tests/test_model_call.py +42 -0
- halo_record-0.1.0/tests/test_record_verify.py +113 -0
- halo_record-0.1.0/tests/test_report.py +87 -0
- halo_record-0.1.0/tests/test_tenant.py +53 -0
- halo_record-0.1.0/tests/test_trace.py +107 -0
- halo_record-0.1.0/tests/test_witness_http.py +120 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
203
|
+
|
|
204
|
+
Copyright 2026 Brian Kuan
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: halo-record
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open, tamper-evident runtime records for AI agents: the Halo Runtime Record format, with a dependency-free conformance verifier.
|
|
5
|
+
Author: Brian Kuan
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://halo.dev
|
|
8
|
+
Project-URL: Specification, https://halo.dev/spec/v0.1/
|
|
9
|
+
Keywords: ai,agents,audit,tamper-evident,attestation,compliance
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Topic :: Security
|
|
14
|
+
Classifier: Topic :: System :: Logging
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# halo-record
|
|
21
|
+
|
|
22
|
+
Tamper-evident **runtime records for AI agents**: the audit trail the vendor runs but cannot edit.
|
|
23
|
+
|
|
24
|
+
Every action your agent takes (tool calls, model calls, data access, approvals) becomes one record in an append-only, hash-chained log. Any party can verify the log was never altered, without trusting whoever produced it. When a customer's security team asks "what did your agent do with our data?", you hand them a link instead of a paragraph. Security reviews already ask AI questions next to the SOC 2 checklist, and today a written assurance still passes. The bet behind this project is that it won't for long.
|
|
25
|
+
|
|
26
|
+
The record format is open and free to implement. This package is the reference implementation: recorder, verifier, witness client, and report server.
|
|
27
|
+
|
|
28
|
+
## Why you can trust this code
|
|
29
|
+
|
|
30
|
+
You are being asked to put a recorder inside your agent. You should not take that on faith:
|
|
31
|
+
|
|
32
|
+
- **Zero runtime dependencies.** Standard library only. `pip install halo-record` installs exactly one package.
|
|
33
|
+
- **No network calls**, except the witness, which is opt-in and receives only a record count and a chain fingerprint. Record contents never leave your infrastructure.
|
|
34
|
+
- **Raw inputs never enter a record.** Arguments are hashed and summarized through a redaction pass before writing. Secrets and personal data stay out by construction.
|
|
35
|
+
- **Small enough to audit.** ~3,800 lines of Python. Read all of it in an afternoon.
|
|
36
|
+
- **Apache-2.0.**
|
|
37
|
+
|
|
38
|
+
## 60-second demo
|
|
39
|
+
|
|
40
|
+
No agent required. With [uv](https://docs.astral.sh/uv/), nothing to install:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
uvx --from halo-record halo demo --serve
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
or the classic way:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
pip install halo-record
|
|
50
|
+
halo demo --serve
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Either one scaffolds a fictional support-agent vendor with two customers, witnesses the chains, serves their gated Runtime Reports, and opens the operator console in your browser. Then try the tamper test: delete a line from one of the `.jsonl` files and reload. The report catches it.
|
|
54
|
+
|
|
55
|
+
## Record your own agent
|
|
56
|
+
|
|
57
|
+
One line at the boundary:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from halo import trace
|
|
61
|
+
|
|
62
|
+
agent = trace(run_my_agent) # wraps your entrypoint; records every tool call
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
or use the adapter for what you already run (see the matrix below). Then render the report:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
halo report audit.jsonl -o report.html # one chain -> self-verifying HTML
|
|
69
|
+
halo serve ./records --port 8721 # all tenants, gated per customer
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The quickstart ends when you are looking at your own agent's Runtime Report in a browser. If you got a JSONL file and no report, something is wrong: open an issue.
|
|
73
|
+
|
|
74
|
+
## Connect to what you already run
|
|
75
|
+
|
|
76
|
+
| Captured at the boundary | Ingested from existing telemetry |
|
|
77
|
+
|---|---|
|
|
78
|
+
| Native recorder (`from halo import trace`) | OpenTelemetry GenAI spans |
|
|
79
|
+
| MCP interceptor | LiteLLM callbacks |
|
|
80
|
+
| LangChain / LangGraph callback | Langfuse export |
|
|
81
|
+
| OpenAI Agents SDK hooks | Any gateway / reverse-proxy log |
|
|
82
|
+
| Claude Code / Claude Agent SDK hook | |
|
|
83
|
+
|
|
84
|
+
Every record carries a `source` tag, so the report discloses how each piece of evidence was collected. Captured and ingested records live in the same chain.
|
|
85
|
+
|
|
86
|
+
Anything that emits OpenTelemetry GenAI spans (CrewAI, LlamaIndex, and most agent frameworks with OTel instrumentation) lands in the chain through the OTel adapter, and the [TypeScript package](https://github.com/bkuan001/halo-record-ts) ships native adapters for the Vercel AI SDK and the JS agent ecosystem. Missing an adapter for your stack? Open an issue. Most adapters are about a hundred lines.
|
|
87
|
+
|
|
88
|
+
## Integrity vs. completeness (read this part)
|
|
89
|
+
|
|
90
|
+
A self-held chain proves **integrity**: nothing was edited or reordered after the fact. It cannot prove **completeness**: the operator of a recorder can delete the bad day and re-seal the chain, or never write a record at all, and the chain stays internally consistent.
|
|
91
|
+
|
|
92
|
+
Completeness requires a party outside the operator's control holding periodic fingerprints of the chain (a count and a head hash, nothing else). That is the witness:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
halo anchor audit.jsonl --witness witness.jsonl # local witness file
|
|
96
|
+
halo anchor audit.jsonl --check # completeness verdict
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Anyone can run a witness. A witness you run yourself proves integrity to *you*; proving completeness to *your customer* requires a witness they have reason to trust. The protocol is open either way.
|
|
100
|
+
|
|
101
|
+
A hosted, recognized witness is how this project will sustain itself. Early access: bkuan001@gmail.com.
|
|
102
|
+
|
|
103
|
+
## Where this sits in a compliance stack
|
|
104
|
+
|
|
105
|
+
halo-record is an evidence layer, not a certification. It produces the artifact that assessment frameworks keep asking for in different words:
|
|
106
|
+
|
|
107
|
+
- **Security questionnaires and SOC 2 reviews:** answer the AI sections with a verifiable Runtime Report instead of screenshots and prose.
|
|
108
|
+
- **AIUC-1:** continuous runtime evidence for agent-behavior requirements, instead of evidence reconstructed at audit time.
|
|
109
|
+
- **EU AI Act:** logging and record-keeping obligations for high-risk AI systems.
|
|
110
|
+
- **ISO 42001 / NIST AI RMF:** the operational evidence behind management-system controls.
|
|
111
|
+
|
|
112
|
+
None of this certifies anything by itself. It gives your assessor something verifiable to look at.
|
|
113
|
+
|
|
114
|
+
## CLI
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
halo verify validate schema + hash chain (non-zero exit on failure; CI-friendly)
|
|
118
|
+
halo report render a chain as a self-verifying HTML Runtime Report
|
|
119
|
+
halo serve serve per-tenant reports over HTTP, access-scoped per customer
|
|
120
|
+
halo grant designate a report recipient (email or domain)
|
|
121
|
+
halo anchor witness a chain head, or --check completeness
|
|
122
|
+
halo demo scaffold the full vendor demo (record -> witness -> gated report)
|
|
123
|
+
halo sample emit a valid example log
|
|
124
|
+
halo hash canonical sha256 of a JSON value
|
|
125
|
+
halo hook Claude Code PostToolUse hook
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Integrity model
|
|
129
|
+
|
|
130
|
+
To compute a record's hash: take the record excluding `integrity.hash`, with `integrity.prev_hash` set to the previous record's hash; canonicalize with RFC 8785 (JSON Canonicalization Scheme); SHA-256 the bytes. The first record's `prev_hash` is 64 zeros. Verification recomputes every hash and checks every link. No secret required; that is the point.
|
|
131
|
+
|
|
132
|
+
Full field reference: [`halo-record.schema.json`](src/halo_record/halo-record.schema.json).
|
|
133
|
+
|
|
134
|
+
## TypeScript
|
|
135
|
+
|
|
136
|
+
The same recorder ships for Node: [`halo-record-ts`](https://github.com/bkuan001/halo-record-ts). Same chain format, same witness protocol. Records written in either language verify with either verifier.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
Apache-2.0
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# halo-record
|
|
2
|
+
|
|
3
|
+
Tamper-evident **runtime records for AI agents**: the audit trail the vendor runs but cannot edit.
|
|
4
|
+
|
|
5
|
+
Every action your agent takes (tool calls, model calls, data access, approvals) becomes one record in an append-only, hash-chained log. Any party can verify the log was never altered, without trusting whoever produced it. When a customer's security team asks "what did your agent do with our data?", you hand them a link instead of a paragraph. Security reviews already ask AI questions next to the SOC 2 checklist, and today a written assurance still passes. The bet behind this project is that it won't for long.
|
|
6
|
+
|
|
7
|
+
The record format is open and free to implement. This package is the reference implementation: recorder, verifier, witness client, and report server.
|
|
8
|
+
|
|
9
|
+
## Why you can trust this code
|
|
10
|
+
|
|
11
|
+
You are being asked to put a recorder inside your agent. You should not take that on faith:
|
|
12
|
+
|
|
13
|
+
- **Zero runtime dependencies.** Standard library only. `pip install halo-record` installs exactly one package.
|
|
14
|
+
- **No network calls**, except the witness, which is opt-in and receives only a record count and a chain fingerprint. Record contents never leave your infrastructure.
|
|
15
|
+
- **Raw inputs never enter a record.** Arguments are hashed and summarized through a redaction pass before writing. Secrets and personal data stay out by construction.
|
|
16
|
+
- **Small enough to audit.** ~3,800 lines of Python. Read all of it in an afternoon.
|
|
17
|
+
- **Apache-2.0.**
|
|
18
|
+
|
|
19
|
+
## 60-second demo
|
|
20
|
+
|
|
21
|
+
No agent required. With [uv](https://docs.astral.sh/uv/), nothing to install:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
uvx --from halo-record halo demo --serve
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
or the classic way:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
pip install halo-record
|
|
31
|
+
halo demo --serve
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Either one scaffolds a fictional support-agent vendor with two customers, witnesses the chains, serves their gated Runtime Reports, and opens the operator console in your browser. Then try the tamper test: delete a line from one of the `.jsonl` files and reload. The report catches it.
|
|
35
|
+
|
|
36
|
+
## Record your own agent
|
|
37
|
+
|
|
38
|
+
One line at the boundary:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from halo import trace
|
|
42
|
+
|
|
43
|
+
agent = trace(run_my_agent) # wraps your entrypoint; records every tool call
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
or use the adapter for what you already run (see the matrix below). Then render the report:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
halo report audit.jsonl -o report.html # one chain -> self-verifying HTML
|
|
50
|
+
halo serve ./records --port 8721 # all tenants, gated per customer
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The quickstart ends when you are looking at your own agent's Runtime Report in a browser. If you got a JSONL file and no report, something is wrong: open an issue.
|
|
54
|
+
|
|
55
|
+
## Connect to what you already run
|
|
56
|
+
|
|
57
|
+
| Captured at the boundary | Ingested from existing telemetry |
|
|
58
|
+
|---|---|
|
|
59
|
+
| Native recorder (`from halo import trace`) | OpenTelemetry GenAI spans |
|
|
60
|
+
| MCP interceptor | LiteLLM callbacks |
|
|
61
|
+
| LangChain / LangGraph callback | Langfuse export |
|
|
62
|
+
| OpenAI Agents SDK hooks | Any gateway / reverse-proxy log |
|
|
63
|
+
| Claude Code / Claude Agent SDK hook | |
|
|
64
|
+
|
|
65
|
+
Every record carries a `source` tag, so the report discloses how each piece of evidence was collected. Captured and ingested records live in the same chain.
|
|
66
|
+
|
|
67
|
+
Anything that emits OpenTelemetry GenAI spans (CrewAI, LlamaIndex, and most agent frameworks with OTel instrumentation) lands in the chain through the OTel adapter, and the [TypeScript package](https://github.com/bkuan001/halo-record-ts) ships native adapters for the Vercel AI SDK and the JS agent ecosystem. Missing an adapter for your stack? Open an issue. Most adapters are about a hundred lines.
|
|
68
|
+
|
|
69
|
+
## Integrity vs. completeness (read this part)
|
|
70
|
+
|
|
71
|
+
A self-held chain proves **integrity**: nothing was edited or reordered after the fact. It cannot prove **completeness**: the operator of a recorder can delete the bad day and re-seal the chain, or never write a record at all, and the chain stays internally consistent.
|
|
72
|
+
|
|
73
|
+
Completeness requires a party outside the operator's control holding periodic fingerprints of the chain (a count and a head hash, nothing else). That is the witness:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
halo anchor audit.jsonl --witness witness.jsonl # local witness file
|
|
77
|
+
halo anchor audit.jsonl --check # completeness verdict
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Anyone can run a witness. A witness you run yourself proves integrity to *you*; proving completeness to *your customer* requires a witness they have reason to trust. The protocol is open either way.
|
|
81
|
+
|
|
82
|
+
A hosted, recognized witness is how this project will sustain itself. Early access: bkuan001@gmail.com.
|
|
83
|
+
|
|
84
|
+
## Where this sits in a compliance stack
|
|
85
|
+
|
|
86
|
+
halo-record is an evidence layer, not a certification. It produces the artifact that assessment frameworks keep asking for in different words:
|
|
87
|
+
|
|
88
|
+
- **Security questionnaires and SOC 2 reviews:** answer the AI sections with a verifiable Runtime Report instead of screenshots and prose.
|
|
89
|
+
- **AIUC-1:** continuous runtime evidence for agent-behavior requirements, instead of evidence reconstructed at audit time.
|
|
90
|
+
- **EU AI Act:** logging and record-keeping obligations for high-risk AI systems.
|
|
91
|
+
- **ISO 42001 / NIST AI RMF:** the operational evidence behind management-system controls.
|
|
92
|
+
|
|
93
|
+
None of this certifies anything by itself. It gives your assessor something verifiable to look at.
|
|
94
|
+
|
|
95
|
+
## CLI
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
halo verify validate schema + hash chain (non-zero exit on failure; CI-friendly)
|
|
99
|
+
halo report render a chain as a self-verifying HTML Runtime Report
|
|
100
|
+
halo serve serve per-tenant reports over HTTP, access-scoped per customer
|
|
101
|
+
halo grant designate a report recipient (email or domain)
|
|
102
|
+
halo anchor witness a chain head, or --check completeness
|
|
103
|
+
halo demo scaffold the full vendor demo (record -> witness -> gated report)
|
|
104
|
+
halo sample emit a valid example log
|
|
105
|
+
halo hash canonical sha256 of a JSON value
|
|
106
|
+
halo hook Claude Code PostToolUse hook
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Integrity model
|
|
110
|
+
|
|
111
|
+
To compute a record's hash: take the record excluding `integrity.hash`, with `integrity.prev_hash` set to the previous record's hash; canonicalize with RFC 8785 (JSON Canonicalization Scheme); SHA-256 the bytes. The first record's `prev_hash` is 64 zeros. Verification recomputes every hash and checks every link. No secret required; that is the point.
|
|
112
|
+
|
|
113
|
+
Full field reference: [`halo-record.schema.json`](src/halo_record/halo-record.schema.json).
|
|
114
|
+
|
|
115
|
+
## TypeScript
|
|
116
|
+
|
|
117
|
+
The same recorder ships for Node: [`halo-record-ts`](https://github.com/bkuan001/halo-record-ts). Same chain format, same witness protocol. Records written in either language verify with either verifier.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
Apache-2.0
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "halo-record"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Open, tamper-evident runtime records for AI agents: the Halo Runtime Record format, with a dependency-free conformance verifier."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = { text = "Apache-2.0" }
|
|
12
|
+
authors = [{ name = "Brian Kuan" }]
|
|
13
|
+
keywords = ["ai", "agents", "audit", "tamper-evident", "attestation", "compliance"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: Apache Software License",
|
|
18
|
+
"Topic :: Security",
|
|
19
|
+
"Topic :: System :: Logging",
|
|
20
|
+
]
|
|
21
|
+
dependencies = []
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
halo = "halo_record.cli:main"
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://halo.dev"
|
|
28
|
+
Specification = "https://halo.dev/spec/v0.1/"
|
|
29
|
+
|
|
30
|
+
[tool.setuptools]
|
|
31
|
+
# Ship the top-level ``halo`` shim alongside the package so the hero snippet
|
|
32
|
+
# ``from halo import trace`` resolves from a plain ``pip install``.
|
|
33
|
+
py-modules = ["halo"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.package-data]
|
|
39
|
+
halo_record = ["*.json"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""``from halo import trace`` — the one-import front door.
|
|
2
|
+
|
|
3
|
+
The package is :mod:`halo_record`; this thin shim lets the hero snippet read
|
|
4
|
+
exactly as advertised::
|
|
5
|
+
|
|
6
|
+
from halo import trace
|
|
7
|
+
|
|
8
|
+
agent = trace(run, profile="acme-support")
|
|
9
|
+
agent(...)
|
|
10
|
+
|
|
11
|
+
Everything re-exported here lives in and is documented under ``halo_record``;
|
|
12
|
+
this module adds no behavior, only the shorter name.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from halo_record import * # noqa: F401,F403
|
|
16
|
+
from halo_record import __all__ as _all
|
|
17
|
+
from halo_record import __version__
|
|
18
|
+
|
|
19
|
+
__all__ = list(_all)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""halo-record — open, tamper-evident runtime records for AI agents.
|
|
2
|
+
|
|
3
|
+
Public API:
|
|
4
|
+
|
|
5
|
+
from halo_record import Recorder, build, verify_log
|
|
6
|
+
|
|
7
|
+
rec = Recorder("audit.jsonl")
|
|
8
|
+
rec.append(build("tool_call", "security", tool="Read",
|
|
9
|
+
tool_input={"path": "secrets.env"}))
|
|
10
|
+
|
|
11
|
+
verify_log("audit.jsonl") # -> True if schema + hash chain are intact
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
__version__ = "0.1.0"
|
|
15
|
+
|
|
16
|
+
from .canon import canon, compute_hash, input_hash, GENESIS_PREV
|
|
17
|
+
from .capture import record, record_call, derive_outcome
|
|
18
|
+
from .record import Recorder, TenantRecorder, build, SCHEMA_VERSION
|
|
19
|
+
from .redact import scan, redact_text, redact_sample
|
|
20
|
+
from .verify import verify_log, validate_record, load_schema
|
|
21
|
+
from .anchor import Notary, checkpoint, verify_completeness
|
|
22
|
+
from .witness import anchor_remote, fetch_checkpoints
|
|
23
|
+
from .report import render, write_report
|
|
24
|
+
from .session import current_recorder, bind_recorder, reset_recorder
|
|
25
|
+
from .trace import trace
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"__version__",
|
|
29
|
+
"SCHEMA_VERSION",
|
|
30
|
+
"Recorder",
|
|
31
|
+
"build",
|
|
32
|
+
"trace",
|
|
33
|
+
"current_recorder",
|
|
34
|
+
"bind_recorder",
|
|
35
|
+
"reset_recorder",
|
|
36
|
+
"record",
|
|
37
|
+
"record_call",
|
|
38
|
+
"derive_outcome",
|
|
39
|
+
"verify_log",
|
|
40
|
+
"validate_record",
|
|
41
|
+
"load_schema",
|
|
42
|
+
"scan",
|
|
43
|
+
"redact_text",
|
|
44
|
+
"redact_sample",
|
|
45
|
+
"canon",
|
|
46
|
+
"compute_hash",
|
|
47
|
+
"input_hash",
|
|
48
|
+
"GENESIS_PREV",
|
|
49
|
+
"Notary",
|
|
50
|
+
"checkpoint",
|
|
51
|
+
"verify_completeness",
|
|
52
|
+
"anchor_remote",
|
|
53
|
+
"fetch_checkpoints",
|
|
54
|
+
"render",
|
|
55
|
+
"write_report",
|
|
56
|
+
]
|