anthropic-ledgerproof 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.
Files changed (24) hide show
  1. anthropic_ledgerproof-0.1.0/LICENSE +189 -0
  2. anthropic_ledgerproof-0.1.0/PKG-INFO +109 -0
  3. anthropic_ledgerproof-0.1.0/README.md +78 -0
  4. anthropic_ledgerproof-0.1.0/anthropic_ledgerproof.egg-info/PKG-INFO +109 -0
  5. anthropic_ledgerproof-0.1.0/anthropic_ledgerproof.egg-info/SOURCES.txt +22 -0
  6. anthropic_ledgerproof-0.1.0/anthropic_ledgerproof.egg-info/dependency_links.txt +1 -0
  7. anthropic_ledgerproof-0.1.0/anthropic_ledgerproof.egg-info/requires.txt +8 -0
  8. anthropic_ledgerproof-0.1.0/anthropic_ledgerproof.egg-info/top_level.txt +1 -0
  9. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/__init__.py +76 -0
  10. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/async_client_wrapper.py +126 -0
  11. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/canonical.py +68 -0
  12. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/client_wrapper.py +290 -0
  13. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/decorator.py +97 -0
  14. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/emitter.py +102 -0
  15. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/manual.py +171 -0
  16. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/schema.py +128 -0
  17. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/signer.py +123 -0
  18. anthropic_ledgerproof-0.1.0/ledgerproof_anthropic/version.py +1 -0
  19. anthropic_ledgerproof-0.1.0/pyproject.toml +51 -0
  20. anthropic_ledgerproof-0.1.0/setup.cfg +4 -0
  21. anthropic_ledgerproof-0.1.0/tests/test_canonical.py +48 -0
  22. anthropic_ledgerproof-0.1.0/tests/test_client_wrapper.py +182 -0
  23. anthropic_ledgerproof-0.1.0/tests/test_emitter.py +55 -0
  24. anthropic_ledgerproof-0.1.0/tests/test_schema.py +100 -0
@@ -0,0 +1,189 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept warranty
167
+ or additional liability for, or impose any obligations consistent
168
+ with, this License. However, in accepting such obligations, You may
169
+ act only on Your own behalf and on Your sole responsibility, not on
170
+ behalf of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ Copyright 2026 LedgerProof Foundation (in formation)
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: anthropic-ledgerproof
3
+ Version: 0.1.0
4
+ Summary: LedgerProof adapter for the Anthropic Python SDK. Side-channel transparency receipts for EU AI Act Article 50.
5
+ Author: LedgerProof Foundation (in formation)
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://ledgerproof.org
8
+ Project-URL: Repository, https://github.com/ledgerproof/ledgerproof
9
+ Project-URL: Documentation, https://docs.ledgerproof.org
10
+ Keywords: ledgerproof,anthropic,claude,eu-ai-act,article-50,transparency,receipts
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Security :: Cryptography
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: anthropic>=0.40
24
+ Requires-Dist: cryptography>=41
25
+ Requires-Dist: cbor2>=5.0
26
+ Requires-Dist: pydantic>=2.0
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=7.0; extra == "test"
29
+ Requires-Dist: pytest-asyncio>=0.21; extra == "test"
30
+ Dynamic: license-file
31
+
32
+ # ledgerproof-anthropic
33
+
34
+ LedgerProof adapter for the [Anthropic Python SDK](https://github.com/anthropics/anthropic-sdk-python).
35
+
36
+ Emits **side-channel cryptographic transparency receipts** for AI-touched interactions, suitable as an evidence layer
37
+ for **EU AI Act Article 50** (transparency obligations for providers and deployers of AI systems).
38
+
39
+ This adapter works with anyone using the Anthropic SDK directly, including users of:
40
+
41
+ - `anthropic.Anthropic` / `anthropic.AsyncAnthropic` clients
42
+ - Claude Code (which uses the Anthropic SDK under the hood)
43
+ - The Claude Agent SDK (tool-use receipts via `agent_action/v1`)
44
+
45
+ ## 5-minute quickstart
46
+
47
+ ```bash
48
+ pip install ledgerproof-anthropic
49
+ export ANTHROPIC_API_KEY=sk-ant-...
50
+ ```
51
+
52
+ ```python
53
+ from ledgerproof_anthropic import LedgerProofAnthropic, LogEmitter
54
+
55
+ client = LedgerProofAnthropic(
56
+ deployer_id="acme-corp-eu",
57
+ emitter=LogEmitter(),
58
+ )
59
+
60
+ response = client.messages.create(
61
+ model="claude-opus-4-1",
62
+ max_tokens=256,
63
+ messages=[{"role": "user", "content": "Hello"}],
64
+ )
65
+
66
+ print(response.content[0].text)
67
+ # Receipt has already been emitted to the log emitter side-channel.
68
+ ```
69
+
70
+ The Anthropic response object is returned **unchanged**. The receipt is emitted to the side channel only.
71
+
72
+ ## Three integration patterns
73
+
74
+ 1. **Client wrapper** (recommended) — `LedgerProofAnthropic` wraps `anthropic.Anthropic` and intercepts
75
+ `messages.create()`. Sync, async, streaming and non-streaming all supported.
76
+ 2. **Decorator** — `@lpr_track(deployer_id="...")` for user-defined functions that wrap Anthropic calls.
77
+ 3. **Manual emission** — `emit_receipt(response, deployer_id, regulatory_context)` for full control.
78
+
79
+ See `examples/` for runnable code.
80
+
81
+ ## Architectural discipline (C1–C8)
82
+
83
+ This adapter is implemented under the LedgerProof protocol's load-bearing constraints:
84
+
85
+ - **C1**: No claim of regulator endorsement. No claim of Article 40 presumption of conformity.
86
+ - **C4**: Local verification only. The adapter does **not** phone home to LedgerProof servers during normal operation.
87
+ - **C6**: Stream-aware signing. Streaming messages are signed using an incremental SHA-256 over text deltas.
88
+ - **C7**: Side-channel emission only. The adapter **cannot and does not modify** the Anthropic response payload.
89
+
90
+ ## Scope disclaimer
91
+
92
+ LedgerProof provides an **evidence layer for Article 50 transparency obligations only**.
93
+
94
+ It does **not** cover:
95
+
96
+ - Article 9 (risk management system)
97
+ - Article 10 (data and data governance)
98
+ - Article 13 (transparency and information to deployers)
99
+ - Article 15 (accuracy, robustness, and cybersecurity)
100
+ - Article 72 (post-market monitoring)
101
+
102
+ LedgerProof does **not** confer presumption of conformity under Article 40. LedgerProof is not endorsed by the
103
+ European Commission, the AI Office, any national competent authority, or Anthropic, PBC.
104
+
105
+ This adapter wraps the official Anthropic Python SDK; it is not affiliated with Anthropic.
106
+
107
+ ## License
108
+
109
+ Apache 2.0. Copyright 2026 LedgerProof Foundation (in formation: US 501(c)(3) Delaware + Dutch Stichting EU subsidiary).
@@ -0,0 +1,78 @@
1
+ # ledgerproof-anthropic
2
+
3
+ LedgerProof adapter for the [Anthropic Python SDK](https://github.com/anthropics/anthropic-sdk-python).
4
+
5
+ Emits **side-channel cryptographic transparency receipts** for AI-touched interactions, suitable as an evidence layer
6
+ for **EU AI Act Article 50** (transparency obligations for providers and deployers of AI systems).
7
+
8
+ This adapter works with anyone using the Anthropic SDK directly, including users of:
9
+
10
+ - `anthropic.Anthropic` / `anthropic.AsyncAnthropic` clients
11
+ - Claude Code (which uses the Anthropic SDK under the hood)
12
+ - The Claude Agent SDK (tool-use receipts via `agent_action/v1`)
13
+
14
+ ## 5-minute quickstart
15
+
16
+ ```bash
17
+ pip install ledgerproof-anthropic
18
+ export ANTHROPIC_API_KEY=sk-ant-...
19
+ ```
20
+
21
+ ```python
22
+ from ledgerproof_anthropic import LedgerProofAnthropic, LogEmitter
23
+
24
+ client = LedgerProofAnthropic(
25
+ deployer_id="acme-corp-eu",
26
+ emitter=LogEmitter(),
27
+ )
28
+
29
+ response = client.messages.create(
30
+ model="claude-opus-4-1",
31
+ max_tokens=256,
32
+ messages=[{"role": "user", "content": "Hello"}],
33
+ )
34
+
35
+ print(response.content[0].text)
36
+ # Receipt has already been emitted to the log emitter side-channel.
37
+ ```
38
+
39
+ The Anthropic response object is returned **unchanged**. The receipt is emitted to the side channel only.
40
+
41
+ ## Three integration patterns
42
+
43
+ 1. **Client wrapper** (recommended) — `LedgerProofAnthropic` wraps `anthropic.Anthropic` and intercepts
44
+ `messages.create()`. Sync, async, streaming and non-streaming all supported.
45
+ 2. **Decorator** — `@lpr_track(deployer_id="...")` for user-defined functions that wrap Anthropic calls.
46
+ 3. **Manual emission** — `emit_receipt(response, deployer_id, regulatory_context)` for full control.
47
+
48
+ See `examples/` for runnable code.
49
+
50
+ ## Architectural discipline (C1–C8)
51
+
52
+ This adapter is implemented under the LedgerProof protocol's load-bearing constraints:
53
+
54
+ - **C1**: No claim of regulator endorsement. No claim of Article 40 presumption of conformity.
55
+ - **C4**: Local verification only. The adapter does **not** phone home to LedgerProof servers during normal operation.
56
+ - **C6**: Stream-aware signing. Streaming messages are signed using an incremental SHA-256 over text deltas.
57
+ - **C7**: Side-channel emission only. The adapter **cannot and does not modify** the Anthropic response payload.
58
+
59
+ ## Scope disclaimer
60
+
61
+ LedgerProof provides an **evidence layer for Article 50 transparency obligations only**.
62
+
63
+ It does **not** cover:
64
+
65
+ - Article 9 (risk management system)
66
+ - Article 10 (data and data governance)
67
+ - Article 13 (transparency and information to deployers)
68
+ - Article 15 (accuracy, robustness, and cybersecurity)
69
+ - Article 72 (post-market monitoring)
70
+
71
+ LedgerProof does **not** confer presumption of conformity under Article 40. LedgerProof is not endorsed by the
72
+ European Commission, the AI Office, any national competent authority, or Anthropic, PBC.
73
+
74
+ This adapter wraps the official Anthropic Python SDK; it is not affiliated with Anthropic.
75
+
76
+ ## License
77
+
78
+ Apache 2.0. Copyright 2026 LedgerProof Foundation (in formation: US 501(c)(3) Delaware + Dutch Stichting EU subsidiary).
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: anthropic-ledgerproof
3
+ Version: 0.1.0
4
+ Summary: LedgerProof adapter for the Anthropic Python SDK. Side-channel transparency receipts for EU AI Act Article 50.
5
+ Author: LedgerProof Foundation (in formation)
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://ledgerproof.org
8
+ Project-URL: Repository, https://github.com/ledgerproof/ledgerproof
9
+ Project-URL: Documentation, https://docs.ledgerproof.org
10
+ Keywords: ledgerproof,anthropic,claude,eu-ai-act,article-50,transparency,receipts
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Security :: Cryptography
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: anthropic>=0.40
24
+ Requires-Dist: cryptography>=41
25
+ Requires-Dist: cbor2>=5.0
26
+ Requires-Dist: pydantic>=2.0
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=7.0; extra == "test"
29
+ Requires-Dist: pytest-asyncio>=0.21; extra == "test"
30
+ Dynamic: license-file
31
+
32
+ # ledgerproof-anthropic
33
+
34
+ LedgerProof adapter for the [Anthropic Python SDK](https://github.com/anthropics/anthropic-sdk-python).
35
+
36
+ Emits **side-channel cryptographic transparency receipts** for AI-touched interactions, suitable as an evidence layer
37
+ for **EU AI Act Article 50** (transparency obligations for providers and deployers of AI systems).
38
+
39
+ This adapter works with anyone using the Anthropic SDK directly, including users of:
40
+
41
+ - `anthropic.Anthropic` / `anthropic.AsyncAnthropic` clients
42
+ - Claude Code (which uses the Anthropic SDK under the hood)
43
+ - The Claude Agent SDK (tool-use receipts via `agent_action/v1`)
44
+
45
+ ## 5-minute quickstart
46
+
47
+ ```bash
48
+ pip install ledgerproof-anthropic
49
+ export ANTHROPIC_API_KEY=sk-ant-...
50
+ ```
51
+
52
+ ```python
53
+ from ledgerproof_anthropic import LedgerProofAnthropic, LogEmitter
54
+
55
+ client = LedgerProofAnthropic(
56
+ deployer_id="acme-corp-eu",
57
+ emitter=LogEmitter(),
58
+ )
59
+
60
+ response = client.messages.create(
61
+ model="claude-opus-4-1",
62
+ max_tokens=256,
63
+ messages=[{"role": "user", "content": "Hello"}],
64
+ )
65
+
66
+ print(response.content[0].text)
67
+ # Receipt has already been emitted to the log emitter side-channel.
68
+ ```
69
+
70
+ The Anthropic response object is returned **unchanged**. The receipt is emitted to the side channel only.
71
+
72
+ ## Three integration patterns
73
+
74
+ 1. **Client wrapper** (recommended) — `LedgerProofAnthropic` wraps `anthropic.Anthropic` and intercepts
75
+ `messages.create()`. Sync, async, streaming and non-streaming all supported.
76
+ 2. **Decorator** — `@lpr_track(deployer_id="...")` for user-defined functions that wrap Anthropic calls.
77
+ 3. **Manual emission** — `emit_receipt(response, deployer_id, regulatory_context)` for full control.
78
+
79
+ See `examples/` for runnable code.
80
+
81
+ ## Architectural discipline (C1–C8)
82
+
83
+ This adapter is implemented under the LedgerProof protocol's load-bearing constraints:
84
+
85
+ - **C1**: No claim of regulator endorsement. No claim of Article 40 presumption of conformity.
86
+ - **C4**: Local verification only. The adapter does **not** phone home to LedgerProof servers during normal operation.
87
+ - **C6**: Stream-aware signing. Streaming messages are signed using an incremental SHA-256 over text deltas.
88
+ - **C7**: Side-channel emission only. The adapter **cannot and does not modify** the Anthropic response payload.
89
+
90
+ ## Scope disclaimer
91
+
92
+ LedgerProof provides an **evidence layer for Article 50 transparency obligations only**.
93
+
94
+ It does **not** cover:
95
+
96
+ - Article 9 (risk management system)
97
+ - Article 10 (data and data governance)
98
+ - Article 13 (transparency and information to deployers)
99
+ - Article 15 (accuracy, robustness, and cybersecurity)
100
+ - Article 72 (post-market monitoring)
101
+
102
+ LedgerProof does **not** confer presumption of conformity under Article 40. LedgerProof is not endorsed by the
103
+ European Commission, the AI Office, any national competent authority, or Anthropic, PBC.
104
+
105
+ This adapter wraps the official Anthropic Python SDK; it is not affiliated with Anthropic.
106
+
107
+ ## License
108
+
109
+ Apache 2.0. Copyright 2026 LedgerProof Foundation (in formation: US 501(c)(3) Delaware + Dutch Stichting EU subsidiary).
@@ -0,0 +1,22 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ anthropic_ledgerproof.egg-info/PKG-INFO
5
+ anthropic_ledgerproof.egg-info/SOURCES.txt
6
+ anthropic_ledgerproof.egg-info/dependency_links.txt
7
+ anthropic_ledgerproof.egg-info/requires.txt
8
+ anthropic_ledgerproof.egg-info/top_level.txt
9
+ ledgerproof_anthropic/__init__.py
10
+ ledgerproof_anthropic/async_client_wrapper.py
11
+ ledgerproof_anthropic/canonical.py
12
+ ledgerproof_anthropic/client_wrapper.py
13
+ ledgerproof_anthropic/decorator.py
14
+ ledgerproof_anthropic/emitter.py
15
+ ledgerproof_anthropic/manual.py
16
+ ledgerproof_anthropic/schema.py
17
+ ledgerproof_anthropic/signer.py
18
+ ledgerproof_anthropic/version.py
19
+ tests/test_canonical.py
20
+ tests/test_client_wrapper.py
21
+ tests/test_emitter.py
22
+ tests/test_schema.py
@@ -0,0 +1,8 @@
1
+ anthropic>=0.40
2
+ cryptography>=41
3
+ cbor2>=5.0
4
+ pydantic>=2.0
5
+
6
+ [test]
7
+ pytest>=7.0
8
+ pytest-asyncio>=0.21
@@ -0,0 +1 @@
1
+ ledgerproof_anthropic
@@ -0,0 +1,76 @@
1
+ """
2
+ LedgerProof adapter for the Anthropic Python SDK.
3
+
4
+ Side-channel cryptographic transparency receipts for EU AI Act Article 50 evidence.
5
+
6
+ Discipline:
7
+ - C1: No regulator endorsement, no Article 40 presumption of conformity.
8
+ - C4: Offline verification only; no phone-home.
9
+ - C6: Stream-aware SHA-256 over text deltas.
10
+ - C7: Side-channel emission only; never modifies the Anthropic response.
11
+ """
12
+
13
+ from .async_client_wrapper import LedgerProofAsyncAnthropic
14
+ from .client_wrapper import LedgerProofAnthropic
15
+ from .decorator import lpr_track
16
+ from .emitter import (
17
+ Emitter,
18
+ LogEmitter,
19
+ MultiEmitter,
20
+ QueueEmitter,
21
+ StderrEmitter,
22
+ WebhookEmitter,
23
+ )
24
+ from .manual import emit_receipt, extract_tool_uses
25
+ from .schema import (
26
+ ContentRef,
27
+ ModelRef,
28
+ ReceiptV1,
29
+ RegulatoryContext,
30
+ ToolUseRef,
31
+ build_agent_action_receipt,
32
+ build_chatbot_session_receipt,
33
+ build_generated_content_receipt,
34
+ )
35
+ from .signer import (
36
+ AwsKmsEd25519Signer,
37
+ Ed25519Signer,
38
+ GcpKmsEd25519Signer,
39
+ Signer,
40
+ verify,
41
+ )
42
+ from .version import __version__
43
+
44
+ __all__ = [
45
+ "__version__",
46
+ # client wrappers
47
+ "LedgerProofAnthropic",
48
+ "LedgerProofAsyncAnthropic",
49
+ # decorator
50
+ "lpr_track",
51
+ # manual
52
+ "emit_receipt",
53
+ "extract_tool_uses",
54
+ # schemas
55
+ "ContentRef",
56
+ "ModelRef",
57
+ "ReceiptV1",
58
+ "RegulatoryContext",
59
+ "ToolUseRef",
60
+ "build_chatbot_session_receipt",
61
+ "build_generated_content_receipt",
62
+ "build_agent_action_receipt",
63
+ # emitters
64
+ "Emitter",
65
+ "LogEmitter",
66
+ "StderrEmitter",
67
+ "WebhookEmitter",
68
+ "QueueEmitter",
69
+ "MultiEmitter",
70
+ # signers
71
+ "Signer",
72
+ "Ed25519Signer",
73
+ "AwsKmsEd25519Signer",
74
+ "GcpKmsEd25519Signer",
75
+ "verify",
76
+ ]