readproof

module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0

README

CI DSH plugin release license go website

Website · Docs · Install · Quickstart · Example agent · MCP · DeepSeek Harness · Roadmap


Readproof gives every document an AI agent reads a stable identity, a freshness policy, and a content-addressed snapshot — and records every run as a manifest you can diff, replay byte for byte without touching the live source, and hand over as evidence.

Models are probabilistic, but many context failures are infrastructural. Agent reliability is bounded by context reliability.

It is not a vector database, not an observability tool, not a prompt registry, not a memory system. It sits underneath those and makes their inputs reproducible. Install-time lockfiles (Microsoft APM, skills-lock.json) pin an agent's static configuration; Readproof pins the runtime documents, per run.

Sixty seconds, end to end

1. Give a document an identity and a freshness policy, then record a run.

readproof resource add readproof://demo/policies/refunds \
  --source-type filesystem --path policies/refunds.md --policy require_fresh
readproof run --id run-a readproof://demo/policies/refunds
Committed manifest manifest_01M0GQH8K8… for run run-a (1 entry)

2. The source changes. A later run picks it up — and the diff says exactly why.

printf 'Products can be refunded within 14 days.\n' > policies/refunds.md
readproof run --id run-b readproof://demo/policies/refunds
readproof diff run-a run-b
~ readproof://demo/policies/refunds
  why: source revision sha256:c8b0bb212e93 → sha256:8f4b00474456
  -Products can be refunded within 30 days.
  +Products can be refunded within 14 days.

3. Replay the first run from the store — the file is gone or changed, the bytes are not — and prove it.

readproof replay run-a
readproof evidence export run-a --with-content --out bundle.json
readproof evidence verify bundle.json
Products can be refunded within 30 days.
Replay verified: SHA256 match for 1/1 entries.
evidence verified: 1 entry, merkle root a9b73469f1a6…, replay match 1/1

SHA256(original) == SHA256(replay) is a test, not a slogan: the reference demo asserts it over SQLite, over Postgres + MinIO, and over a real HTTP round trip (examples/refund-agent).

Why

Failure you have seen What Readproof does about it
"It worked on Tuesday." A policy, price table, or runbook changed and the agent quietly answered from a different version. Every run records which revision of each document it read; readproof diff run-a run-b names the source revision and observation time that changed, then prints the unified diff.
"Can you rerun exactly that?" Tracing tools keep strings; they cannot hand you the bytes again once the source moved. readproof replay rebuilds a run's inputs from the content-addressed store and re-verifies every hash — no network, no source. Strict: any mismatch exits non-zero.
"What data did the agent consider?" EU AI Act Art. 12 logging (Annex III, from 2 Aug 2026) and SOC 2 reviews ask exactly this. readproof evidence export writes an in-toto Statement whose subject is a Merkle root over the run; verify checks it anywhere. Not legal advice — but it is the record.

How it works

  • Identityreadproof://<namespace>/<path>, independent of where the bytes live.
  • Policyrequire_fresh (re-verify every resolve), allow_stale --max-age (reuse within a TTL), or pin a reviewed snapshot by tag: …@prod delivers exactly that snapshot, no fetch, policy not consulted. Promotion is one pointer move; it is recorded and revertible.
  • Snapshot — immutable, content-addressed; identical bytes dedupe to one blob.
  • Manifest — the ordered list of what a run was delivered, by hash; entries record the ref they were mounted by, so moving a tag later can never change what a committed manifest replays.
  • Evidence — derived from a manifest on demand; the Go CLI and the TypeScript SDK produce byte-identical bundles, and the same Merkle root appears on the run's OpenTelemetry span.

Deep dive: docs/architecture.md.

Quickstart

Install

# Go 1.26+ — lands in $(go env GOPATH)/bin
go install github.com/fbzz/readproof/cmd/readproof@latest
go install github.com/fbzz/readproof/cmd/readproofd@latest   # only if you run the server

# macOS — the cask installs both binaries
brew install fbzz/tap/readproof

Or download a prebuilt archive for your platform from GitHub Releases: readproof_<version>_<os>_<arch>.tar.gz (.zip on Windows) contains readproof, readproofd, LICENSE, NOTICE, and this README.

Plainly: all three work once this repository is public and the first release is cut. Until then, build from source — which is what the embedded walkthrough below does anyway.

Embedded mode

One binary, a local .readproof/ directory, no services:

git clone https://github.com/fbzz/readproof.git
cd readproof
go build -o readproof ./cmd/readproof        # Go 1.26+

# identity + source + freshness policy
./readproof resource add readproof://demo/policies/refunds \
  --source-type filesystem \
  --path examples/refund-agent/policies/refunds.md \
  --policy require_fresh

./readproof run --id run-a readproof://demo/policies/refunds
./readproof replay run-a

Client/server mode

Postgres + S3-compatible store, one HTTP API for every client:

# Postgres, MinIO, an OTel collector and readproofd, from a clean clone
cp .env.example .env
docker compose up -d --build

# every command now talks to the server
export READPROOF_SERVER_URL=http://localhost:8080
./readproof get readproof://demo/policies/refunds

A containerized readproofd cannot see your host filesystem; use GitHub/HTTP sources there, or run readproofd --data-dir ~/.readproof on the host.

What you get

CLI readproof resource · get · inspect · history · run · manifest · diff · replay · tag · evidence · mcp — identical embedded or with --server
Server readproofd JSON API (/v1/resources, /v1/tags, /v1/resolve, /v1/runs, /v1/manifests, /v1/diff, /v1/replay), optional bearer auth, SQLite or Postgres + S3
MCP server readproof mcp resources as readproof:// URIs with provenance in _meta, 13 tools — Claude Code, Claude Desktop, Cursor (docs/mcp.md)
DeepSeek Harness plugin native bundle registering the same 13 tools, one Readproof run per DSH session, plus a zero-code MCP overlay (integrations/deepseek-harness)
TypeScript SDK @readproof/sdk typed, zero-dependency client; run().mount()…commit(), tags, diff, replay, buildEvidence() (sdk/typescript)
OpenTelemetry every pipeline stage traced; GenAI attributes (gen_ai.data_source.id); the commit span carries the evidence Merkle root; content never attached (docs/observability.md)
Evidence in-toto Statement v1, Merkle root over entries, redacted resource definitions, replay check; verify works offline (docs/evidence.md)

Examples

examples/support-agent A support agent on an open model via Ollama — one run per ticket, the policy changes, diff explains, replay returns the old bytes, the Go CLI verifies the evidence, a pinned @prod house style stays put. npm run scenario. Guide.
examples/langgraph-ts LangGraph.js: mount inside a node, store the manifest id in the checkpoint, replay from it.
examples/refund-agent The reference walkthrough of the invariant, driven from the shell; the automated version runs in go test ./....

Documentation

Website · Docs Guide-style documentation for the whole surface
docs/architecture.md Data model, internals, CLI and HTTP reference, SDK, observability, tests
docs/api.md · docs/mcp.md · docs/evidence.md · docs/observability.md Endpoint schemas · MCP setup · bundle format and what it proves · spans, attributes, metrics
docs/roadmap.md · CHANGELOG.md · docs/rename.md What's next · what changed · the Ctx → Readproof mapping
docs/releasing.md · docs/launch.md How a release is cut (tag → binaries, cask, npm) · launch copy and checklist

Status

v0.3.1 — Apache-2.0. Stable core (identity, policies, tags, snapshots, manifests, provenance-aware diff, strict replay, evidence), MCP server, OpenTelemetry, TypeScript SDK, SQLite or Postgres + S3, DeepSeek Harness plugin, three runnable examples. CI runs Go build/vet/test, the SDK and example suites, the DSH plugin suite, and a Docker Compose integration job that replays the demo against the built readproofd image on every push.

Next, in order (docs/roadmap.md): public release and packages (binaries, npm), Python SDK, trace-context propagation over the HTTP API, MCP HTTP transport, a source policy file (allow-lists), signed and OCI-distributed evidence bundles, tag promote, more adapters.

Security

No plaintext credentials at rest (env references resolved at fetch time; redaction everywhere), optional API-key auth on readproofd, labeled dev-only Compose credentials, dependency scanning. Not yet: SSRF allow-list for the HTTP adapter, signed bundles. Report vulnerabilities privately — see SECURITY.md.

Contributing

go build ./... && go vet ./... && gofmt -l . && go test ./... must be green with no external services; the SDK, examples, and plugin each have npm test. Conventions, the live-infra test block, and the pre-PR checklist are in CONTRIBUTING.md.

Community — questions and ideas in Discussions, bugs and feature requests in Issues, vulnerabilities privately via SECURITY.md. Everyone taking part is held to the Code of Conduct.

License

Apache-2.0 · NOTICE

Built for teams who have to answer for what their agents read.

Directories

Path Synopsis
cmd
readproof command
readproofd command
Command readproofd is the Readproof HTTP server: it wraps the same resolution pipeline the CLI uses in embedded mode behind a network API, so the CLI (via --server) and future SDKs can talk to a shared, durable backend.
Command readproofd is the Readproof HTTP server: it wraps the same resolution pipeline the CLI uses in embedded mode behind a network API, so the CLI (via --server) and future SDKs can talk to a shared, durable backend.
internal
api
Package api exposes the Readproof resolution pipeline over HTTP: the wire contract every handler here implements is defined in internal/wire, and shared by internal/client/remote on the client side.
Package api exposes the Readproof resolution pipeline over HTTP: the wire contract every handler here implements is defined in internal/wire, and shared by internal/client/remote on the client side.
app
client
Package client defines the operations the readproof CLI needs, with two implementations: local (direct in-process calls into an *app.App) and remote (HTTP calls to a running readproofd).
Package client defines the operations the readproof CLI needs, with two implementations: local (direct in-process calls into an *app.App) and remote (HTTP calls to a running readproofd).
client/local
Package local implements client.Client as thin, direct calls into an already-open *app.App — the exact same calls the CLI made before the client abstraction existed.
Package local implements client.Client as thin, direct calls into an already-open *app.App — the exact same calls the CLI made before the client abstraction existed.
client/remote
Package remote implements client.Client over HTTP calls to a running readproofd, using the same internal/wire types the server encodes/decodes.
Package remote implements client.Client over HTTP calls to a running readproofd, using the same internal/wire types the server encodes/decodes.
diff
Package diff computes the resolved-context difference between two manifests.
Package diff computes the resolved-context difference between two manifests.
evidence
Package evidence builds and verifies tamper-evident evidence bundles for a Readproof run: an in-toto Statement whose subject digest is a Merkle root over the run's manifest entries.
Package evidence builds and verifies tamper-evident evidence bundles for a Readproof run: an in-toto Statement whose subject digest is a Merkle root over the run's manifest entries.
ids
mcp
Package mcp exposes a Readproof deployment as a Model Context Protocol server: registered resources become readable `readproof://` MCP resources, and the operations behind the CLI (resolve, tags, runs, manifests, diff, replay, evidence) become MCP tools.
Package mcp exposes a Readproof deployment as a Model Context Protocol server: registered resources become readable `readproof://` MCP resources, and the operations behind the CLI (resolve, tags, runs, manifests, diff, replay, evidence) become MCP tools.
merkle
Package merkle implements the Merkle tree Readproof commits manifests with.
Package merkle implements the Merkle tree Readproof commits manifests with.
redact
Package redact identifies and masks header values that commonly carry credentials, so they never round-trip back out through API responses, `readproof inspect`, or `readproof resource list` — even if an operator pasted a raw secret instead of using the "${VAR}" environment-reference form the http source adapter resolves at fetch time (see internal/source/http).
Package redact identifies and masks header values that commonly carry credentials, so they never round-trip back out through API responses, `readproof inspect`, or `readproof resource list` — even if an operator pasted a raw secret instead of using the "${VAR}" environment-reference form the http source adapter resolves at fetch time (see internal/source/http).
run
source/http
Package http fetches content from a generic HTTP(S) endpoint.
Package http fetches content from a generic HTTP(S) endpoint.
storage/postgres
Package postgres is a drop-in PostgreSQL backend for the same storage interfaces internal/storage/sqlite implements (resource.Store, snapshot.Store, materialization.Store, manifest.Store, run.RunStore).
Package postgres is a drop-in PostgreSQL backend for the same storage interfaces internal/storage/sqlite implements (resource.Store, snapshot.Store, materialization.Store, manifest.Store, run.RunStore).
storage/s3blob
Package s3blob implements the blob.Store interface backed by an S3-compatible object store (MinIO in dev, and any S3-compatible service in production).
Package s3blob implements the blob.Store interface backed by an S3-compatible object store (MinIO in dev, and any S3-compatible service in production).
tag
Package tag defines named, movable pointers from a Resource to one of its Snapshots — `(resource_uri, tag) -> snapshot_id`.
Package tag defines named, movable pointers from a Resource to one of its Snapshots — `(resource_uri, tag) -> snapshot_id`.
telemetry
Package telemetry wires OpenTelemetry tracing and metrics for readproof/readproofd.
Package telemetry wires OpenTelemetry tracing and metrics for readproof/readproofd.
version
Package version is the single source of truth for the Readproof version.
Package version is the single source of truth for the Readproof version.
wire
Package wire defines the JSON request/response shapes for the Readproof HTTP API, plus conversions to/from the domain types in internal/*.
Package wire defines the JSON request/response shapes for the Readproof HTTP API, plus conversions to/from the domain types in internal/*.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL