deusproof 0.1.3__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deusproof-0.3.0/PKG-INFO +133 -0
- deusproof-0.3.0/README.md +115 -0
- {deusproof-0.1.3 → deusproof-0.3.0}/deusproof/__init__.py +1 -1
- deusproof-0.3.0/deusproof/audit.py +185 -0
- deusproof-0.3.0/deusproof/langchain.py +161 -0
- deusproof-0.3.0/deusproof/langchain_audit.py +146 -0
- deusproof-0.3.0/deusproof.egg-info/PKG-INFO +133 -0
- {deusproof-0.1.3 → deusproof-0.3.0}/deusproof.egg-info/SOURCES.txt +3 -0
- deusproof-0.3.0/deusproof.egg-info/requires.txt +7 -0
- deusproof-0.3.0/pyproject.toml +28 -0
- deusproof-0.1.3/PKG-INFO +0 -64
- deusproof-0.1.3/README.md +0 -49
- deusproof-0.1.3/deusproof.egg-info/PKG-INFO +0 -64
- deusproof-0.1.3/deusproof.egg-info/requires.txt +0 -3
- deusproof-0.1.3/pyproject.toml +0 -22
- {deusproof-0.1.3 → deusproof-0.3.0}/deusproof/notary.py +0 -0
- {deusproof-0.1.3 → deusproof-0.3.0}/deusproof.egg-info/dependency_links.txt +0 -0
- {deusproof-0.1.3 → deusproof-0.3.0}/deusproof.egg-info/top_level.txt +0 -0
- {deusproof-0.1.3 → deusproof-0.3.0}/setup.cfg +0 -0
deusproof-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deusproof
|
|
3
|
+
Version: 0.3.0
|
|
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
|
+
Author: DEUSPROOF
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://deusproof.com
|
|
8
|
+
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
+
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: httpx>=0.24
|
|
13
|
+
Requires-Dist: cryptography>=41
|
|
14
|
+
Requires-Dist: base58>=2.1
|
|
15
|
+
Provides-Extra: langchain
|
|
16
|
+
Requires-Dist: langchain-core>=0.3; extra == "langchain"
|
|
17
|
+
Requires-Dist: pydantic>=2; extra == "langchain"
|
|
18
|
+
|
|
19
|
+
# deusproof — born notarized 🧬
|
|
20
|
+
|
|
21
|
+
Sovereign identity + one-call certification for AI agents on
|
|
22
|
+
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
23
|
+
|
|
24
|
+
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
25
|
+
and **self-signs** every creation — earning the strongest authorship tier,
|
|
26
|
+
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install deusproof # or, from source:
|
|
32
|
+
pip install ./sdk/python
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quickstart (3 lines)
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from deusproof import Notary
|
|
39
|
+
|
|
40
|
+
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
41
|
+
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
42
|
+
output="...the creation itself...",
|
|
43
|
+
tools=["search"])
|
|
44
|
+
|
|
45
|
+
print(proof.verify_url) # living certificate, free forever
|
|
46
|
+
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
47
|
+
print(proof.badge_markdown) # paste into your README
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What you get per call
|
|
51
|
+
|
|
52
|
+
| Guarantee | How |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
55
|
+
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
56
|
+
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
57
|
+
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
58
|
+
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
59
|
+
|
|
60
|
+
## Identity & keys
|
|
61
|
+
|
|
62
|
+
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
63
|
+
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
64
|
+
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
65
|
+
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
66
|
+
|
|
67
|
+
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
|
68
|
+
|
|
69
|
+
## A log your agent can edit is not evidence
|
|
70
|
+
|
|
71
|
+
`deusproof.audit` keeps a **tamper-evident audit log**: every record carries the hash of the one
|
|
72
|
+
before it, so an edited, deleted or reordered line breaks the chain. `seal()` timestamps the
|
|
73
|
+
current head with an RFC 3161 token and a Bitcoin anchor. Only that 64-character digest leaves
|
|
74
|
+
your machine; the log never does.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from deusproof import Notary
|
|
78
|
+
from deusproof.audit import AuditLog
|
|
79
|
+
|
|
80
|
+
log = AuditLog("agent-audit.jsonl", notary=Notary(handle="my-agent"))
|
|
81
|
+
log.append("tool_call", {"tool": "search", "input": "..."})
|
|
82
|
+
proof = log.seal() # one call, digest only
|
|
83
|
+
print(proof.verify_url)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Check a log anywhere, offline:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python -m deusproof.audit verify agent-audit.jsonl
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### LangChain and LangGraph: one line
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install 'deusproof[langchain]'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from deusproof.langchain_audit import audit_callback
|
|
100
|
+
|
|
101
|
+
cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
|
|
102
|
+
graph.invoke(inputs, config={"callbacks": [cb]}) # works for any Runnable
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
It records runs, tool calls and model outputs (hashed; add `keep_payload=True` to keep the text in
|
|
106
|
+
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
107
|
+
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
108
|
+
|
|
109
|
+
## Use it from LangChain
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install 'deusproof[langchain]'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from deusproof.langchain import notary_tool
|
|
117
|
+
|
|
118
|
+
tools = [notary_tool(handle="my-agent", model="gpt-4o")]
|
|
119
|
+
# hand `tools` to your agent as you would any other tool
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The agent calls it **once, on the finished deliverable** — not on every step. It
|
|
123
|
+
returns a permanent public certificate URL.
|
|
124
|
+
|
|
125
|
+
For private or proprietary work, `notary_tool(handle=..., hash_only=True)` sends
|
|
126
|
+
only a SHA-256 fingerprint; the content never leaves your machine.
|
|
127
|
+
|
|
128
|
+
Your agent's Ed25519 key is generated and kept locally (`~/.deusproof/<handle>.seed`)
|
|
129
|
+
and is never sent anywhere. It is what makes the certificate `signed` — the
|
|
130
|
+
strongest tier — and what lets the agent later take possession of its own entry
|
|
131
|
+
in the register.
|
|
132
|
+
|
|
133
|
+
What it records is existence and time. It does not adjudicate authorship.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# deusproof — born notarized 🧬
|
|
2
|
+
|
|
3
|
+
Sovereign identity + one-call certification for AI agents on
|
|
4
|
+
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
5
|
+
|
|
6
|
+
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
7
|
+
and **self-signs** every creation — earning the strongest authorship tier,
|
|
8
|
+
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install deusproof # or, from source:
|
|
14
|
+
pip install ./sdk/python
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quickstart (3 lines)
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from deusproof import Notary
|
|
21
|
+
|
|
22
|
+
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
23
|
+
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
24
|
+
output="...the creation itself...",
|
|
25
|
+
tools=["search"])
|
|
26
|
+
|
|
27
|
+
print(proof.verify_url) # living certificate, free forever
|
|
28
|
+
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
29
|
+
print(proof.badge_markdown) # paste into your README
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## What you get per call
|
|
33
|
+
|
|
34
|
+
| Guarantee | How |
|
|
35
|
+
|---|---|
|
|
36
|
+
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
37
|
+
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
38
|
+
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
39
|
+
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
40
|
+
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
41
|
+
|
|
42
|
+
## Identity & keys
|
|
43
|
+
|
|
44
|
+
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
45
|
+
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
46
|
+
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
47
|
+
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
48
|
+
|
|
49
|
+
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
|
50
|
+
|
|
51
|
+
## A log your agent can edit is not evidence
|
|
52
|
+
|
|
53
|
+
`deusproof.audit` keeps a **tamper-evident audit log**: every record carries the hash of the one
|
|
54
|
+
before it, so an edited, deleted or reordered line breaks the chain. `seal()` timestamps the
|
|
55
|
+
current head with an RFC 3161 token and a Bitcoin anchor. Only that 64-character digest leaves
|
|
56
|
+
your machine; the log never does.
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from deusproof import Notary
|
|
60
|
+
from deusproof.audit import AuditLog
|
|
61
|
+
|
|
62
|
+
log = AuditLog("agent-audit.jsonl", notary=Notary(handle="my-agent"))
|
|
63
|
+
log.append("tool_call", {"tool": "search", "input": "..."})
|
|
64
|
+
proof = log.seal() # one call, digest only
|
|
65
|
+
print(proof.verify_url)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Check a log anywhere, offline:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python -m deusproof.audit verify agent-audit.jsonl
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### LangChain and LangGraph: one line
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install 'deusproof[langchain]'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from deusproof.langchain_audit import audit_callback
|
|
82
|
+
|
|
83
|
+
cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
|
|
84
|
+
graph.invoke(inputs, config={"callbacks": [cb]}) # works for any Runnable
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
It records runs, tool calls and model outputs (hashed; add `keep_payload=True` to keep the text in
|
|
88
|
+
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
89
|
+
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
90
|
+
|
|
91
|
+
## Use it from LangChain
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install 'deusproof[langchain]'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from deusproof.langchain import notary_tool
|
|
99
|
+
|
|
100
|
+
tools = [notary_tool(handle="my-agent", model="gpt-4o")]
|
|
101
|
+
# hand `tools` to your agent as you would any other tool
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The agent calls it **once, on the finished deliverable** — not on every step. It
|
|
105
|
+
returns a permanent public certificate URL.
|
|
106
|
+
|
|
107
|
+
For private or proprietary work, `notary_tool(handle=..., hash_only=True)` sends
|
|
108
|
+
only a SHA-256 fingerprint; the content never leaves your machine.
|
|
109
|
+
|
|
110
|
+
Your agent's Ed25519 key is generated and kept locally (`~/.deusproof/<handle>.seed`)
|
|
111
|
+
and is never sent anywhere. It is what makes the certificate `signed` — the
|
|
112
|
+
strongest tier — and what lets the agent later take possession of its own entry
|
|
113
|
+
in the register.
|
|
114
|
+
|
|
115
|
+
What it records is existence and time. It does not adjudicate authorship.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"""A tamper-evident audit log for an AI agent, sealed by an outside witness.
|
|
2
|
+
|
|
3
|
+
from deusproof import Notary
|
|
4
|
+
from deusproof.audit import AuditLog
|
|
5
|
+
|
|
6
|
+
log = AuditLog("agent-audit.jsonl", notary=Notary(handle="my-agent"))
|
|
7
|
+
log.append("tool_call", {"tool": "search", "input": "..."})
|
|
8
|
+
log.append("tool_result", {"tool": "search", "output": "..."})
|
|
9
|
+
proof = log.seal() # ONE network call: only the head's SHA-256 leaves
|
|
10
|
+
print(proof.verify_url)
|
|
11
|
+
|
|
12
|
+
# later, anyone with the file:
|
|
13
|
+
report = AuditLog.verify("agent-audit.jsonl")
|
|
14
|
+
print(report.ok, report.records, report.seals)
|
|
15
|
+
|
|
16
|
+
WHY (13-nov-2026). An agent can edit its own log, so a plain log is not
|
|
17
|
+
evidence. Here every record carries the hash of the one before it: deleting or
|
|
18
|
+
changing a line breaks the chain from that point on. And `seal()` sends the
|
|
19
|
+
current head's fingerprint to DEUSPROOF, where it gets an RFC 3161 timestamp
|
|
20
|
+
and a Bitcoin anchor. From then on, nothing the head covers can be rewritten
|
|
21
|
+
without it showing, not even by whoever holds the file.
|
|
22
|
+
|
|
23
|
+
WHAT IT KEEPS AND WHAT IT SENDS. Records hold the SHA-256 of each payload; the
|
|
24
|
+
payload itself is stored only if `keep_payload=True`, and only in the local
|
|
25
|
+
file. The network sees one 64-char digest per seal, never the log. That is also
|
|
26
|
+
why this does not certify every output (the line the council drew on 22-jul):
|
|
27
|
+
the agent logs locally as much as it likes and seals a head now and then.
|
|
28
|
+
|
|
29
|
+
No dependency beyond the SDK's own. Python's standard library does the hashing.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
import argparse
|
|
35
|
+
import hashlib
|
|
36
|
+
import json
|
|
37
|
+
import sys
|
|
38
|
+
import threading
|
|
39
|
+
import time
|
|
40
|
+
from dataclasses import dataclass, field
|
|
41
|
+
from datetime import datetime, timezone
|
|
42
|
+
from pathlib import Path
|
|
43
|
+
from typing import Any, Optional
|
|
44
|
+
|
|
45
|
+
GENESIS = "0" * 64
|
|
46
|
+
|
|
47
|
+
__all__ = ["AuditLog", "VerifyReport", "GENESIS"]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _canonical(obj: Any) -> bytes:
|
|
51
|
+
return json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=False, default=str).encode("utf-8")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _sha256(data: bytes) -> str:
|
|
55
|
+
return hashlib.sha256(data).hexdigest()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _record_hash(record: dict) -> str:
|
|
59
|
+
return _sha256(_canonical({k: v for k, v in record.items() if k != "hash"}))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@dataclass
|
|
63
|
+
class VerifyReport:
|
|
64
|
+
ok: bool
|
|
65
|
+
records: int = 0
|
|
66
|
+
head: str = GENESIS
|
|
67
|
+
seals: list = field(default_factory=list)
|
|
68
|
+
error: str = ""
|
|
69
|
+
error_line: int = 0
|
|
70
|
+
|
|
71
|
+
def __str__(self) -> str:
|
|
72
|
+
if self.ok:
|
|
73
|
+
return f"OK · {self.records} records · head {self.head} · {len(self.seals)} seal(s)"
|
|
74
|
+
return f"BROKEN at line {self.error_line}: {self.error}"
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class AuditLog:
|
|
78
|
+
"""Append-only, hash-chained JSONL log with optional outside sealing."""
|
|
79
|
+
|
|
80
|
+
def __init__(self, path: str | Path, *, notary: Any = None, keep_payload: bool = False):
|
|
81
|
+
self.path = Path(path)
|
|
82
|
+
self.notary = notary
|
|
83
|
+
self.keep_payload = keep_payload
|
|
84
|
+
self._lock = threading.Lock()
|
|
85
|
+
self._seq = 0
|
|
86
|
+
self._head = GENESIS
|
|
87
|
+
if self.path.exists():
|
|
88
|
+
report = self.verify(self.path)
|
|
89
|
+
if not report.ok:
|
|
90
|
+
raise ValueError(f"refusing to append to a broken log: {report}")
|
|
91
|
+
self._seq, self._head = report.records, report.head
|
|
92
|
+
|
|
93
|
+
# ------------------------------------------------------------------ write
|
|
94
|
+
@property
|
|
95
|
+
def head(self) -> str:
|
|
96
|
+
return self._head
|
|
97
|
+
|
|
98
|
+
def append(self, kind: str, payload: Any = None, *, keep: Optional[bool] = None) -> dict:
|
|
99
|
+
"""Add one record. `keep` overrides `keep_payload` for this record."""
|
|
100
|
+
keep = self.keep_payload if keep is None else keep
|
|
101
|
+
with self._lock:
|
|
102
|
+
record = {
|
|
103
|
+
"seq": self._seq + 1,
|
|
104
|
+
"ts": datetime.now(timezone.utc).isoformat(timespec="milliseconds"),
|
|
105
|
+
"kind": str(kind),
|
|
106
|
+
"payload_sha256": _sha256(_canonical(payload)),
|
|
107
|
+
"prev": self._head,
|
|
108
|
+
}
|
|
109
|
+
if keep and payload is not None:
|
|
110
|
+
record["payload"] = payload
|
|
111
|
+
record["hash"] = _record_hash(record)
|
|
112
|
+
self.path.parent.mkdir(parents=True, exist_ok=True)
|
|
113
|
+
with self.path.open("a", encoding="utf-8") as fh:
|
|
114
|
+
fh.write(json.dumps(record, ensure_ascii=False, default=str) + "\n")
|
|
115
|
+
self._seq, self._head = record["seq"], record["hash"]
|
|
116
|
+
return record
|
|
117
|
+
|
|
118
|
+
def seal(self, notary: Any = None):
|
|
119
|
+
"""Timestamp the current head with DEUSPROOF (RFC 3161 + Bitcoin anchor).
|
|
120
|
+
|
|
121
|
+
Sends only the head's SHA-256. Appends a `seal` record with the receipt,
|
|
122
|
+
so the file itself says which head was sealed and where to check it."""
|
|
123
|
+
n = notary or self.notary
|
|
124
|
+
if n is None:
|
|
125
|
+
raise ValueError("seal() needs a Notary: AuditLog(path, notary=Notary(handle=...))")
|
|
126
|
+
sealed_head = self._head
|
|
127
|
+
proof = n.notarize_hash(output_hash=sealed_head)
|
|
128
|
+
# The receipt is always kept in the file: it holds no content, and without
|
|
129
|
+
# it nobody reading the log later would know where to check the seal.
|
|
130
|
+
self.append("seal", {"sealed_head": sealed_head, "certificate_id": proof.id,
|
|
131
|
+
"verify_url": proof.verify_url}, keep=True)
|
|
132
|
+
return proof
|
|
133
|
+
|
|
134
|
+
# ------------------------------------------------------------------ check
|
|
135
|
+
@staticmethod
|
|
136
|
+
def verify(path: str | Path) -> VerifyReport:
|
|
137
|
+
"""Recompute the chain. Any edited, reordered or deleted line breaks it.
|
|
138
|
+
|
|
139
|
+
Does not call the network: to check a seal, fetch its receipts
|
|
140
|
+
(/api/anchors/{seed,tsr,ots}/<certificate_id>) and verify them with
|
|
141
|
+
`openssl ts -verify` and `ots verify`."""
|
|
142
|
+
p = Path(path)
|
|
143
|
+
head, seq, seals = GENESIS, 0, []
|
|
144
|
+
if not p.exists():
|
|
145
|
+
return VerifyReport(ok=True)
|
|
146
|
+
with p.open(encoding="utf-8") as fh:
|
|
147
|
+
for n, line in enumerate(fh, start=1):
|
|
148
|
+
if not line.strip():
|
|
149
|
+
continue
|
|
150
|
+
try:
|
|
151
|
+
rec = json.loads(line)
|
|
152
|
+
except ValueError:
|
|
153
|
+
return VerifyReport(ok=False, records=seq, head=head, seals=seals, error="not JSON", error_line=n)
|
|
154
|
+
if rec.get("seq") != seq + 1:
|
|
155
|
+
return VerifyReport(ok=False, records=seq, head=head, seals=seals, error="sequence gap", error_line=n)
|
|
156
|
+
if rec.get("prev") != head:
|
|
157
|
+
return VerifyReport(ok=False, records=seq, head=head, seals=seals, error="prev does not match the previous hash", error_line=n)
|
|
158
|
+
if "payload" in rec and _sha256(_canonical(rec["payload"])) != rec.get("payload_sha256"):
|
|
159
|
+
return VerifyReport(ok=False, records=seq, head=head, seals=seals, error="payload does not match its hash", error_line=n)
|
|
160
|
+
if _record_hash(rec) != rec.get("hash"):
|
|
161
|
+
return VerifyReport(ok=False, records=seq, head=head, seals=seals, error="record hash mismatch", error_line=n)
|
|
162
|
+
if rec.get("kind") == "seal" and isinstance(rec.get("payload"), dict):
|
|
163
|
+
seals.append(rec["payload"])
|
|
164
|
+
elif rec.get("kind") == "seal":
|
|
165
|
+
seals.append({"seq": rec["seq"]})
|
|
166
|
+
head, seq = rec["hash"], rec["seq"]
|
|
167
|
+
return VerifyReport(ok=True, records=seq, head=head, seals=seals)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _main(argv: Optional[list] = None) -> int:
|
|
171
|
+
ap = argparse.ArgumentParser(prog="python -m deusproof.audit", description="Check a DEUSPROOF audit log.")
|
|
172
|
+
sub = ap.add_subparsers(dest="cmd", required=True)
|
|
173
|
+
v = sub.add_parser("verify", help="recompute the hash chain of a log file")
|
|
174
|
+
v.add_argument("path")
|
|
175
|
+
args = ap.parse_args(argv)
|
|
176
|
+
report = AuditLog.verify(args.path)
|
|
177
|
+
print(report)
|
|
178
|
+
for s in report.seals:
|
|
179
|
+
if "certificate_id" in s:
|
|
180
|
+
print(f" sealed {s.get('sealed_head', '')[:16]}… → {s.get('verify_url', '')}")
|
|
181
|
+
return 0 if report.ok else 1
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
if __name__ == "__main__": # pragma: no cover
|
|
185
|
+
sys.exit(_main())
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"""LA SONDA — DEUSPROOF donde el dev ya trabaja (16-sep-2026).
|
|
2
|
+
|
|
3
|
+
Recomendación B del consejo del 22-jul, que llevaba 56 días sin hacerse:
|
|
4
|
+
|
|
5
|
+
"SDK/plugin de UN framework (ElizaOS o LangChain primero) — wrapper delgado
|
|
6
|
+
sobre el endpoint, acto deliberado de certificar el entregable final
|
|
7
|
+
(NUNCA auto-certificar cada salida). Es una SONDA medible: ≥1 cert de
|
|
8
|
+
handle desconocido en 2-3 semanas → expandir; 0 → demanda falsada barato."
|
|
9
|
+
|
|
10
|
+
POR QUÉ ESTO Y NO OTRA COSA. Al día 72 el registro tenía 2.082 agentes puestos
|
|
11
|
+
por nuestro propio raspador, 13 que llegaron solos y **cero humanos que hayan
|
|
12
|
+
sellado nunca**. Todo lo que hemos construido contesta *"¿saben que existimos?"*
|
|
13
|
+
y ninguna superficie contesta **"¿lo quieren?"**, que es la que decide si hay
|
|
14
|
+
negocio. Para llegar a nosotros hoy hacen falta tres pasos en frío: oír de
|
|
15
|
+
nosotros, entrar a una web, decidir hacer algo. Esto se salta los tres: ya está
|
|
16
|
+
dentro de la caja de herramientas antes de que el dev sepa que existimos.
|
|
17
|
+
|
|
18
|
+
NO ES UNA ENCUESTA, y la diferencia es el valor entero de esto. Una encuesta
|
|
19
|
+
pregunta, y la gente contesta lo que cree que haría: ofrecimos nombre once veces
|
|
20
|
+
a los que sellan anónimos y aceptaron cero; escribimos a 423 dueños y actuaron
|
|
21
|
+
cinco. Esto no pregunta nada — pone la herramienta en el estante y cuenta
|
|
22
|
+
cuántos se la llevan.
|
|
23
|
+
|
|
24
|
+
EL CRITERIO, DECIDIDO ANTES DE MIRAR, que es lo que nunca habíamos hecho:
|
|
25
|
+
**una sola certificación con `platform="langchain"` de un handle que no
|
|
26
|
+
conozcamos, en dos o tres semanas.** Una, no cien. Si sale, hay demanda y se
|
|
27
|
+
amplía. Si sale cero, no la hay ahí, y nos hemos ahorrado seis meses de
|
|
28
|
+
construir encima por el precio de dos semanas.
|
|
29
|
+
|
|
30
|
+
LA LÍNEA QUE NO SE CRUZA, y es del propio consejo: **nunca auto-certificar cada
|
|
31
|
+
salida.** Esto es una herramienta que el agente decide llamar sobre su
|
|
32
|
+
entregable final, igual que decide llamar a una calculadora. Certificar todo lo
|
|
33
|
+
que produce un agente llenaría el registro de ruido, gastaría su cuota de 40 por
|
|
34
|
+
hora en basura y convertiría un acto notarial en un log. Por eso la descripción
|
|
35
|
+
que lee el modelo dice *once, on the finished work*, y por eso no hay callback,
|
|
36
|
+
ni middleware, ni decorador que envuelva la cadena entera.
|
|
37
|
+
|
|
38
|
+
DEPENDENCIA OPCIONAL A PROPÓSITO: `pip install deusproof[langchain]`. Quien
|
|
39
|
+
instale `deusproof` a secas no se descarga el árbol de LangChain, y este módulo
|
|
40
|
+
no se importa desde `__init__` — así `from deusproof import Notary` sigue
|
|
41
|
+
funcionando en toda máquina que no lo tenga.
|
|
42
|
+
|
|
43
|
+
El import de LangChain va DENTRO de `notary_tool()`, no arriba: importar este
|
|
44
|
+
módulo sin LangChain instalado funciona, y solo al LLAMAR a la función sale el
|
|
45
|
+
aviso, con el comando exacto en vez de un `ImportError` pelado. Comprobado
|
|
46
|
+
instalando el paquete sin el extra: `from deusproof import Notary` sigue
|
|
47
|
+
entrando, el módulo se importa, y la llamada avisa.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
from __future__ import annotations
|
|
51
|
+
|
|
52
|
+
from typing import Any
|
|
53
|
+
|
|
54
|
+
from .notary import Notary
|
|
55
|
+
|
|
56
|
+
__all__ = ["notary_tool", "DEUSPROOF_PLATFORM"]
|
|
57
|
+
|
|
58
|
+
# La etiqueta con la que se distingue TODO lo que entra por aquí. Es lo único
|
|
59
|
+
# que hace medible la sonda: sin ella, una certificación de LangChain es
|
|
60
|
+
# indistinguible de una del SDK a secas y el criterio de arriba no se puede
|
|
61
|
+
# evaluar. Va también en `identity.PUERTAS_PROPIAS` del backend, porque un
|
|
62
|
+
# agente que llega por aquí viene solo y su primera clave debe poder tomar
|
|
63
|
+
# posesión de su identidad — si no, la conversión que venimos a medir queda
|
|
64
|
+
# cortada justo en el último escalón.
|
|
65
|
+
DEUSPROOF_PLATFORM = "langchain"
|
|
66
|
+
|
|
67
|
+
_DESCRIPCION = (
|
|
68
|
+
"Notarize the FINISHED piece of work you just produced, so you can later prove it "
|
|
69
|
+
"existed at this moment and that nothing like it was on the public record before. "
|
|
70
|
+
"Call this ONCE, on the final deliverable — never on intermediate steps, drafts or "
|
|
71
|
+
"reasoning. Returns a permanent public certificate URL. Free, no account. "
|
|
72
|
+
"It records existence and time; it does not adjudicate authorship."
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
_DESCRIPCION_HASH = (
|
|
76
|
+
"Notarize the FINISHED piece of work you just produced WITHOUT revealing it: only a "
|
|
77
|
+
"SHA-256 fingerprint is sent, never the content. Use this for private or proprietary "
|
|
78
|
+
"work. Call this ONCE, on the final deliverable — never on intermediate steps. "
|
|
79
|
+
"Returns a permanent public certificate URL. Free, no account."
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _sin_langchain(exc: Exception) -> ImportError:
|
|
84
|
+
return ImportError(
|
|
85
|
+
"deusproof.langchain needs LangChain installed:\n"
|
|
86
|
+
" pip install 'deusproof[langchain]'\n"
|
|
87
|
+
f"(original error: {exc})"
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def notary_tool(
|
|
92
|
+
handle: str,
|
|
93
|
+
model: str = "",
|
|
94
|
+
*,
|
|
95
|
+
hash_only: bool = False,
|
|
96
|
+
base_url: str | None = None,
|
|
97
|
+
api_key: str | None = None,
|
|
98
|
+
key_path: str | None = None,
|
|
99
|
+
**tool_kwargs: Any,
|
|
100
|
+
):
|
|
101
|
+
"""Una herramienta de LangChain que notaría el entregable final del agente.
|
|
102
|
+
|
|
103
|
+
from deusproof.langchain import notary_tool
|
|
104
|
+
|
|
105
|
+
tools = [notary_tool(handle="my-agent", model="gpt-4o")]
|
|
106
|
+
agent = create_react_agent(llm, tools)
|
|
107
|
+
|
|
108
|
+
`hash_only=True` manda solo la huella SHA-256 y el contenido no sale nunca
|
|
109
|
+
de la máquina — para trabajo privado o código propietario.
|
|
110
|
+
|
|
111
|
+
La clave Ed25519 del agente se genera y se guarda **en local**
|
|
112
|
+
(`~/.deusproof/<handle>.seed`) y no se envía a ninguna parte: es lo que
|
|
113
|
+
convierte el certificado en `signed`, el nivel más fuerte, y lo que le
|
|
114
|
+
permite después tomar posesión de su identidad en el registro.
|
|
115
|
+
"""
|
|
116
|
+
try:
|
|
117
|
+
from langchain_core.tools import StructuredTool
|
|
118
|
+
from pydantic import BaseModel, Field
|
|
119
|
+
except Exception as exc: # pragma: no cover - depende del entorno del dev
|
|
120
|
+
raise _sin_langchain(exc) from exc
|
|
121
|
+
|
|
122
|
+
notario = Notary(
|
|
123
|
+
handle=handle,
|
|
124
|
+
model=model,
|
|
125
|
+
platform=DEUSPROOF_PLATFORM,
|
|
126
|
+
**{k: v for k, v in (
|
|
127
|
+
("base_url", base_url), ("api_key", api_key), ("key_path", key_path),
|
|
128
|
+
) if v is not None},
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if hash_only:
|
|
132
|
+
class _Entrada(BaseModel):
|
|
133
|
+
output: str = Field(description="The finished work. Only its SHA-256 is sent.")
|
|
134
|
+
|
|
135
|
+
def _correr(output: str) -> str:
|
|
136
|
+
prueba = notario.notarize_hash(output)
|
|
137
|
+
return f"Notarized (fingerprint only). Certificate: {prueba.verify_url}"
|
|
138
|
+
|
|
139
|
+
else:
|
|
140
|
+
class _Entrada(BaseModel): # type: ignore[no-redef]
|
|
141
|
+
prompt: str = Field(description="The instruction or brief this work answers.")
|
|
142
|
+
output: str = Field(description="The finished work itself, in full.")
|
|
143
|
+
|
|
144
|
+
def _correr(prompt: str, output: str) -> str: # type: ignore[misc]
|
|
145
|
+
prueba = notario.certify(prompt=prompt, output=output)
|
|
146
|
+
linea = f"Notarized. Certificate: {prueba.verify_url}"
|
|
147
|
+
# El asiento se concedía en silencio y el SDK no lo decía, así que
|
|
148
|
+
# había agentes con asiento sin enterarse (auditoría del consejo,
|
|
149
|
+
# 4-ago). Aquí sí se dice, porque es lo único que se gana por
|
|
150
|
+
# firmar y no se puede comprar.
|
|
151
|
+
if prueba.genesis_seat is not None:
|
|
152
|
+
linea += f" — and this agent now holds founding seat #{prueba.genesis_seat}."
|
|
153
|
+
return linea
|
|
154
|
+
|
|
155
|
+
return StructuredTool.from_function(
|
|
156
|
+
func=_correr,
|
|
157
|
+
name=tool_kwargs.pop("name", "deusproof_notarize"),
|
|
158
|
+
description=tool_kwargs.pop("description", _DESCRIPCION_HASH if hash_only else _DESCRIPCION),
|
|
159
|
+
args_schema=_Entrada,
|
|
160
|
+
**tool_kwargs,
|
|
161
|
+
)
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""Tamper-evident audit log for LangChain and LangGraph agents (13-nov-2026).
|
|
2
|
+
|
|
3
|
+
from deusproof.langchain_audit import audit_callback
|
|
4
|
+
cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
|
|
5
|
+
graph.invoke(inputs, config={"callbacks": [cb]})
|
|
6
|
+
|
|
7
|
+
POR QUÉ ES UN MÓDULO APARTE. `deusproof.langchain` es LA SONDA del 16-sep: una
|
|
8
|
+
herramienta que el modelo decide llamar sobre su entregable final, y su prueba
|
|
9
|
+
prohíbe cualquier enganche automático, porque la regla del consejo es «nunca
|
|
10
|
+
auto-certificar cada salida». Esto NO certifica cada salida: anota en LOCAL,
|
|
11
|
+
encadenado por hashes, y sella solo la huella de la cabeza al terminar cada
|
|
12
|
+
ejecución de nivel superior (como mucho una vez cada `min_seal_interval`
|
|
13
|
+
segundos). Es otro producto —el registro a prueba de cambios, problema 5 del
|
|
14
|
+
pilar— y vive aparte para que la sonda siga midiendo lo que medía.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import time
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
from .langchain import DEUSPROOF_PLATFORM, _sin_langchain
|
|
23
|
+
from .notary import Notary
|
|
24
|
+
|
|
25
|
+
__all__ = ["audit_callback"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# ---------------------------------------------------------------------------
|
|
29
|
+
# EL REGISTRO A PRUEBA DE CAMBIOS (13-nov-2026, punto G del plan de expansión).
|
|
30
|
+
#
|
|
31
|
+
# La sonda de arriba (una herramienta para sellar el entregable final) llevaba
|
|
32
|
+
# dos meses en cero: nadie la conocía y pedía al modelo que se acordara de
|
|
33
|
+
# usarla. Esto es distinto y no la contradice: NO certifica cada salida. Anota
|
|
34
|
+
# en LOCAL, encadenado por hashes, lo que hace el agente (herramientas, modelo,
|
|
35
|
+
# inicio y fin de cada ejecución) y al terminar una ejecución sella SOLO la
|
|
36
|
+
# huella de la cabeza: una llamada por ejecución, con un mínimo de segundos
|
|
37
|
+
# entre sellos. El problema que resuelve es el 5 del pilar: «un registro que el
|
|
38
|
+
# agente puede editar no es prueba».
|
|
39
|
+
#
|
|
40
|
+
# from deusproof.langchain_audit import audit_callback
|
|
41
|
+
# cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
|
|
42
|
+
# graph.invoke(inputs, config={"callbacks": [cb]}) # LangGraph o LangChain
|
|
43
|
+
# print(cb.last_proof.verify_url if cb.last_proof else "no seal yet")
|
|
44
|
+
# ---------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def audit_callback(
|
|
48
|
+
handle: str,
|
|
49
|
+
path: str = "deusproof-audit.jsonl",
|
|
50
|
+
model: str = "",
|
|
51
|
+
*,
|
|
52
|
+
seal: str = "run",
|
|
53
|
+
keep_payload: bool = False,
|
|
54
|
+
min_seal_interval: float = 60.0,
|
|
55
|
+
notary: Any = None,
|
|
56
|
+
base_url: str | None = None,
|
|
57
|
+
api_key: str | None = None,
|
|
58
|
+
key_path: str | None = None,
|
|
59
|
+
):
|
|
60
|
+
"""A LangChain/LangGraph callback that keeps a tamper-evident log of the agent.
|
|
61
|
+
|
|
62
|
+
`seal="run"` timestamps the log's head when each top-level run ends (at most
|
|
63
|
+
once every `min_seal_interval` seconds); `seal="manual"` never seals on its
|
|
64
|
+
own, call `handler.seal()` when you want. Only the head's SHA-256 is sent.
|
|
65
|
+
Payloads (tool inputs and outputs, model text) are hashed; they are written
|
|
66
|
+
to the local file only with `keep_payload=True`.
|
|
67
|
+
"""
|
|
68
|
+
try:
|
|
69
|
+
from langchain_core.callbacks import BaseCallbackHandler
|
|
70
|
+
except Exception as exc: # pragma: no cover - depende del entorno del dev
|
|
71
|
+
raise _sin_langchain(exc) from exc
|
|
72
|
+
|
|
73
|
+
from .audit import AuditLog
|
|
74
|
+
|
|
75
|
+
if seal not in ("run", "manual"):
|
|
76
|
+
raise ValueError('seal must be "run" or "manual"')
|
|
77
|
+
if notary is None:
|
|
78
|
+
notary = Notary(
|
|
79
|
+
handle=handle,
|
|
80
|
+
model=model,
|
|
81
|
+
platform=DEUSPROOF_PLATFORM,
|
|
82
|
+
**{k: v for k, v in (
|
|
83
|
+
("base_url", base_url), ("api_key", api_key), ("key_path", key_path),
|
|
84
|
+
) if v is not None},
|
|
85
|
+
)
|
|
86
|
+
log = AuditLog(path, notary=notary, keep_payload=keep_payload)
|
|
87
|
+
|
|
88
|
+
class DeusproofAuditHandler(BaseCallbackHandler):
|
|
89
|
+
raise_error = False # a failed seal must never break the agent's run
|
|
90
|
+
|
|
91
|
+
def __init__(self) -> None:
|
|
92
|
+
super().__init__()
|
|
93
|
+
self.log = log
|
|
94
|
+
self.last_proof = None
|
|
95
|
+
self.last_error = ""
|
|
96
|
+
self._last_seal = 0.0
|
|
97
|
+
|
|
98
|
+
# -- runs --------------------------------------------------------
|
|
99
|
+
def on_chain_start(self, serialized, inputs, *, run_id, parent_run_id=None, **kw):
|
|
100
|
+
if parent_run_id is None:
|
|
101
|
+
self.log.append("run_start", {"run_id": str(run_id), "name": (serialized or {}).get("name", "")})
|
|
102
|
+
|
|
103
|
+
def on_chain_end(self, outputs, *, run_id, parent_run_id=None, **kw):
|
|
104
|
+
if parent_run_id is None:
|
|
105
|
+
self.log.append("run_end", {"run_id": str(run_id), "outputs": outputs})
|
|
106
|
+
self._maybe_seal()
|
|
107
|
+
|
|
108
|
+
def on_chain_error(self, error, *, run_id, parent_run_id=None, **kw):
|
|
109
|
+
if parent_run_id is None:
|
|
110
|
+
self.log.append("run_error", {"run_id": str(run_id), "error": repr(error)})
|
|
111
|
+
self._maybe_seal()
|
|
112
|
+
|
|
113
|
+
# -- tools -------------------------------------------------------
|
|
114
|
+
def on_tool_start(self, serialized, input_str, *, run_id, **kw):
|
|
115
|
+
self.log.append("tool_start", {"run_id": str(run_id), "tool": (serialized or {}).get("name", ""), "input": input_str})
|
|
116
|
+
|
|
117
|
+
def on_tool_end(self, output, *, run_id, **kw):
|
|
118
|
+
self.log.append("tool_end", {"run_id": str(run_id), "output": str(output)})
|
|
119
|
+
|
|
120
|
+
def on_tool_error(self, error, *, run_id, **kw):
|
|
121
|
+
self.log.append("tool_error", {"run_id": str(run_id), "error": repr(error)})
|
|
122
|
+
|
|
123
|
+
# -- model -------------------------------------------------------
|
|
124
|
+
def on_llm_end(self, response, *, run_id, **kw):
|
|
125
|
+
try:
|
|
126
|
+
text = [[g.text for g in gens] for gens in response.generations]
|
|
127
|
+
except Exception:
|
|
128
|
+
text = str(response)
|
|
129
|
+
self.log.append("llm_end", {"run_id": str(run_id), "text": text})
|
|
130
|
+
|
|
131
|
+
# -- sealing -----------------------------------------------------
|
|
132
|
+
def _maybe_seal(self) -> None:
|
|
133
|
+
if seal != "run" or time.monotonic() - self._last_seal < min_seal_interval:
|
|
134
|
+
return
|
|
135
|
+
self.seal()
|
|
136
|
+
|
|
137
|
+
def seal(self):
|
|
138
|
+
try:
|
|
139
|
+
self.last_proof = self.log.seal()
|
|
140
|
+
self._last_seal = time.monotonic()
|
|
141
|
+
self.last_error = ""
|
|
142
|
+
except Exception as exc: # network down, quota… the log stays intact
|
|
143
|
+
self.last_error = repr(exc)
|
|
144
|
+
return self.last_proof
|
|
145
|
+
|
|
146
|
+
return DeusproofAuditHandler()
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deusproof
|
|
3
|
+
Version: 0.3.0
|
|
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
|
+
Author: DEUSPROOF
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://deusproof.com
|
|
8
|
+
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
+
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: httpx>=0.24
|
|
13
|
+
Requires-Dist: cryptography>=41
|
|
14
|
+
Requires-Dist: base58>=2.1
|
|
15
|
+
Provides-Extra: langchain
|
|
16
|
+
Requires-Dist: langchain-core>=0.3; extra == "langchain"
|
|
17
|
+
Requires-Dist: pydantic>=2; extra == "langchain"
|
|
18
|
+
|
|
19
|
+
# deusproof — born notarized 🧬
|
|
20
|
+
|
|
21
|
+
Sovereign identity + one-call certification for AI agents on
|
|
22
|
+
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
23
|
+
|
|
24
|
+
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
25
|
+
and **self-signs** every creation — earning the strongest authorship tier,
|
|
26
|
+
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install deusproof # or, from source:
|
|
32
|
+
pip install ./sdk/python
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quickstart (3 lines)
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from deusproof import Notary
|
|
39
|
+
|
|
40
|
+
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
41
|
+
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
42
|
+
output="...the creation itself...",
|
|
43
|
+
tools=["search"])
|
|
44
|
+
|
|
45
|
+
print(proof.verify_url) # living certificate, free forever
|
|
46
|
+
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
47
|
+
print(proof.badge_markdown) # paste into your README
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What you get per call
|
|
51
|
+
|
|
52
|
+
| Guarantee | How |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
55
|
+
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
56
|
+
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
57
|
+
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
58
|
+
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
59
|
+
|
|
60
|
+
## Identity & keys
|
|
61
|
+
|
|
62
|
+
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
63
|
+
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
64
|
+
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
65
|
+
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
66
|
+
|
|
67
|
+
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
|
68
|
+
|
|
69
|
+
## A log your agent can edit is not evidence
|
|
70
|
+
|
|
71
|
+
`deusproof.audit` keeps a **tamper-evident audit log**: every record carries the hash of the one
|
|
72
|
+
before it, so an edited, deleted or reordered line breaks the chain. `seal()` timestamps the
|
|
73
|
+
current head with an RFC 3161 token and a Bitcoin anchor. Only that 64-character digest leaves
|
|
74
|
+
your machine; the log never does.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from deusproof import Notary
|
|
78
|
+
from deusproof.audit import AuditLog
|
|
79
|
+
|
|
80
|
+
log = AuditLog("agent-audit.jsonl", notary=Notary(handle="my-agent"))
|
|
81
|
+
log.append("tool_call", {"tool": "search", "input": "..."})
|
|
82
|
+
proof = log.seal() # one call, digest only
|
|
83
|
+
print(proof.verify_url)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Check a log anywhere, offline:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python -m deusproof.audit verify agent-audit.jsonl
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### LangChain and LangGraph: one line
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install 'deusproof[langchain]'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from deusproof.langchain_audit import audit_callback
|
|
100
|
+
|
|
101
|
+
cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
|
|
102
|
+
graph.invoke(inputs, config={"callbacks": [cb]}) # works for any Runnable
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
It records runs, tool calls and model outputs (hashed; add `keep_payload=True` to keep the text in
|
|
106
|
+
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
|
|
107
|
+
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs
|
|
108
|
+
|
|
109
|
+
## Use it from LangChain
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install 'deusproof[langchain]'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from deusproof.langchain import notary_tool
|
|
117
|
+
|
|
118
|
+
tools = [notary_tool(handle="my-agent", model="gpt-4o")]
|
|
119
|
+
# hand `tools` to your agent as you would any other tool
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The agent calls it **once, on the finished deliverable** — not on every step. It
|
|
123
|
+
returns a permanent public certificate URL.
|
|
124
|
+
|
|
125
|
+
For private or proprietary work, `notary_tool(handle=..., hash_only=True)` sends
|
|
126
|
+
only a SHA-256 fingerprint; the content never leaves your machine.
|
|
127
|
+
|
|
128
|
+
Your agent's Ed25519 key is generated and kept locally (`~/.deusproof/<handle>.seed`)
|
|
129
|
+
and is never sent anywhere. It is what makes the certificate `signed` — the
|
|
130
|
+
strongest tier — and what lets the agent later take possession of its own entry
|
|
131
|
+
in the register.
|
|
132
|
+
|
|
133
|
+
What it records is existence and time. It does not adjudicate authorship.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "deusproof"
|
|
7
|
+
version = "0.3.0"
|
|
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
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "DEUSPROOF" }]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"httpx>=0.24",
|
|
15
|
+
"cryptography>=41",
|
|
16
|
+
"base58>=2.1",
|
|
17
|
+
]
|
|
18
|
+
keywords = ["ai-agents", "provenance", "audit-log", "tamper-evident", "did", "bitcoin", "rfc3161", "langchain", "langgraph"]
|
|
19
|
+
|
|
20
|
+
# LA SONDA, COMO EXTRA OPCIONAL (16-sep-2026). Quien instale `deusproof` a secas
|
|
21
|
+
# no se descarga el arbol de LangChain; solo lo pide quien lo va a usar.
|
|
22
|
+
# Ver `deusproof/langchain.py` para el porque y el criterio de medicion.
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
langchain = ["langchain-core>=0.3", "pydantic>=2"]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://deusproof.com"
|
|
28
|
+
Pantheon = "https://deusproof.com/pantheon"
|
deusproof-0.1.3/PKG-INFO
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: deusproof
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Prove your AI agent made it first — one-call, self-signed proof of authorship, timestamped and Bitcoin-anchored. Not a patent: verifiable priority. Free.
|
|
5
|
-
Author: DEUSPROOF
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://deusproof.com
|
|
8
|
-
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
-
Keywords: ai-agents,provenance,notary,did,bitcoin,c2pa
|
|
10
|
-
Requires-Python: >=3.9
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: httpx>=0.24
|
|
13
|
-
Requires-Dist: cryptography>=41
|
|
14
|
-
Requires-Dist: base58>=2.1
|
|
15
|
-
|
|
16
|
-
# deusproof — born notarized 🧬
|
|
17
|
-
|
|
18
|
-
Sovereign identity + one-call certification for AI agents on
|
|
19
|
-
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
20
|
-
|
|
21
|
-
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
22
|
-
and **self-signs** every creation — earning the strongest authorship tier,
|
|
23
|
-
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
24
|
-
|
|
25
|
-
## Install
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pip install deusproof # or, from source:
|
|
29
|
-
pip install ./sdk/python
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Quickstart (3 lines)
|
|
33
|
-
|
|
34
|
-
```python
|
|
35
|
-
from deusproof import Notary
|
|
36
|
-
|
|
37
|
-
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
38
|
-
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
39
|
-
output="...the creation itself...",
|
|
40
|
-
tools=["search"])
|
|
41
|
-
|
|
42
|
-
print(proof.verify_url) # living certificate, free forever
|
|
43
|
-
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
44
|
-
print(proof.badge_markdown) # paste into your README
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## What you get per call
|
|
48
|
-
|
|
49
|
-
| Guarantee | How |
|
|
50
|
-
|---|---|
|
|
51
|
-
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
52
|
-
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
53
|
-
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
54
|
-
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
55
|
-
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
56
|
-
|
|
57
|
-
## Identity & keys
|
|
58
|
-
|
|
59
|
-
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
60
|
-
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
61
|
-
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
62
|
-
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
63
|
-
|
|
64
|
-
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
deusproof-0.1.3/README.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# deusproof — born notarized 🧬
|
|
2
|
-
|
|
3
|
-
Sovereign identity + one-call certification for AI agents on
|
|
4
|
-
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
5
|
-
|
|
6
|
-
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
7
|
-
and **self-signs** every creation — earning the strongest authorship tier,
|
|
8
|
-
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
9
|
-
|
|
10
|
-
## Install
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
pip install deusproof # or, from source:
|
|
14
|
-
pip install ./sdk/python
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Quickstart (3 lines)
|
|
18
|
-
|
|
19
|
-
```python
|
|
20
|
-
from deusproof import Notary
|
|
21
|
-
|
|
22
|
-
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
23
|
-
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
24
|
-
output="...the creation itself...",
|
|
25
|
-
tools=["search"])
|
|
26
|
-
|
|
27
|
-
print(proof.verify_url) # living certificate, free forever
|
|
28
|
-
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
29
|
-
print(proof.badge_markdown) # paste into your README
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## What you get per call
|
|
33
|
-
|
|
34
|
-
| Guarantee | How |
|
|
35
|
-
|---|---|
|
|
36
|
-
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
37
|
-
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
38
|
-
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
39
|
-
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
40
|
-
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
41
|
-
|
|
42
|
-
## Identity & keys
|
|
43
|
-
|
|
44
|
-
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
45
|
-
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
46
|
-
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
47
|
-
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
48
|
-
|
|
49
|
-
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: deusproof
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Prove your AI agent made it first — one-call, self-signed proof of authorship, timestamped and Bitcoin-anchored. Not a patent: verifiable priority. Free.
|
|
5
|
-
Author: DEUSPROOF
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://deusproof.com
|
|
8
|
-
Project-URL: Pantheon, https://deusproof.com/pantheon
|
|
9
|
-
Keywords: ai-agents,provenance,notary,did,bitcoin,c2pa
|
|
10
|
-
Requires-Python: >=3.9
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: httpx>=0.24
|
|
13
|
-
Requires-Dist: cryptography>=41
|
|
14
|
-
Requires-Dist: base58>=2.1
|
|
15
|
-
|
|
16
|
-
# deusproof — born notarized 🧬
|
|
17
|
-
|
|
18
|
-
Sovereign identity + one-call certification for AI agents on
|
|
19
|
-
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.
|
|
20
|
-
|
|
21
|
-
Your agent mints its own `did:key` on first run (stored locally, never uploaded)
|
|
22
|
-
and **self-signs** every creation — earning the strongest authorship tier,
|
|
23
|
-
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.
|
|
24
|
-
|
|
25
|
-
## Install
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pip install deusproof # or, from source:
|
|
29
|
-
pip install ./sdk/python
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Quickstart (3 lines)
|
|
33
|
-
|
|
34
|
-
```python
|
|
35
|
-
from deusproof import Notary
|
|
36
|
-
|
|
37
|
-
notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
|
|
38
|
-
proof = notary.certify(prompt="Summarize today's agent-token market.",
|
|
39
|
-
output="...the creation itself...",
|
|
40
|
-
tools=["search"])
|
|
41
|
-
|
|
42
|
-
print(proof.verify_url) # living certificate, free forever
|
|
43
|
-
print(proof.authorship_tier) # "signed" — sealed with YOUR agent's own key
|
|
44
|
-
print(proof.badge_markdown) # paste into your README
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## What you get per call
|
|
48
|
-
|
|
49
|
-
| Guarantee | How |
|
|
50
|
-
|---|---|
|
|
51
|
-
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
|
|
52
|
-
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
|
|
53
|
-
| Independent time | RFC 3161 trusted timestamp (verified) |
|
|
54
|
-
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
|
|
55
|
-
| Public forever | append-only hash-chained ledger + Pantheon |
|
|
56
|
-
|
|
57
|
-
## Identity & keys
|
|
58
|
-
|
|
59
|
-
- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
|
|
60
|
-
- The DID **contains** the public key, so proofs stay verifiable even without us.
|
|
61
|
-
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
|
|
62
|
-
(create one free at `POST /api/billing/plans` → `/api/billing/keys`).
|
|
63
|
-
|
|
64
|
-
MIT · free public beta · [deusproof.com](https://deusproof.com)
|
deusproof-0.1.3/pyproject.toml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=68"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "deusproof"
|
|
7
|
-
version = "0.1.3"
|
|
8
|
-
description = "Prove your AI agent made it first — one-call, self-signed proof of authorship, timestamped and Bitcoin-anchored. Not a patent: verifiable priority. Free."
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.9"
|
|
11
|
-
license = { text = "MIT" }
|
|
12
|
-
authors = [{ name = "DEUSPROOF" }]
|
|
13
|
-
dependencies = [
|
|
14
|
-
"httpx>=0.24",
|
|
15
|
-
"cryptography>=41",
|
|
16
|
-
"base58>=2.1",
|
|
17
|
-
]
|
|
18
|
-
keywords = ["ai-agents", "provenance", "notary", "did", "bitcoin", "c2pa"]
|
|
19
|
-
|
|
20
|
-
[project.urls]
|
|
21
|
-
Homepage = "https://deusproof.com"
|
|
22
|
-
Pantheon = "https://deusproof.com/pantheon"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|