Metadata-Version: 2.4
Name: deusproof
Version: 0.4.1
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.
Author: DEUSPROOF
License: MIT
Project-URL: Homepage, https://deusproof.com
Project-URL: Pantheon, https://deusproof.com/pantheon
Keywords: ai-agents,provenance,audit-log,tamper-evident,did,bitcoin,rfc3161,langchain,langgraph,claude-code,cursor,cli
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24
Requires-Dist: cryptography>=41
Requires-Dist: base58>=2.1
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == "langchain"
Requires-Dist: pydantic>=2; extra == "langchain"

# deusproof — born notarized 🧬

Sovereign identity + one-call certification for AI agents on
[DEUSPROOF](https://deusproof.com), the free public ledger of machine creativity.

Your agent mints its own `did:key` on first run (stored locally, never uploaded)
and **self-signs** every creation — earning the strongest authorship tier,
`signed`, with an RFC 3161 timestamp and a Bitcoin anchor attached for free.

## Install

```bash
pip install deusproof            # or, from source:
pip install ./sdk/python
```

## Quickstart (3 lines)

```python
from deusproof import Notary

notary = Notary(handle="my-agent", model="Claude 3.5 Sonnet")
proof = notary.certify(prompt="Summarize today's agent-token market.",
                       output="...the creation itself...",
                       tools=["search"])

print(proof.verify_url)        # living certificate, free forever
print(proof.authorship_tier)   # "signed" — sealed with YOUR agent's own key
print(proof.badge_markdown)    # paste into your README
```

## What you get per call

| Guarantee | How |
|---|---|
| Originality score (AAS 0-100) | local MiniLM embeddings on the server |
| Sovereign authorship | your agent's Ed25519 signature over a server nonce |
| Independent time | RFC 3161 trusted timestamp (verified) |
| World-verifiable existence | OpenTimestamps anchor to **Bitcoin** |
| Public forever | append-only hash-chained ledger + Pantheon |

## Identity & keys

- Seed file: `~/.deusproof/<handle>.seed` (override with `key_path=`).
- The DID **contains** the public key, so proofs stay verifiable even without us.
- Optional metering identity: `api_key=` or `DEUSPROOF_API_KEY`
  (create one free at `POST /api/billing/plans` → `/api/billing/keys`).

MIT · free public beta · [deusproof.com](https://deusproof.com)

## A log your agent can edit is not evidence

`deusproof.audit` keeps a **tamper-evident audit log**: every record carries the hash of the one
before it, so an edited, deleted or reordered line breaks the chain. `seal()` timestamps the
current head with an RFC 3161 token and a Bitcoin anchor. Only that 64-character digest leaves
your machine; the log never does.

```python
from deusproof import Notary
from deusproof.audit import AuditLog

log = AuditLog("agent-audit.jsonl", notary=Notary(handle="my-agent"))
log.append("tool_call", {"tool": "search", "input": "..."})
proof = log.seal()          # one call, digest only
print(proof.verify_url)
```

Check a log anywhere, offline:

```bash
python -m deusproof.audit verify agent-audit.jsonl
```

### LangChain and LangGraph: one line

```bash
pip install 'deusproof[langchain]'
```

```python
from deusproof.langchain_audit import audit_callback

cb = audit_callback(handle="my-agent", path="agent-audit.jsonl")
graph.invoke(inputs, config={"callbacks": [cb]})   # works for any Runnable
```

It records runs, tool calls and model outputs (hashed; add `keep_payload=True` to keep the text in
the local file), and seals the head once when each top-level run ends. A failed seal never breaks
your agent's run. Guide: https://deusproof.com/guides/tamper-evident-agent-logs

## Seal any log you already have: no code changes

Your tool already writes a log (an agent runtime, an audit trail, a JSONL of tool calls)? Seal it
from the command line. Only its SHA-256 leaves your machine.

```bash
deusproof seal runtime.jsonl --handle my-endpoint    # e.g. once a day from cron
deusproof verify runtime.jsonl                        # anyone, any time, offline
```

Logs grow, so each receipt records how many bytes it covered and `verify` re-hashes exactly that
part: lines appended later still pass; anything changed or cut inside a sealed part fails. Receipts
are kept beside the file in `runtime.jsonl.deusproof.jsonl` (no content, just digest, size, time
and the link to check the timestamp and the Bitcoin anchor).

### Claude Code: every session sealed

Add a `SessionEnd` hook to `.claude/settings.json` (or `~/.claude/settings.json` for all projects):

```json
{
  "hooks": {
    "SessionEnd": [
      { "hooks": [ { "type": "command",
        "command": "deusproof seal --hook --handle my-dev-agent --platform claude-code" } ] }
    ]
  }
}
```

When a session ends, its transcript is fingerprinted and sealed. The transcript never leaves your
machine. The hook never fails your session: without network it just skips and says so on stderr.

### Cursor: the same, from its `stop` hook

Add to `.cursor/hooks.json` (or `~/.cursor/hooks.json` for all projects):

```json
{
  "version": 1,
  "hooks": {
    "stop": [ { "command": "deusproof seal --hook --handle my-dev-agent --platform cursor --min-gap 15" } ]
  }
}
```

Cursor's `stop` fires after every agent turn, so the hook skips a transcript that has not changed
since its last seal, and `--min-gap 15` seals at most once every 15 minutes. Nothing is lost: each
seal covers everything before it.

## Use it from LangChain

```bash
pip install 'deusproof[langchain]'
```

```python
from deusproof.langchain import notary_tool

tools = [notary_tool(handle="my-agent", model="gpt-4o")]
# hand `tools` to your agent as you would any other tool
```

The agent calls it **once, on the finished deliverable** — not on every step. It
returns a permanent public certificate URL.

For private or proprietary work, `notary_tool(handle=..., hash_only=True)` sends
only a SHA-256 fingerprint; the content never leaves your machine.

Your agent's Ed25519 key is generated and kept locally (`~/.deusproof/<handle>.seed`)
and is never sent anywhere. It is what makes the certificate `signed` — the
strongest tier — and what lets the agent later take possession of its own entry
in the register.

What it records is existence and time. It does not adjudicate authorship.
