aetherproof 0.4.0__tar.gz → 0.5.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 (63) hide show
  1. aetherproof-0.5.0/PKG-INFO +218 -0
  2. aetherproof-0.5.0/README.md +188 -0
  3. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/__init__.py +1 -1
  4. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/auto.py +4 -4
  5. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/cli.py +5 -5
  6. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/hash.py +2 -2
  7. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/keystore.py +8 -8
  8. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/log.py +10 -10
  9. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/receipt.py +17 -17
  10. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/session.py +7 -7
  11. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/verifier.py +1 -1
  12. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/ui/__init__.py +1 -1
  13. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/ui/display.py +13 -13
  14. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/ui/easy_mode.py +28 -28
  15. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/ui/expert_mode.py +19 -19
  16. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/ui/menus.py +2 -2
  17. aetherproof-0.5.0/aetherproof.egg-info/PKG-INFO +218 -0
  18. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof.egg-info/SOURCES.txt +2 -0
  19. {aetherproof-0.4.0 → aetherproof-0.5.0}/pyproject.toml +3 -3
  20. aetherproof-0.5.0/tests/security/README.md +27 -0
  21. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_cli_contract.py +2 -2
  22. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_hardening_v13.py +5 -5
  23. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_parsing_and_types.py +3 -3
  24. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_preimage_injectivity.py +1 -1
  25. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_v12_extensions.py +4 -4
  26. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/stress/full_audit.py +21 -21
  27. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/stress/industrial_stress.py +19 -19
  28. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/stress/isolation_audit.py +17 -17
  29. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_auto.py +3 -3
  30. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_cli_entry.py +1 -1
  31. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_cli_paths.py +8 -8
  32. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_core_coverage.py +10 -10
  33. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_display.py +1 -1
  34. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_easy_mode.py +4 -4
  35. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_expert_mode.py +4 -4
  36. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_independent_verification.py +4 -4
  37. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_log.py +3 -3
  38. aetherproof-0.5.0/tests/test_native_equivalence.py +211 -0
  39. aetherproof-0.5.0/tests/test_native_security.py +261 -0
  40. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_readme_verifier.py +60 -15
  41. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_receipt.py +1 -1
  42. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_session.py +3 -3
  43. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_session_binding.py +2 -2
  44. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_verifier.py +1 -1
  45. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_verify_wizard.py +1 -1
  46. aetherproof-0.4.0/PKG-INFO +0 -372
  47. aetherproof-0.4.0/README.md +0 -342
  48. aetherproof-0.4.0/aetherproof.egg-info/PKG-INFO +0 -372
  49. aetherproof-0.4.0/tests/security/README.md +0 -32
  50. {aetherproof-0.4.0 → aetherproof-0.5.0}/LICENSE +0 -0
  51. {aetherproof-0.4.0 → aetherproof-0.5.0}/MANIFEST.in +0 -0
  52. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/__main__.py +0 -0
  53. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/__init__.py +0 -0
  54. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof/core/signer.py +0 -0
  55. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof.egg-info/dependency_links.txt +0 -0
  56. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof.egg-info/entry_points.txt +0 -0
  57. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof.egg-info/requires.txt +0 -0
  58. {aetherproof-0.4.0 → aetherproof-0.5.0}/aetherproof.egg-info/top_level.txt +0 -0
  59. {aetherproof-0.4.0 → aetherproof-0.5.0}/setup.cfg +0 -0
  60. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/conftest.py +0 -0
  61. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_cloud_api_attested.py +0 -0
  62. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/security/test_cloud_models_matrix.py +0 -0
  63. {aetherproof-0.4.0 → aetherproof-0.5.0}/tests/test_key_rotation.py +0 -0
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: aetherproof
3
+ Version: 0.5.0
4
+ Summary: AetherProof - the open-source receipt engine. Prototype of Signet.
5
+ Author-email: Pulkit Kr Srivastava <pulkitsrivastavae@gmail.com>
6
+ License: Apache-2.0
7
+ Keywords: cryptography,ai,audit,compliance,ed25519,receipt,tamper-proof
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Security :: Cryptography
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: cryptography>=41.0.0
22
+ Requires-Dist: rich>=13.0.0
23
+ Requires-Dist: questionary>=2.0.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
27
+ Requires-Dist: black>=23.0.0; extra == "dev"
28
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ <p align="center">
32
+ <img src="docs/signet-logo.png" alt="Signet" width="240">
33
+ </p>
34
+
35
+ # AetherProof
36
+
37
+ **Cryptographic receipts for AI output.** Prove a model's output has not been
38
+ modified - no server, no account, verifiable offline forever.
39
+
40
+ ```bash
41
+ pip install aetherproof
42
+ ```
43
+
44
+ > **Not a developer?** Start with the [plain-language guide](docs/GETTING-STARTED.md)
45
+ > - first receipt in three steps, no code.
46
+
47
+ ---
48
+
49
+ ## The problem
50
+
51
+ Somebody acts on an AI's output. Weeks later it is questioned:
52
+
53
+ > *"Did it really say that, or did you change it afterwards?"*
54
+
55
+ Today that argument is unwinnable in both directions. You cannot prove you did not
56
+ edit a text file, and they cannot prove you did. Screenshots prove nothing. Logs you
57
+ control prove nothing, because you control them.
58
+
59
+ **AetherProof turns that into arithmetic that either checks or does not.**---
60
+
61
+ ## Use it
62
+
63
+ ### Sign one output
64
+
65
+ ```python
66
+ from aetherproof.auto import sign
67
+
68
+ resp = client.chat.completions.create(model="gpt-4o", messages=[...])
69
+ out = resp.choices[0].message.content
70
+
71
+ sign(prompt=user_prompt, output=out, model_id=resp.model)
72
+ ```
73
+
74
+ That is the whole integration. It never prompts, never blocks. On failure it
75
+ returns `None` and your program continues - set `AETHERPROOF_STRICT=1` if a missing
76
+ receipt should be an error instead.
77
+
78
+ ### Wrap a function you already have
79
+
80
+ ```python
81
+ from aetherproof.auto import receipted
82
+
83
+ @receipted(model_id="gpt-4o")
84
+ def ask(prompt: str) -> str:
85
+ return client.chat.completions.create(...).choices[0].message.content
86
+ ```
87
+
88
+ No call sites change.
89
+
90
+ ### A whole conversation, one signature
91
+
92
+ ```python
93
+ from aetherproof.auto import AutoSession
94
+
95
+ with AutoSession(model_id="gpt-4o") as chat: # seals on exit
96
+ for prompt in prompts:
97
+ chat.turn(prompt=prompt, output=ask(prompt))
98
+ ```
99
+
100
+ At 1,000 turns that is **one 412-byte seal**. Proving any single turn costs 10
101
+ hashes and about 1 KB, and reveals nothing about the other 999.
102
+
103
+ ### From the command line
104
+
105
+ ```bash
106
+ aetherproof sign model.onnx output.txt
107
+ aetherproof verify receipt.json --output output.txt
108
+ aetherproof # interactive menu
109
+ ```
110
+
111
+ **More recipes:**[docs/INTEGRATION.md](docs/INTEGRATION.md) - pick a path by one
112
+ question, every snippet tested.
113
+
114
+ ---
115
+
116
+ ## Verify it
117
+
118
+ Verification needs **21 lines and one dependency**. No network, no account, no
119
+ special hardware, and it keeps working if this project is abandoned.
120
+
121
+ ```bash
122
+ pip install cryptography # that is the entire requirement
123
+ ```
124
+
125
+ **The shape of it**, so you can see there is no trick - this is illustrative, not
126
+ complete:
127
+
128
+ ```python
129
+ from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
130
+ import json
131
+
132
+ r = json.load(open("receipt.json"))
133
+ pub = Ed25519PublicKey.from_public_bytes(bytes.fromhex(r["public_key"]))
134
+
135
+ # every field length-prefixed as "<len>:<field>", concatenated, then signed
136
+ preimage = build_preimage(r) # see the full version below
137
+ pub.verify(bytes.fromhex(r["signature"]), preimage) # raises if invalid
138
+ ```
139
+
140
+ > **Do not ship the snippet above.** It omits `log_sequence`, `hw_evidence`, the
141
+ > v1.2 extension commitment, and the v1.3 `receipt_id` and `signing_key_id`, so it
142
+ > rejects every receipt the current version produces. The complete verifier - 21
143
+ > lines, tested on every commit against real receipts - is in
144
+ > **[docs/VERIFICATION.md](docs/VERIFICATION.md)**.
145
+
146
+ ---
147
+
148
+ ## What it proves
149
+
150
+ | Claim | Mechanism | |---|---| | This exact output was not modified after signing | `output_hash` inside the signed preimage | | The receipt itself was not altered | Ed25519 over a length-prefixed canonical preimage | | It was signed by the holder of a specific key | Ed25519 verify, no other input | | A claimed time and log position were fixed at signing | both inside the preimage | | The local log was not edited, reordered, or truncated in the middle | key-free hash chain | | A specific turn belongs to a sealed session | Merkle inclusion proof, revealing no other turn | | Anyone can check all of it offline, forever | receipt + public key, nothing else |
151
+
152
+ ---
153
+
154
+ ## What it does **not**prove
155
+
156
+ Read this before citing anything above.
157
+
158
+ **Integrity, not completeness.***"Show me the record of this decision"* is answered.
159
+ *"Show me that you logged them all"* is not. Someone who logs 9,000 of 10,000
160
+ outputs passes every check here. That cannot be fixed locally - it needs an
161
+ independent witness, which does not exist yet.
162
+
163
+ | Not proven | Why | |---|---| | That the named model produced the output | it signs a `(model, output)` pair you supply | | That the timestamp is truthful | it is your own clock - bound, not externally anchored | | That the signing key is held securely | a software key on disk unless you set a passphrase | | That it survives a quantum adversary | Python is Ed25519 only; ML-DSA-65 is in the Rust core |
164
+
165
+ **Where it does not fit at all:** detecting deepfakes or unsigned AI content. A
166
+ scammer never signs, so there is nothing to verify.
167
+
168
+ Full list: [docs/CLAIMS.md](docs/CLAIMS.md).
169
+
170
+ ---
171
+
172
+ ## Two implementations
173
+
174
+ | | Rust - `rust/` | Python - `aetherproof/` | |---|---|---| | Receipt | **128 B fixed binary**| 646 B JSON | | Post-quantum | **ML-DSA-65 (FIPS 204)**| none | | Secret zeroization, constant-time compare | **yes**| no | | `unsafe` in production | **zero, compiler-enforced**| n/a | | Tests | 59 | 642 (93% coverage) | | Distribution | source + CI wheels | PyPI |
175
+
176
+ Measured, 50,000 leaves, medians of seven isolated runs: Rust builds a Merkle tree
177
+ in **28.16 ms**against Python's 102.71 ms (3.6x) and verifies a proof in
178
+ **3.93 µs**against 17.17 µs (4.4x).
179
+
180
+ The Rust core is optional. `aetherproof` does not import it and behaves identically
181
+ without it - enforced in CI. See [docs/ROADMAP.md](docs/ROADMAP.md).
182
+
183
+ ### Secrets that get wiped
184
+
185
+ A signing key held as a Python `bytes` object cannot be wiped - it is immutable, and
186
+ garbage collection does not overwrite the allocation. `SecureSigner` keeps the key
187
+ inside Rust and overwrites it on release, including when a block exits by exception.
188
+
189
+ ```python
190
+ import _native
191
+
192
+ with _native.SecureSigner() as signer: # key wiped on exit
193
+ pub = signer.public_key() # nothing returns the secret
194
+ receipt = signer.sign_receipt(pid=1, binary=model_bytes,
195
+ memory_hash=0, syscall_count=1)
196
+
197
+ assert _native.SecureVerifier(pub).verify_receipt(receipt)
198
+ ```
199
+
200
+ Setup and post-quantum usage: [docs/INTEGRATION.md](docs/INTEGRATION.md#path-c--secrets-that-get-wiped).
201
+
202
+ ---
203
+
204
+ ## Documentation
205
+
206
+ | | | |---|---| | [INTEGRATION.md](docs/INTEGRATION.md) | **start here**- pick a path by one question | | [GETTING-STARTED.md](docs/GETTING-STARTED.md) | first receipt, no code | | [CLAIMS.md](docs/CLAIMS.md) | what this proves and what it does not | | [VERIFICATION.md](docs/VERIFICATION.md) | the offline verifier, in full | | [CLOUD-MODELS.md](docs/CLOUD-MODELS.md) | local weights vs an API you do not control | | [AGENT-CHAIN.md](docs/AGENT-CHAIN.md) | binding agent context (receipt v1.2) | | [SECURITY.md](SECURITY.md) | reporting a vulnerability, threat model, known issues | | [ROADMAP.md](docs/ROADMAP.md) | 0.5.0 - Rust core, bindings, post-quantum | | [ANALYSIS.md](docs/ANALYSIS.md) | measured assessment, including what is unverified | | [CONTRIBUTING.md](CONTRIBUTING.md) | extension and spec workflow | | [RELEASE-NOTES-0.4.0.md](docs/RELEASE-NOTES-0.4.0.md) | what changed in 0.4.0 | | [agent-chain-context-response.md](docs/agent-chain-context-response.md) | the v1.2 design discussion, from issue #1 | | [DEMO.md](docs/DEMO.md) | recording a walkthrough |
207
+
208
+ ---
209
+
210
+ ## License
211
+
212
+ **Apache-2.0.** Use it, deploy it, fork it, embed it in a commercial product - no
213
+ copyleft obligation. The receipt format and the offline verifier are meant to be
214
+ copied freely; a proof layer nobody can adopt is not a proof layer.
215
+
216
+ *Versions up to 0.2.2 were AGPL-3.0-or-later. From 0.3.0 onward: Apache-2.0.*
217
+
218
+ Security issues: **[SECURITY.md](SECURITY.md)**- please do not open a public issue.
@@ -0,0 +1,188 @@
1
+ <p align="center">
2
+ <img src="docs/signet-logo.png" alt="Signet" width="240">
3
+ </p>
4
+
5
+ # AetherProof
6
+
7
+ **Cryptographic receipts for AI output.** Prove a model's output has not been
8
+ modified - no server, no account, verifiable offline forever.
9
+
10
+ ```bash
11
+ pip install aetherproof
12
+ ```
13
+
14
+ > **Not a developer?** Start with the [plain-language guide](docs/GETTING-STARTED.md)
15
+ > - first receipt in three steps, no code.
16
+
17
+ ---
18
+
19
+ ## The problem
20
+
21
+ Somebody acts on an AI's output. Weeks later it is questioned:
22
+
23
+ > *"Did it really say that, or did you change it afterwards?"*
24
+
25
+ Today that argument is unwinnable in both directions. You cannot prove you did not
26
+ edit a text file, and they cannot prove you did. Screenshots prove nothing. Logs you
27
+ control prove nothing, because you control them.
28
+
29
+ **AetherProof turns that into arithmetic that either checks or does not.**---
30
+
31
+ ## Use it
32
+
33
+ ### Sign one output
34
+
35
+ ```python
36
+ from aetherproof.auto import sign
37
+
38
+ resp = client.chat.completions.create(model="gpt-4o", messages=[...])
39
+ out = resp.choices[0].message.content
40
+
41
+ sign(prompt=user_prompt, output=out, model_id=resp.model)
42
+ ```
43
+
44
+ That is the whole integration. It never prompts, never blocks. On failure it
45
+ returns `None` and your program continues - set `AETHERPROOF_STRICT=1` if a missing
46
+ receipt should be an error instead.
47
+
48
+ ### Wrap a function you already have
49
+
50
+ ```python
51
+ from aetherproof.auto import receipted
52
+
53
+ @receipted(model_id="gpt-4o")
54
+ def ask(prompt: str) -> str:
55
+ return client.chat.completions.create(...).choices[0].message.content
56
+ ```
57
+
58
+ No call sites change.
59
+
60
+ ### A whole conversation, one signature
61
+
62
+ ```python
63
+ from aetherproof.auto import AutoSession
64
+
65
+ with AutoSession(model_id="gpt-4o") as chat: # seals on exit
66
+ for prompt in prompts:
67
+ chat.turn(prompt=prompt, output=ask(prompt))
68
+ ```
69
+
70
+ At 1,000 turns that is **one 412-byte seal**. Proving any single turn costs 10
71
+ hashes and about 1 KB, and reveals nothing about the other 999.
72
+
73
+ ### From the command line
74
+
75
+ ```bash
76
+ aetherproof sign model.onnx output.txt
77
+ aetherproof verify receipt.json --output output.txt
78
+ aetherproof # interactive menu
79
+ ```
80
+
81
+ **More recipes:**[docs/INTEGRATION.md](docs/INTEGRATION.md) - pick a path by one
82
+ question, every snippet tested.
83
+
84
+ ---
85
+
86
+ ## Verify it
87
+
88
+ Verification needs **21 lines and one dependency**. No network, no account, no
89
+ special hardware, and it keeps working if this project is abandoned.
90
+
91
+ ```bash
92
+ pip install cryptography # that is the entire requirement
93
+ ```
94
+
95
+ **The shape of it**, so you can see there is no trick - this is illustrative, not
96
+ complete:
97
+
98
+ ```python
99
+ from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
100
+ import json
101
+
102
+ r = json.load(open("receipt.json"))
103
+ pub = Ed25519PublicKey.from_public_bytes(bytes.fromhex(r["public_key"]))
104
+
105
+ # every field length-prefixed as "<len>:<field>", concatenated, then signed
106
+ preimage = build_preimage(r) # see the full version below
107
+ pub.verify(bytes.fromhex(r["signature"]), preimage) # raises if invalid
108
+ ```
109
+
110
+ > **Do not ship the snippet above.** It omits `log_sequence`, `hw_evidence`, the
111
+ > v1.2 extension commitment, and the v1.3 `receipt_id` and `signing_key_id`, so it
112
+ > rejects every receipt the current version produces. The complete verifier - 21
113
+ > lines, tested on every commit against real receipts - is in
114
+ > **[docs/VERIFICATION.md](docs/VERIFICATION.md)**.
115
+
116
+ ---
117
+
118
+ ## What it proves
119
+
120
+ | Claim | Mechanism | |---|---| | This exact output was not modified after signing | `output_hash` inside the signed preimage | | The receipt itself was not altered | Ed25519 over a length-prefixed canonical preimage | | It was signed by the holder of a specific key | Ed25519 verify, no other input | | A claimed time and log position were fixed at signing | both inside the preimage | | The local log was not edited, reordered, or truncated in the middle | key-free hash chain | | A specific turn belongs to a sealed session | Merkle inclusion proof, revealing no other turn | | Anyone can check all of it offline, forever | receipt + public key, nothing else |
121
+
122
+ ---
123
+
124
+ ## What it does **not**prove
125
+
126
+ Read this before citing anything above.
127
+
128
+ **Integrity, not completeness.***"Show me the record of this decision"* is answered.
129
+ *"Show me that you logged them all"* is not. Someone who logs 9,000 of 10,000
130
+ outputs passes every check here. That cannot be fixed locally - it needs an
131
+ independent witness, which does not exist yet.
132
+
133
+ | Not proven | Why | |---|---| | That the named model produced the output | it signs a `(model, output)` pair you supply | | That the timestamp is truthful | it is your own clock - bound, not externally anchored | | That the signing key is held securely | a software key on disk unless you set a passphrase | | That it survives a quantum adversary | Python is Ed25519 only; ML-DSA-65 is in the Rust core |
134
+
135
+ **Where it does not fit at all:** detecting deepfakes or unsigned AI content. A
136
+ scammer never signs, so there is nothing to verify.
137
+
138
+ Full list: [docs/CLAIMS.md](docs/CLAIMS.md).
139
+
140
+ ---
141
+
142
+ ## Two implementations
143
+
144
+ | | Rust - `rust/` | Python - `aetherproof/` | |---|---|---| | Receipt | **128 B fixed binary**| 646 B JSON | | Post-quantum | **ML-DSA-65 (FIPS 204)**| none | | Secret zeroization, constant-time compare | **yes**| no | | `unsafe` in production | **zero, compiler-enforced**| n/a | | Tests | 59 | 642 (93% coverage) | | Distribution | source + CI wheels | PyPI |
145
+
146
+ Measured, 50,000 leaves, medians of seven isolated runs: Rust builds a Merkle tree
147
+ in **28.16 ms**against Python's 102.71 ms (3.6x) and verifies a proof in
148
+ **3.93 µs**against 17.17 µs (4.4x).
149
+
150
+ The Rust core is optional. `aetherproof` does not import it and behaves identically
151
+ without it - enforced in CI. See [docs/ROADMAP.md](docs/ROADMAP.md).
152
+
153
+ ### Secrets that get wiped
154
+
155
+ A signing key held as a Python `bytes` object cannot be wiped - it is immutable, and
156
+ garbage collection does not overwrite the allocation. `SecureSigner` keeps the key
157
+ inside Rust and overwrites it on release, including when a block exits by exception.
158
+
159
+ ```python
160
+ import _native
161
+
162
+ with _native.SecureSigner() as signer: # key wiped on exit
163
+ pub = signer.public_key() # nothing returns the secret
164
+ receipt = signer.sign_receipt(pid=1, binary=model_bytes,
165
+ memory_hash=0, syscall_count=1)
166
+
167
+ assert _native.SecureVerifier(pub).verify_receipt(receipt)
168
+ ```
169
+
170
+ Setup and post-quantum usage: [docs/INTEGRATION.md](docs/INTEGRATION.md#path-c--secrets-that-get-wiped).
171
+
172
+ ---
173
+
174
+ ## Documentation
175
+
176
+ | | | |---|---| | [INTEGRATION.md](docs/INTEGRATION.md) | **start here**- pick a path by one question | | [GETTING-STARTED.md](docs/GETTING-STARTED.md) | first receipt, no code | | [CLAIMS.md](docs/CLAIMS.md) | what this proves and what it does not | | [VERIFICATION.md](docs/VERIFICATION.md) | the offline verifier, in full | | [CLOUD-MODELS.md](docs/CLOUD-MODELS.md) | local weights vs an API you do not control | | [AGENT-CHAIN.md](docs/AGENT-CHAIN.md) | binding agent context (receipt v1.2) | | [SECURITY.md](SECURITY.md) | reporting a vulnerability, threat model, known issues | | [ROADMAP.md](docs/ROADMAP.md) | 0.5.0 - Rust core, bindings, post-quantum | | [ANALYSIS.md](docs/ANALYSIS.md) | measured assessment, including what is unverified | | [CONTRIBUTING.md](CONTRIBUTING.md) | extension and spec workflow | | [RELEASE-NOTES-0.4.0.md](docs/RELEASE-NOTES-0.4.0.md) | what changed in 0.4.0 | | [agent-chain-context-response.md](docs/agent-chain-context-response.md) | the v1.2 design discussion, from issue #1 | | [DEMO.md](docs/DEMO.md) | recording a walkthrough |
177
+
178
+ ---
179
+
180
+ ## License
181
+
182
+ **Apache-2.0.** Use it, deploy it, fork it, embed it in a commercial product - no
183
+ copyleft obligation. The receipt format and the offline verifier are meant to be
184
+ copied freely; a proof layer nobody can adopt is not a proof layer.
185
+
186
+ *Versions up to 0.2.2 were AGPL-3.0-or-later. From 0.3.0 onward: Apache-2.0.*
187
+
188
+ Security issues: **[SECURITY.md](SECURITY.md)**- please do not open a public issue.
@@ -1,4 +1,4 @@
1
- """AetherProof — the open-source receipt engine. Prototype of Signet."""
1
+ """AetherProof - the open-source receipt engine. Prototype of Signet."""
2
2
 
3
3
  __version__ = "0.4.0"
4
4
  __author__ = "Pulkit Srivastava"
@@ -1,4 +1,4 @@
1
- """Headless AetherProof — zero interaction, for automation.
1
+ """Headless AetherProof - zero interaction, for automation.
2
2
 
3
3
  The wizard and the CLI both assume a human at a terminal. That is the wrong
4
4
  shape for where receipts actually need to be generated: a cloud coding model, a
@@ -19,7 +19,7 @@ Nothing in this module reads stdin or writes to stdout.
19
19
  s.turn(prompt=..., output=...)
20
20
  # seals on exit; s.seal_path holds the signed root
21
21
 
22
- # wrap any client call — the lazy path
22
+ # wrap any client call - the lazy path
23
23
  from aetherproof.auto import receipted
24
24
  @receipted(model_id="gpt-4o")
25
25
  def ask(prompt): return client.responses(prompt)
@@ -153,7 +153,7 @@ def sign(
153
153
 
154
154
  `model_id` sets the honest tier automatically: given one, the root is
155
155
  `api_attested` built from the id the provider returned; without one it is
156
- `name_only`. Neither claims to bind the weights — that needs a local file.
156
+ `name_only`. Neither claims to bind the weights - that needs a local file.
157
157
  """
158
158
  if is_disabled():
159
159
  return None
@@ -275,7 +275,7 @@ class AutoSession:
275
275
  return self
276
276
 
277
277
  def __exit__(self, exc_type, exc, tb) -> bool:
278
- # seal even when the caller's block raised — a crashed run still wants
278
+ # seal even when the caller's block raised - a crashed run still wants
279
279
  # a record of what it produced up to that point
280
280
  self.close()
281
281
  return False
@@ -1,4 +1,4 @@
1
- """CLI entry point — bare interactive menu or direct subcommands."""
1
+ """CLI entry point - bare interactive menu or direct subcommands."""
2
2
 
3
3
  import sys
4
4
  import json
@@ -23,7 +23,7 @@ from .core.keystore import home, default_log, load_or_create_signer
23
23
  def _app_state():
24
24
  # persistent app signing key + transparency log (shared keystore).
25
25
  # home() and default_log() resolve AETHERPROOF_HOME at call time and anchor
26
- # the log to an ABSOLUTE path — the old CWD-relative default gave you a
26
+ # the log to an ABSOLUTE path - the old CWD-relative default gave you a
27
27
  # different log per directory you happened to run from.
28
28
  key_dir = home()
29
29
  signer = load_or_create_signer(key_dir)
@@ -48,7 +48,7 @@ def _ask_text(message, default=""):
48
48
 
49
49
 
50
50
  def run_expert_shell():
51
- console.print("[dim]Expert shell — type a command, or 'exit' to return.[/dim]")
51
+ console.print("[dim]Expert shell - type a command, or 'exit' to return.[/dim]")
52
52
  while True:
53
53
  try:
54
54
  line = console.input("[cyan bold]aetherproof>[/cyan bold] ").strip()
@@ -83,11 +83,11 @@ def run_keygen_wizard():
83
83
 
84
84
 
85
85
  def _help_table():
86
- table = Table(title="AetherProof — commands", show_header=True, header_style="cyan")
86
+ table = Table(title="AetherProof - commands", show_header=True, header_style="cyan")
87
87
  table.add_column("Command")
88
88
  table.add_column("Description")
89
89
  table.add_row("aetherproof", "Launch the interactive menu")
90
- table.add_row("sign <model> <output> [--input F]", "Sign a model output → receipt")
90
+ table.add_row("sign <model> <output> [--input F]", "Sign a model output -> receipt")
91
91
  table.add_row("verify <receipt> [--pubkey K] [--output F] [--quiet]", "Verify a receipt (+ output file) offline")
92
92
  table.add_row("inspect <receipt>", "Show all receipt fields decoded")
93
93
  table.add_row("log <list|verify|count>", "Inspect the transparency log")
@@ -81,7 +81,7 @@ def compute_merkle_root(hashes: List[str]) -> str:
81
81
  as a leaf.
82
82
 
83
83
  Empty list returns "". A single leaf returns its *tagged* hash, not the raw
84
- input — returning the leaf unchanged would break property 2 for 1-file trees.
84
+ input - returning the leaf unchanged would break property 2 for 1-file trees.
85
85
 
86
86
  Args:
87
87
  hashes: list of hex-encoded leaf hashes
@@ -113,7 +113,7 @@ def compute_model_weight_root(model_path: Union[str, Path], chunk_size: int = 40
113
113
  For a single file, this is the file's SHA-256 (unchanged contract).
114
114
 
115
115
  For a directory, each leaf commits to the file's **path as well as its
116
- bytes** — `sha256("<relative/path>\\x00<digest>")`. v0.2.x hashed contents
116
+ bytes**- `sha256("<relative/path>\\x00<digest>")`. v0.2.x hashed contents
117
117
  only, so two directories holding the same bytes under different filenames
118
118
  produced an identical root; renaming `weights.bin` to `config.json` was
119
119
  invisible to the model-identity check. Paths are POSIX-normalised so a root
@@ -30,7 +30,7 @@ def log_path() -> Path:
30
30
  """The transparency log.
31
31
 
32
32
  MUST be absolute. ReceiptLog's own default is "./receipts/log.db", which is
33
- CWD-relative — signing from two different directories produced two separate
33
+ CWD-relative - signing from two different directories produced two separate
34
34
  logs, so the append-only chain silently forked per working directory and
35
35
  neither log was complete.
36
36
  """
@@ -54,7 +54,7 @@ def __getattr__(name):
54
54
 
55
55
  # Optional passphrase for the private key at rest. When set, the PEM is written
56
56
  # with BestAvailableEncryption instead of NoEncryption. Left unset the key is
57
- # still written 0600, but an attacker who can read the file can forge receipts —
57
+ # still written 0600, but an attacker who can read the file can forge receipts -
58
58
  # so the env var is the difference between "protected by file permissions" and
59
59
  # "protected by a secret".
60
60
  PASSPHRASE_ENV = "AETHERPROOF_KEY_PASSPHRASE"
@@ -73,7 +73,7 @@ def _passphrase() -> Optional[bytes]:
73
73
 
74
74
 
75
75
  def _chmod_600(path: Path) -> None:
76
- """Owner-read/write only. Best effort — POSIX bits are advisory on Windows."""
76
+ """Owner-read/write only. Best effort - POSIX bits are advisory on Windows."""
77
77
  try:
78
78
  os.chmod(path, stat.S_IRUSR | stat.S_IWUSR)
79
79
  except OSError:
@@ -86,7 +86,7 @@ def load_or_create_signer(key_dir: Path = None) -> Signer:
86
86
  Creation is an atomic O_EXCL claim rather than exists()-then-write. The old
87
87
  check-then-create was a race: measured over 8 trials x 16 threads it handed
88
88
  out 2-4 DISTINCT keys every single time, and the losing threads' public keys
89
- were overwritten and never persisted — making their receipts permanently
89
+ were overwritten and never persisted - making their receipts permanently
90
90
  unverifiable. Now exactly one caller wins the create; everyone else falls
91
91
  through and reads the winner's key.
92
92
  """
@@ -102,7 +102,7 @@ def load_or_create_signer(key_dir: Path = None) -> Signer:
102
102
  candidate = Signer.generate()
103
103
  pem = candidate.export_private_pem(password=pw)
104
104
  try:
105
- # O_EXCL is the atomic claim — it fails if anyone else got here first.
105
+ # O_EXCL is the atomic claim - it fails if anyone else got here first.
106
106
  fd = os.open(priv, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
107
107
  except FileExistsError:
108
108
  # Lost the race: the winner's key is authoritative. Discard ours rather
@@ -163,7 +163,7 @@ def issue_receipt(
163
163
 
164
164
  The log_sequence is reserved (max+1) and the log_anchor set BEFORE signing,
165
165
  so both are covered by the signature. Files are written first; log.append is
166
- the commit point — on any failure the files are rolled back so nothing is
166
+ the commit point - on any failure the files are rolled back so nothing is
167
167
  left orphaned. Raises ValueError on a concurrent sequence collision.
168
168
 
169
169
  Passing `session_id` / `turn_index` / `session_root` binds this receipt to a
@@ -176,7 +176,7 @@ def issue_receipt(
176
176
  receipts_dir = Path(receipts_dir) if receipts_dir else receipts_path()
177
177
  receipts_dir.mkdir(parents=True, exist_ok=True)
178
178
 
179
- # Assemble the signed extensions once — every retry must sign the same
179
+ # Assemble the signed extensions once - every retry must sign the same
180
180
  # context, or the receipt's identity would shift between attempts.
181
181
  signed_ext = dict(extensions or {})
182
182
  ctx = {}
@@ -190,7 +190,7 @@ def issue_receipt(
190
190
  signed_ext.setdefault(SESSION_NS, {}).update(ctx)
191
191
 
192
192
  # The sequence is inside the signing preimage, so it cannot be assigned
193
- # after signing — it has to be chosen, signed, and committed, and if another
193
+ # after signing - it has to be chosen, signed, and committed, and if another
194
194
  # writer took that slot first the whole build must be redone. v0.2.2 tried
195
195
  # once and gave up: 29 of 32 concurrent calls failed. Signing is ~45 us, so
196
196
  # retrying is far cheaper than the lock it would otherwise need.
@@ -12,7 +12,7 @@ SCHEMA_VERSION = 2 # 1 = pre-chain, 2 = hash-chained over the full receipt body
12
12
 
13
13
 
14
14
  def _body_hash(receipt_json: str) -> str:
15
- # hash of the entire stored receipt — chains the whole record, not a subset
15
+ # hash of the entire stored receipt - chains the whole record, not a subset
16
16
  return hashlib.sha256(receipt_json.encode("utf-8")).hexdigest()
17
17
 
18
18
 
@@ -82,8 +82,8 @@ class ReceiptLog:
82
82
  """`synchronous` trades durability for throughput.
83
83
 
84
84
  FULL (default) survives OS crash and power loss. NORMAL is still
85
- corruption-safe under WAL — the only exposure is losing the most recent
86
- commits on a power cut — and is the usual recommendation for WAL. A
85
+ corruption-safe under WAL - the only exposure is losing the most recent
86
+ commits on a power cut - and is the usual recommendation for WAL. A
87
87
  receipt log defaults to the durable end because a receipt that was
88
88
  acknowledged and then vanished is worse than a slow one.
89
89
  """
@@ -103,13 +103,13 @@ class ReceiptLog:
103
103
  """Open a connection configured for safe multi-writer use.
104
104
 
105
105
  `isolation_level=None` turns OFF the sqlite3 module's implicit
106
- transaction management so we can issue BEGIN IMMEDIATE ourselves —
106
+ transaction management so we can issue BEGIN IMMEDIATE ourselves -
107
107
  without this, python starts a deferred transaction and the write lock is
108
108
  not taken until the first INSERT, which is exactly the window that let
109
109
  two writers read the same chain head.
110
110
 
111
111
  `journal_mode` is deliberately NOT set here. WAL is a persistent property
112
- of the database file, so setting it per-connection is pure overhead —
112
+ of the database file, so setting it per-connection is pure overhead -
113
113
  measured at 2.4 ms of the 7.9 ms each append was costing, because it
114
114
  takes a lock to switch mode even when the mode is already WAL. It is set
115
115
  once in _init_db instead. busy_timeout and synchronous are per-connection
@@ -121,7 +121,7 @@ class ReceiptLog:
121
121
  cached.execute("SELECT 1").fetchone()
122
122
  return cached
123
123
  except sqlite3.Error:
124
- # stale (db replaced, handle closed) — drop and reopen
124
+ # stale (db replaced, handle closed) - drop and reopen
125
125
  try:
126
126
  cached.close()
127
127
  except sqlite3.Error:
@@ -244,7 +244,7 @@ class ReceiptLog:
244
244
  # BEGIN IMMEDIATE takes the RESERVED write lock up front, so the
245
245
  # read of the chain head and the write that extends it are one
246
246
  # atomic step. Without it (v0.2.2) two writers both read the same
247
- # head and the chain forked — measured to break at 2 concurrent
247
+ # head and the chain forked - measured to break at 2 concurrent
248
248
  # writers, silently, with every row still written and no exception
249
249
  # raised. This holds across processes as well as threads.
250
250
  cursor.execute("BEGIN IMMEDIATE")
@@ -321,12 +321,12 @@ class ReceiptLog:
321
321
  Key-free (always): sequences are contiguous 1..N; the hash chain over each
322
322
  receipt body is consistent; and each receipt's own signed log_sequence
323
323
  equals its slot. Together these make deletion, reordering, content edits,
324
- and delete-then-renumber tamper-evident WITHOUT any key — so key rotation
324
+ and delete-then-renumber tamper-evident WITHOUT any key - so key rotation
325
325
  never false-flags an authentic log.
326
326
 
327
327
  With public_key (deeper, key-bound): additionally re-verifies each receipt's
328
328
  Ed25519 signature, catching a forger who rewrites an embedded log_sequence
329
- and recomputes the whole chain — they still cannot reproduce the signature.
329
+ and recomputes the whole chain - they still cannot reproduce the signature.
330
330
 
331
331
  `public_key` may be a single Verifier or a mapping/iterable of them. Rows
332
332
  naming a `signing_key_id` we were not given are reported UNVERIFIABLE, not
@@ -392,7 +392,7 @@ class ReceiptLog:
392
392
  if rcpt.signing_key_id:
393
393
  key = keys.get(rcpt.signing_key_id)
394
394
  if key is None:
395
- # Not forgery — we simply were not given this key (rotation).
395
+ # Not forgery - we simply were not given this key (rotation).
396
396
  report.unverifiable.append((i, rcpt.signing_key_id))
397
397
  continue
398
398
  candidates = [key]