deusproof 0.3.0__tar.gz → 0.4.1__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.
- {deusproof-0.3.0 → deusproof-0.4.1}/PKG-INFO +52 -2
- {deusproof-0.3.0 → deusproof-0.4.1}/README.md +50 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof/__init__.py +1 -1
- deusproof-0.4.1/deusproof/cli.py +247 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof.egg-info/PKG-INFO +52 -2
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof.egg-info/SOURCES.txt +2 -0
- deusproof-0.4.1/deusproof.egg-info/entry_points.txt +2 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/pyproject.toml +7 -2
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof/audit.py +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof/langchain.py +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof/langchain_audit.py +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof/notary.py +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof.egg-info/dependency_links.txt +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof.egg-info/requires.txt +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/deusproof.egg-info/top_level.txt +0 -0
- {deusproof-0.3.0 → deusproof-0.4.1}/setup.cfg +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deusproof
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Prove your AI agent's work existed at a given moment — one call, self-signed, timestamped and Bitcoin-anchored on a public append-only register. Free.
|
|
5
5
|
Author: DEUSPROOF
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://deusproof.com
|
|
8
8
|
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
-
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph
|
|
9
|
+
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph,claude-code,cursor,cli
|
|
10
10
|
Requires-Python: >=3.9
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: httpx>=0.24
|
|
@@ -106,6 +106,56 @@ It records runs, tool calls and model outputs (hashed; add `keep_payload=True` t
|
|
|
106
106
|
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
107
107
|
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
108
108
|
|
|
109
|
+
## Seal any log you already have: no code changes
|
|
110
|
+
|
|
111
|
+
Your tool already writes a log (an agent runtime, an audit trail, a JSONL of tool calls)? Seal it
|
|
112
|
+
from the command line. Only its SHA-256 leaves your machine.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
deusproof seal runtime.jsonl --handle my-endpoint # e.g. once a day from cron
|
|
116
|
+
deusproof verify runtime.jsonl # anyone, any time, offline
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Logs grow, so each receipt records how many bytes it covered and `verify` re-hashes exactly that
|
|
120
|
+
part: lines appended later still pass; anything changed or cut inside a sealed part fails. Receipts
|
|
121
|
+
are kept beside the file in `runtime.jsonl.deusproof.jsonl` (no content, just digest, size, time
|
|
122
|
+
and the link to check the timestamp and the Bitcoin anchor).
|
|
123
|
+
|
|
124
|
+
### Claude Code: every session sealed
|
|
125
|
+
|
|
126
|
+
Add a `SessionEnd` hook to `.claude/settings.json` (or `~/.claude/settings.json` for all projects):
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"hooks": {
|
|
131
|
+
"SessionEnd": [
|
|
132
|
+
{ "hooks": [ { "type": "command",
|
|
133
|
+
"command": "deusproof seal --hook --handle my-dev-agent --platform claude-code" } ] }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
When a session ends, its transcript is fingerprinted and sealed. The transcript never leaves your
|
|
140
|
+
machine. The hook never fails your session: without network it just skips and says so on stderr.
|
|
141
|
+
|
|
142
|
+
### Cursor: the same, from its `stop` hook
|
|
143
|
+
|
|
144
|
+
Add to `.cursor/hooks.json` (or `~/.cursor/hooks.json` for all projects):
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"version": 1,
|
|
149
|
+
"hooks": {
|
|
150
|
+
"stop": [ { "command": "deusproof seal --hook --handle my-dev-agent --platform cursor --min-gap 15" } ]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Cursor's `stop` fires after every agent turn, so the hook skips a transcript that has not changed
|
|
156
|
+
since its last seal, and `--min-gap 15` seals at most once every 15 minutes. Nothing is lost: each
|
|
157
|
+
seal covers everything before it.
|
|
158
|
+
|
|
109
159
|
## Use it from LangChain
|
|
110
160
|
|
|
111
161
|
```bash
|
|
@@ -88,6 +88,56 @@ It records runs, tool calls and model outputs (hashed; add `keep_payload=True` t
|
|
|
88
88
|
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
89
89
|
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
90
90
|
|
|
91
|
+
## Seal any log you already have: no code changes
|
|
92
|
+
|
|
93
|
+
Your tool already writes a log (an agent runtime, an audit trail, a JSONL of tool calls)? Seal it
|
|
94
|
+
from the command line. Only its SHA-256 leaves your machine.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
deusproof seal runtime.jsonl --handle my-endpoint # e.g. once a day from cron
|
|
98
|
+
deusproof verify runtime.jsonl # anyone, any time, offline
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Logs grow, so each receipt records how many bytes it covered and `verify` re-hashes exactly that
|
|
102
|
+
part: lines appended later still pass; anything changed or cut inside a sealed part fails. Receipts
|
|
103
|
+
are kept beside the file in `runtime.jsonl.deusproof.jsonl` (no content, just digest, size, time
|
|
104
|
+
and the link to check the timestamp and the Bitcoin anchor).
|
|
105
|
+
|
|
106
|
+
### Claude Code: every session sealed
|
|
107
|
+
|
|
108
|
+
Add a `SessionEnd` hook to `.claude/settings.json` (or `~/.claude/settings.json` for all projects):
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"hooks": {
|
|
113
|
+
"SessionEnd": [
|
|
114
|
+
{ "hooks": [ { "type": "command",
|
|
115
|
+
"command": "deusproof seal --hook --handle my-dev-agent --platform claude-code" } ] }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
When a session ends, its transcript is fingerprinted and sealed. The transcript never leaves your
|
|
122
|
+
machine. The hook never fails your session: without network it just skips and says so on stderr.
|
|
123
|
+
|
|
124
|
+
### Cursor: the same, from its `stop` hook
|
|
125
|
+
|
|
126
|
+
Add to `.cursor/hooks.json` (or `~/.cursor/hooks.json` for all projects):
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"version": 1,
|
|
131
|
+
"hooks": {
|
|
132
|
+
"stop": [ { "command": "deusproof seal --hook --handle my-dev-agent --platform cursor --min-gap 15" } ]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Cursor's `stop` fires after every agent turn, so the hook skips a transcript that has not changed
|
|
138
|
+
since its last seal, and `--min-gap 15` seals at most once every 15 minutes. Nothing is lost: each
|
|
139
|
+
seal covers everything before it.
|
|
140
|
+
|
|
91
141
|
## Use it from LangChain
|
|
92
142
|
|
|
93
143
|
```bash
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"""`deusproof` — seal any file or log from the command line, with no code changes.
|
|
2
|
+
|
|
3
|
+
deusproof seal runtime.jsonl --handle my-endpoint # once a day, from cron
|
|
4
|
+
deusproof verify runtime.jsonl # anyone, any time later
|
|
5
|
+
deusproof audit verify agent-audit.jsonl # the hash-chained log of deusproof.audit
|
|
6
|
+
|
|
7
|
+
WHY (16-nov-2026). Asking every tool to integrate a witness means waiting for
|
|
8
|
+
every maintainer. A command means any USER of any tool that already writes a
|
|
9
|
+
log (an agent runtime, a coding assistant, an audit trail) can get an outside
|
|
10
|
+
timestamp today, by themselves. Only the SHA-256 leaves the machine.
|
|
11
|
+
|
|
12
|
+
APPEND-ONLY LOGS. Logs grow. A seal records the byte length it covered, and
|
|
13
|
+
`verify` re-hashes exactly that prefix: "the first N bytes are as they were
|
|
14
|
+
when sealed; M bytes were added afterwards" is a pass, because appending is
|
|
15
|
+
what a log does. Changing or deleting anything inside the sealed prefix is a
|
|
16
|
+
fail. So the same receipt keeps meaning something while the log keeps growing.
|
|
17
|
+
|
|
18
|
+
RECEIPTS. Each seal appends one JSON line to `<file>.deusproof.jsonl` beside the
|
|
19
|
+
file (or `--receipts PATH`). It holds no content: digest, byte length, time,
|
|
20
|
+
certificate id and the URL where anyone can check the timestamp and the Bitcoin
|
|
21
|
+
anchor. Keep it with the file.
|
|
22
|
+
|
|
23
|
+
HOOK MODE. `deusproof seal --hook` reads a hook event as JSON on stdin and seals
|
|
24
|
+
its `transcript_path`. That makes it a one-line SessionEnd hook for Claude Code
|
|
25
|
+
and a `stop` hook for Cursor (any tool that passes a transcript path the same
|
|
26
|
+
way). In hook mode it never fails the caller: errors go to stderr, stdout gets
|
|
27
|
+
an empty JSON object (what Cursor expects from a hook) and the exit code is 0.
|
|
28
|
+
|
|
29
|
+
NOT EVERY TURN (18-nov-2026). Cursor's `stop` fires after every agent turn, not
|
|
30
|
+
once per session. A seal per turn would flood the register with near-identical
|
|
31
|
+
records and hit the rate limit. So in hook mode a transcript that has not
|
|
32
|
+
changed since its last seal is skipped, and `--min-gap MINUTES` skips a seal
|
|
33
|
+
when the last one is more recent than that. Nothing is lost: the next seal
|
|
34
|
+
covers every byte before it.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
from __future__ import annotations
|
|
38
|
+
|
|
39
|
+
import argparse
|
|
40
|
+
import hashlib
|
|
41
|
+
import json
|
|
42
|
+
import os
|
|
43
|
+
import sys
|
|
44
|
+
from datetime import datetime, timezone
|
|
45
|
+
from pathlib import Path
|
|
46
|
+
from typing import Any, Optional
|
|
47
|
+
|
|
48
|
+
__all__ = ["seal_file", "verify_file", "main"]
|
|
49
|
+
|
|
50
|
+
_CHUNK = 1 << 20
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _sha256_prefix(path: Path, length: Optional[int] = None) -> tuple[str, int]:
|
|
54
|
+
"""SHA-256 of the first `length` bytes (the whole file if None). Returns (hex, bytes hashed)."""
|
|
55
|
+
h = hashlib.sha256()
|
|
56
|
+
done = 0
|
|
57
|
+
with path.open("rb") as fh:
|
|
58
|
+
while length is None or done < length:
|
|
59
|
+
want = _CHUNK if length is None else min(_CHUNK, length - done)
|
|
60
|
+
block = fh.read(want)
|
|
61
|
+
if not block:
|
|
62
|
+
break
|
|
63
|
+
h.update(block)
|
|
64
|
+
done += len(block)
|
|
65
|
+
return h.hexdigest(), done
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _receipts_path(path: Path, receipts: Optional[str]) -> Path:
|
|
69
|
+
return Path(receipts) if receipts else path.with_name(path.name + ".deusproof.jsonl")
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _read_receipts(rp: Path) -> list[dict]:
|
|
73
|
+
if not rp.exists():
|
|
74
|
+
return []
|
|
75
|
+
out = []
|
|
76
|
+
for line in rp.read_text(encoding="utf-8").splitlines():
|
|
77
|
+
line = line.strip()
|
|
78
|
+
if line:
|
|
79
|
+
try:
|
|
80
|
+
out.append(json.loads(line))
|
|
81
|
+
except ValueError:
|
|
82
|
+
continue
|
|
83
|
+
return out
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def seal_file(path: str | Path, *, notary: Any, receipts: Optional[str] = None) -> dict:
|
|
87
|
+
"""Hash `path` locally, timestamp the digest with `notary`, append a receipt. Returns the receipt."""
|
|
88
|
+
p = Path(path)
|
|
89
|
+
if not p.is_file():
|
|
90
|
+
raise FileNotFoundError(f"not a file: {p}")
|
|
91
|
+
digest, size = _sha256_prefix(p)
|
|
92
|
+
proof = notary.notarize_hash(output_hash=digest)
|
|
93
|
+
receipt = {
|
|
94
|
+
"file": p.name,
|
|
95
|
+
"sha256": digest,
|
|
96
|
+
"bytes": size,
|
|
97
|
+
"sealed_at": datetime.now(timezone.utc).isoformat(timespec="seconds"),
|
|
98
|
+
"certificate_id": proof.id,
|
|
99
|
+
"verify_url": proof.verify_url,
|
|
100
|
+
}
|
|
101
|
+
rp = _receipts_path(p, receipts)
|
|
102
|
+
rp.parent.mkdir(parents=True, exist_ok=True)
|
|
103
|
+
with rp.open("a", encoding="utf-8") as fh:
|
|
104
|
+
fh.write(json.dumps(receipt, ensure_ascii=False) + "\n")
|
|
105
|
+
return receipt
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def verify_file(path: str | Path, *, receipts: Optional[str] = None) -> list[dict]:
|
|
109
|
+
"""Check `path` against every receipt. Offline: re-hashes the sealed prefix of each.
|
|
110
|
+
|
|
111
|
+
Each result: the receipt plus `ok` (sealed bytes unchanged) and `added` (bytes
|
|
112
|
+
appended since). The timestamp itself is checked at `verify_url`, or offline
|
|
113
|
+
from the receipts at /api/anchors/{seed,tsr,ots}/<certificate_id>."""
|
|
114
|
+
p = Path(path)
|
|
115
|
+
rp = _receipts_path(p, receipts)
|
|
116
|
+
rows = _read_receipts(rp)
|
|
117
|
+
if not rows:
|
|
118
|
+
raise FileNotFoundError(f"no receipts at {rp}")
|
|
119
|
+
size_now = p.stat().st_size if p.is_file() else -1
|
|
120
|
+
results = []
|
|
121
|
+
for r in rows:
|
|
122
|
+
want = int(r.get("bytes", -1))
|
|
123
|
+
if size_now < 0 or want < 0 or size_now < want:
|
|
124
|
+
results.append({**r, "ok": False, "added": 0, "why": "file is shorter than what was sealed"})
|
|
125
|
+
continue
|
|
126
|
+
got, _ = _sha256_prefix(p, want)
|
|
127
|
+
ok = got == r.get("sha256")
|
|
128
|
+
results.append({**r, "ok": ok, "added": size_now - want if ok else 0,
|
|
129
|
+
"why": "" if ok else "the sealed bytes were changed"})
|
|
130
|
+
return results
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# ---------------------------------------------------------------------- CLI
|
|
134
|
+
def _too_soon(path: Path, receipts: Optional[str], min_gap: float, *, skip_unchanged: bool) -> str:
|
|
135
|
+
"""Why this seal should be skipped, or "" to go ahead. Reads only the local receipts."""
|
|
136
|
+
rows = _read_receipts(_receipts_path(path, receipts))
|
|
137
|
+
if not rows:
|
|
138
|
+
return ""
|
|
139
|
+
last = rows[-1]
|
|
140
|
+
if skip_unchanged and int(last.get("bytes", -1)) == path.stat().st_size:
|
|
141
|
+
digest, _ = _sha256_prefix(path)
|
|
142
|
+
if digest == last.get("sha256"):
|
|
143
|
+
return "unchanged since the last seal"
|
|
144
|
+
if min_gap > 0:
|
|
145
|
+
try:
|
|
146
|
+
then = datetime.fromisoformat(str(last.get("sealed_at")))
|
|
147
|
+
except ValueError:
|
|
148
|
+
return ""
|
|
149
|
+
minutes = (datetime.now(timezone.utc) - then).total_seconds() / 60
|
|
150
|
+
if minutes < min_gap:
|
|
151
|
+
return f"last seal {minutes:.0f} min ago (--min-gap {min_gap:g})"
|
|
152
|
+
return ""
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _notary(args: argparse.Namespace):
|
|
156
|
+
from .notary import Notary # imported here so `verify` works without network deps configured
|
|
157
|
+
|
|
158
|
+
handle = args.handle or os.environ.get("DEUSPROOF_HANDLE", "")
|
|
159
|
+
if not handle:
|
|
160
|
+
raise SystemExit("seal needs a public name: --handle NAME or DEUSPROOF_HANDLE=NAME")
|
|
161
|
+
kw = {"handle": handle, "platform": args.platform}
|
|
162
|
+
if args.base_url:
|
|
163
|
+
kw["base_url"] = args.base_url
|
|
164
|
+
return Notary(**kw)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def _cmd_seal(args: argparse.Namespace) -> int:
|
|
168
|
+
target = args.path
|
|
169
|
+
if args.hook:
|
|
170
|
+
try:
|
|
171
|
+
event = json.loads(sys.stdin.read() or "{}")
|
|
172
|
+
target = event.get("transcript_path") or target
|
|
173
|
+
if not target:
|
|
174
|
+
print("deusproof: hook event has no transcript_path; nothing sealed", file=sys.stderr)
|
|
175
|
+
else:
|
|
176
|
+
p = Path(os.path.expanduser(target))
|
|
177
|
+
why = _too_soon(p, args.receipts, args.min_gap, skip_unchanged=True) if p.is_file() else ""
|
|
178
|
+
if why:
|
|
179
|
+
print(f"deusproof: skipped, {why}", file=sys.stderr)
|
|
180
|
+
else:
|
|
181
|
+
r = seal_file(p, notary=_notary(args), receipts=args.receipts)
|
|
182
|
+
print(f"deusproof: sealed {r['bytes']} bytes | {r['verify_url']}", file=sys.stderr)
|
|
183
|
+
except BaseException as e: # a witness must never break the session it witnesses
|
|
184
|
+
print(f"deusproof: not sealed ({e})", file=sys.stderr)
|
|
185
|
+
print("{}")
|
|
186
|
+
return 0
|
|
187
|
+
if not target:
|
|
188
|
+
raise SystemExit("seal needs a file path (or --hook)")
|
|
189
|
+
if args.min_gap > 0 and Path(target).is_file():
|
|
190
|
+
why = _too_soon(Path(target), args.receipts, args.min_gap, skip_unchanged=False)
|
|
191
|
+
if why:
|
|
192
|
+
print(f"skipped {Path(target).name}: {why}")
|
|
193
|
+
return 0
|
|
194
|
+
r = seal_file(target, notary=_notary(args), receipts=args.receipts)
|
|
195
|
+
print(f"sealed {r['file']} | {r['bytes']} bytes | sha256 {r['sha256']}")
|
|
196
|
+
print(f" {r['verify_url']}")
|
|
197
|
+
print(f" receipt kept in {_receipts_path(Path(target), args.receipts)}")
|
|
198
|
+
return 0
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _cmd_verify(args: argparse.Namespace) -> int:
|
|
202
|
+
try:
|
|
203
|
+
results = verify_file(args.path, receipts=args.receipts)
|
|
204
|
+
except FileNotFoundError as e:
|
|
205
|
+
print(f"BROKEN: {e}")
|
|
206
|
+
return 1
|
|
207
|
+
bad = 0
|
|
208
|
+
for r in results:
|
|
209
|
+
if r["ok"]:
|
|
210
|
+
extra = f" | {r['added']} bytes added since" if r["added"] else ""
|
|
211
|
+
print(f"OK {r['sealed_at']} | first {r['bytes']} bytes unchanged{extra} | {r['verify_url']}")
|
|
212
|
+
else:
|
|
213
|
+
bad += 1
|
|
214
|
+
print(f"BROKEN {r['sealed_at']} | {r['why']} | sealed sha256 {r['sha256']}")
|
|
215
|
+
return 1 if bad else 0
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def main(argv: Optional[list] = None) -> int:
|
|
219
|
+
ap = argparse.ArgumentParser(prog="deusproof", description="Timestamp files and logs with an outside witness. Only a SHA-256 leaves your machine.")
|
|
220
|
+
sub = ap.add_subparsers(dest="cmd", required=True)
|
|
221
|
+
|
|
222
|
+
s = sub.add_parser("seal", help="timestamp a file or log (only its SHA-256 is sent)")
|
|
223
|
+
s.add_argument("path", nargs="?", help="file to seal")
|
|
224
|
+
s.add_argument("--handle", help="public name for the seal (or DEUSPROOF_HANDLE)")
|
|
225
|
+
s.add_argument("--platform", default="cli", help="label for where the seal comes from (default: cli)")
|
|
226
|
+
s.add_argument("--receipts", help="where to keep receipts (default: <file>.deusproof.jsonl)")
|
|
227
|
+
s.add_argument("--base-url", help=argparse.SUPPRESS)
|
|
228
|
+
s.add_argument("--hook", action="store_true", help="read a hook event (JSON on stdin) and seal its transcript_path; never fails")
|
|
229
|
+
s.add_argument("--min-gap", type=float, default=0, metavar="MINUTES",
|
|
230
|
+
help="skip if the last seal of this file is more recent than this (useful for per-turn hooks)")
|
|
231
|
+
s.set_defaults(func=_cmd_seal)
|
|
232
|
+
|
|
233
|
+
v = sub.add_parser("verify", help="check a file against its receipts (offline)")
|
|
234
|
+
v.add_argument("path")
|
|
235
|
+
v.add_argument("--receipts")
|
|
236
|
+
v.set_defaults(func=_cmd_verify)
|
|
237
|
+
|
|
238
|
+
a = sub.add_parser("audit", help="hash-chained audit logs (deusproof.audit)")
|
|
239
|
+
a.add_argument("rest", nargs=argparse.REMAINDER)
|
|
240
|
+
a.set_defaults(func=lambda ns: __import__("deusproof.audit", fromlist=["_main"])._main(ns.rest))
|
|
241
|
+
|
|
242
|
+
args = ap.parse_args(argv)
|
|
243
|
+
return args.func(args)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
if __name__ == "__main__": # pragma: no cover
|
|
247
|
+
sys.exit(main())
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deusproof
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Prove your AI agent's work existed at a given moment — one call, self-signed, timestamped and Bitcoin-anchored on a public append-only register. Free.
|
|
5
5
|
Author: DEUSPROOF
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://deusproof.com
|
|
8
8
|
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
-
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph
|
|
9
|
+
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph,claude-code,cursor,cli
|
|
10
10
|
Requires-Python: >=3.9
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: httpx>=0.24
|
|
@@ -106,6 +106,56 @@ It records runs, tool calls and model outputs (hashed; add `keep_payload=True` t
|
|
|
106
106
|
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
107
107
|
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
108
108
|
|
|
109
|
+
## Seal any log you already have: no code changes
|
|
110
|
+
|
|
111
|
+
Your tool already writes a log (an agent runtime, an audit trail, a JSONL of tool calls)? Seal it
|
|
112
|
+
from the command line. Only its SHA-256 leaves your machine.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
deusproof seal runtime.jsonl --handle my-endpoint # e.g. once a day from cron
|
|
116
|
+
deusproof verify runtime.jsonl # anyone, any time, offline
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Logs grow, so each receipt records how many bytes it covered and `verify` re-hashes exactly that
|
|
120
|
+
part: lines appended later still pass; anything changed or cut inside a sealed part fails. Receipts
|
|
121
|
+
are kept beside the file in `runtime.jsonl.deusproof.jsonl` (no content, just digest, size, time
|
|
122
|
+
and the link to check the timestamp and the Bitcoin anchor).
|
|
123
|
+
|
|
124
|
+
### Claude Code: every session sealed
|
|
125
|
+
|
|
126
|
+
Add a `SessionEnd` hook to `.claude/settings.json` (or `~/.claude/settings.json` for all projects):
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"hooks": {
|
|
131
|
+
"SessionEnd": [
|
|
132
|
+
{ "hooks": [ { "type": "command",
|
|
133
|
+
"command": "deusproof seal --hook --handle my-dev-agent --platform claude-code" } ] }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
When a session ends, its transcript is fingerprinted and sealed. The transcript never leaves your
|
|
140
|
+
machine. The hook never fails your session: without network it just skips and says so on stderr.
|
|
141
|
+
|
|
142
|
+
### Cursor: the same, from its `stop` hook
|
|
143
|
+
|
|
144
|
+
Add to `.cursor/hooks.json` (or `~/.cursor/hooks.json` for all projects):
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"version": 1,
|
|
149
|
+
"hooks": {
|
|
150
|
+
"stop": [ { "command": "deusproof seal --hook --handle my-dev-agent --platform cursor --min-gap 15" } ]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Cursor's `stop` fires after every agent turn, so the hook skips a transcript that has not changed
|
|
156
|
+
since its last seal, and `--min-gap 15` seals at most once every 15 minutes. Nothing is lost: each
|
|
157
|
+
seal covers everything before it.
|
|
158
|
+
|
|
109
159
|
## Use it from LangChain
|
|
110
160
|
|
|
111
161
|
```bash
|
|
@@ -2,11 +2,13 @@ README.md
|
|
|
2
2
|
pyproject.toml
|
|
3
3
|
deusproof/__init__.py
|
|
4
4
|
deusproof/audit.py
|
|
5
|
+
deusproof/cli.py
|
|
5
6
|
deusproof/langchain.py
|
|
6
7
|
deusproof/langchain_audit.py
|
|
7
8
|
deusproof/notary.py
|
|
8
9
|
deusproof.egg-info/PKG-INFO
|
|
9
10
|
deusproof.egg-info/SOURCES.txt
|
|
10
11
|
deusproof.egg-info/dependency_links.txt
|
|
12
|
+
deusproof.egg-info/entry_points.txt
|
|
11
13
|
deusproof.egg-info/requires.txt
|
|
12
14
|
deusproof.egg-info/top_level.txt
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deusproof"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "Prove your AI agent's work existed at a given moment — one call, self-signed, timestamped and Bitcoin-anchored on a public append-only register. Free."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -15,7 +15,7 @@ dependencies = [
|
|
|
15
15
|
"cryptography>=41",
|
|
16
16
|
"base58>=2.1",
|
|
17
17
|
]
|
|
18
|
-
keywords = ["ai-agents", "provenance", "audit-log", "tamper-evident", "did", "bitcoin", "rfc3161", "langchain", "langgraph"]
|
|
18
|
+
keywords = ["ai-agents", "provenance", "audit-log", "tamper-evident", "did", "bitcoin", "rfc3161", "langchain", "langgraph", "claude-code", "cursor", "cli"]
|
|
19
19
|
|
|
20
20
|
# LA SONDA, COMO EXTRA OPCIONAL (16-sep-2026). Quien instale `deusproof` a secas
|
|
21
21
|
# no se descarga el arbol de LangChain; solo lo pide quien lo va a usar.
|
|
@@ -23,6 +23,11 @@ keywords = ["ai-agents", "provenance", "audit-log", "tamper-evident", "did", "bi
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
24
|
langchain = ["langchain-core>=0.3", "pydantic>=2"]
|
|
25
25
|
|
|
26
|
+
# EL COMANDO (16-nov-2026): `deusproof seal <fichero>` sella cualquier registro sin tocar
|
|
27
|
+
# el codigo de la herramienta que lo escribe; `--hook` lo convierte en gancho de Claude Code.
|
|
28
|
+
[project.scripts]
|
|
29
|
+
deusproof = "deusproof.cli:main"
|
|
30
|
+
|
|
26
31
|
[project.urls]
|
|
27
32
|
Homepage = "https://deusproof.com"
|
|
28
33
|
Pantheon = "https://deusproof.com/pantheon"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|