LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kveritas

Tamper-evident verification for computational experiments

TLDR

Start a session (redacted disclosure by default)
$ kveritas init
copy
Run an experiment under kveritas (any command after `--`)
$ kveritas run -- python [train.py] --epochs [90]
copy
Seal the session into a signed PDF
$ kveritas seal --output [report.pdf]
copy
Verify a report (local crypto plus the server audit)
$ kveritas verify [report.pdf]
copy
Verify offline (skip the server ledger)
$ kveritas verify --offline [report.pdf]
copy
Work without the attestation server (self-attested seal)
$ kveritas init --local
copy
Reveal file names in the report, or ship a checkout bundle of source
$ kveritas init --show-names
copy
$ kveritas init --disclosure open
copy
Prove a file was in a signed snapshot without revealing the rest
$ kveritas prove [report.pdf] [src/train.py]
copy
$ kveritas verify-proof [kveritas-proof.json]
copy
Reconstruct a snapshot from an open-disclosure bundle
$ kveritas checkout [report.pdf.kvbundle.zip] run_end [/tmp/out] --report [report.pdf]
copy
Record a hash-chained agent session (installs Claude Code hooks)
$ kveritas init --harness
copy
Check paper claims against a signed report
$ kveritas check --claims [claims.json] --report [report.pdf]
copy

SYNOPSIS

kveritas command [options]kveritas init [--local] [--harness] [--disclosure redacted|names|open] [--show-names]kveritas run [--files f1,f2] -- command [args...]kveritas seal [-o path] [--local-key pem]kveritas verify report.pdf|session.json|proof.json [--offline] [--bundle zip] [--paper pdf]

DESCRIPTION

kveritas binds a published result to the exact code, hardware, and time that produced it, and writes a cryptographically signed PDF anyone can verify. It wraps existing commands (any language). The binary is a single static Go program with no runtime dependencies.A typical experiment session is init, one or more runs, then seal. During a run, kveritas tees stdout, hashes I/O, samples hardware at about 10 Hz, and parses protocol lines. At seal time it signs canonical JSON of the session with RSA-PSS-SHA256 (4096-bit). The public key, hashes, nonce, and canonical bytes are embedded after the PDF `%%EOF` between `%%KVERITASSEALBEGIN%%` and `%%KVERITASSEALEND%%`.verify recomputes the data hash, checks the RSA-PSS signature, then distinguishes VERIFIED (signed by the K-Veritas trust anchor) from SELF-ATTESTED (valid signature on an author-supplied key). Unless --offline is set, it also asks the public verifier at kveritas.org for ledger status, HMCA coherence, optional bundle match, code audit, and paper cross-check.HMCA (execution coherence) never looks at the reported metric. It scores whether CPU, memory, I/O, and GPU channels co-fluctuate as one process. Verdicts are PASS, WARN, FAIL, or N/A. If a run declares a model card (`KVERITAS_MODEL`), seal also attests compute cost against time, energy, and memory bounds; a hard violation is FABRICATION-IMPOSSIBLE and is bound into the signature.Provenance is a Merkle-linked timeline of content-addressed snapshots. Disclosure only changes what the report shows. Patterns in .kveritasignore keep files out of any checkout bundle; withheld files remain hash-only leaves so they cannot be dropped silently.Harness mode (`init --harness`) records designated agent actions as a hash chain. Claude Code hooks are installed into `.claude/settings.json`. A failed pre hook exits 2 so a designated tool cannot run without its chain entry.

PARAMETERS

--local

Init without the attestation server. Seal with a local RSA key (self-attested, not server-origin).
--harness
Init a hash-chained agent session instead of an experiment session. Signs genesis with the server (or --local).
--disclosure redacted|names|open
How much provenance the report reveals. Default redacted (pseudonyms, no names, no content). Integrity is always committed.
--show-names
Keep real file names in the report without bundling content (same as --disclosure names).
--files list
Extra source files to hash before and after run. If omitted, script-like arguments (`.py`, `.sh`, `.r`, ...) are hashed automatically.
-o, --output path
Output PDF for seal (default `kveritas-report-<id>.pdf`) or proof JSON for prove.
--local-key pem
RSA private key for offline seal. Default `keys/private.pem` in local mode.
--offline
verify without contacting the ledger.
--bundle zip
Checkout/source bundle for verify. Hashes are compared to the seal; the server audit can run a code review.
--paper pdf
Manuscript PDF for verify. The server cross-checks claimed numbers against sealed telemetry.
--public-key pem
Trust-anchor public key for verify. Without it, origin is checked against the pinned K-Veritas key.
--claims file / --report file
Required pair for check. generate-claims needs --report only and prints JSON to stdout.
--report pdf
On checkout, verify the bundle hash against this sealed report before writing files.
--input / --output-content / --tool-use-id
harness-prove: reveal prompt or response bytes, and select the chain entry by index or tool-use id.

CONFIGURATION

.kveritas/

Session directory created by init. Holds the token, run records, proof keystore, and bundles. seal removes it; clean removes it without sealing.
.kveritasignore
Gitignore-style patterns. Matching files are withheld from checkout bundles but still committed as hashes.
.claude/settings.json
Harness mode appends PreToolUse, PostToolUse, and UserPromptSubmit hooks that call kveritas record --hook.

COMMANDS

init

Create a `.kveritas` session in the current directory.
run
Run a command as a monitored subprocess. Captures stdout/stderr hashes, protocol lines, hardware samples, and (on Linux) per-process activity.
seal
Sign the session into a PDF report. Open disclosure also writes `report.pdf.kvbundle.zip`. Deletes `.kveritas` on success.
verify
Check a sealed PDF, harness `session.json`, or embedded proof. Default also runs the server audit; --offline stays local.
prove / verify-proof
Build or check a selective-disclosure proof that named files were in a signed snapshot.
checkout
Reconstruct files for one snapshot from a checkout bundle. Pass --report to bind the zip to the signature.
check / generate-claims
Compare a claims JSON file to signed metrics, or print a template from a report.
record
Append a designated action to a harness session (also invoked by Claude Code hooks).
harness-prove / verify-harness-proof
Prove one recorded prompt or output against its committed hash.
status / update / clean
Show session state, replace the binary from the release channel, or remove `.kveritas`.

PROTOCOL LINES

Print these on stdout from any language. They are hashed into the signed record.KVERITAS_METRIC name=id value=float [step=label]

Record a metric. Keras history, sklearn CV, and metric-like locals are also auto-detected.
KVERITAS_PHASE name=phase
Mark a phase boundary (hardware snapshot).
KVERITAS_CLAIM metric=id value=float [phase=phase]
Commit a headline claim.
KVERITAS_INPUT src=seed:value
Commit a random seed.
KVERITAS_MODEL params=int arch=name precision=fp16|bf16|fp32
Model card (feeds compute-cost attestation).
KVERITAS_WORKLOAD datasetsize=int epochs=float batchsize=int [seqlen=int_]
Workload card.
KVERITAS_ARTIFACT role=model|dataset [name=ref] path=file visibility=public|private
Attest a model or dataset. Public artifacts store a content hash; private ones store a salted commitment.

CAVEATS

Only runs that exit 0 are saved. A failing command is discarded (the server ledger may still count the invocation). seal refuses if hashed source files changed after the runs.Per-process hardware attribution and the file/subprocess activity map are Linux-only. Elsewhere, sampling falls back to system-wide readings. Verify, seal, proofs, checkout, and disclosure levels are cross-platform.Default init talks to the K-Veritas attestation server. --local (or --local-key) produces a self-attested report: the signature is valid, but verify will not treat origin as server-signed.The proof keystore (`report.pdf.provkey.json`) stays next to the PDF and is needed for prove. Do not publish it if the report is redacted. Checkout bundles never include datasets or weights.The CLI, protocol, and verification libraries are Apache-2.0. The attestation server in the same repository is AGPL-3.0. "K-Veritas" is a trademark; the license does not grant rights to run a service that implies official certification.

HISTORY

K-Veritas is an open verification protocol from 27-GROUP, with the Go CLI and attestation server in kveritas-go. The client is a Cobra program that signs session JSON with RSA-PSS-SHA256 and embeds the seal in a self-contained PDF.

SEE ALSO

python(1), in-toto-run(1), cosign(1), sha256sum(1), openssl(1), git(1), claude(1)

RESOURCES

Copied to clipboard
Kai