Skip to content
Docs
Request access

The ledger and anchors

Available

The hash chain and an anchor Three ledger entries in a row. Each entry's prev_hash is the hash of the entry before it. A signed anchor states the head of the stream and is exported to the ledger-anchors branch of a Git repository. Entryprev_hashhash Next entryprev_hashhash Newest entry (head)prev_hashhash head hash Anchorstream, sequence, head hash and time,signed with an Ed25519 key Git repositoryledger-anchorshistory kept elsewhere Entryprev_hashhash Next entryprev_hashhash Newest entry (head)prev_hashhash head hash Anchorstream, sequence, head hash and time,signed with an Ed25519 key Git repositoryledger-anchorshistory kept elsewhere
Each entry carries the hash of the one before it, so changing or removing an entry breaks every hash after it. An anchor is a signed statement of the head, kept outside the database.
Diagram as text
  1. Each entry has two hashes: prev_hash (the hash of the entry before it) and its own hash.
  2. Changing or removing any entry breaks every hash after it.
  3. An anchor is a signed statement of a stream's head: stream, sequence, head hash and time, signed with an Ed25519 key.
  4. Anchors are exported to a Git repository (the ledger-anchors branch), so a verifier can compare the database with history kept elsewhere.

Every action, model call, cost, policy decision, gate result, eval, approval and decision is an entry in an append-only ledger. Entries are never edited or deleted.

Each entry has a sequence number, an actor, a type (such as run.started, model.called, budget.reserved, gate.completed, approval.decided, run.ended), a payload, an optional cost and two hashes: prev_hash and its own hash (SHA-256 over a canonical form). Changing or removing any entry breaks every hash after it.

  • Hashes, not content. The ledger holds hashes and metadata (model, tokens, cost, verdict). The built-in paths never write prompts or outputs to it; free text in a custom worker’s payload is not scanned. Content, when it is kept, lives in the content store.
  • One transaction. A state change and its ledger entry are written together, so the ledger cannot miss a change or record one that did not happen.
  • People are opaque ids. A person appears as human:<id>; emails and dotted names are refused (other names are not blocked).
Terminal window
nuramesh ledger verify --team my-team

This re-checks every stream’s hash chain against the database’s own head. It finds accidental damage and edits inside the chain. It cannot, by itself, notice that the newest events or a whole stream were deleted. For that you keep a head hash somewhere else (--expected-head) or use anchors.

An anchor is a signed statement of a stream’s head: stream, sequence, head hash and time, signed with an Ed25519 key. Anchors are exported to a Git repository (the ledger-anchors branch), so a verifier can compare the database with history kept elsewhere.

  • The word “verified” in a run report ((verified)) and verify-ledger’s ok mean the hash chains check out. They say nothing about anchors.
  • In the API, ok means nothing wrong was found. verified is true only when the chain is intact and signed anchors check out. A stream with no anchors is ok but not verified.
  • Events newer than the last anchor are reported as unanchored, not hidden.
  • Anchors protect against editing the database. They do not protect against someone who controls both the host and the signing key. The security baseline lists this limit.

How to set it up: Anchor to Git.

Was this page helpful?