Skip to Content
atrib protocol docs

attest and recall

The two verbs an agent uses to write its own signed records and read them back.

Middleware signs the tool calls that pass through it. Some of an agent's work never touches a tool: a decision, a note on an earlier result, a change of mind. attest is how the agent signs those, and recall is how it reads its signed history back.

Run them as MCP servers

mcp.json
{
  "mcpServers": {
    "atrib-attest": {
      "command": "npx",
      "args": ["-y", "-p", "@atrib/attest", "atrib-attest"],
      "env": { "ATRIB_PRIVATE_KEY": "<your key>" }
    },
    "atrib-recall": {
      "command": "npx",
      "args": ["-y", "@atrib/recall"]
    }
  }
}

attest writes each record to a local mirror under ~/.atrib/records/ and sends its commitment to the log. recall reads that mirror and checks each record's signature as it reads it.

attest

attest is one tool that writes three kinds of record. The ref argument decides which:

refRecord
absentobservation
{ kind: "annotates", target }annotation
{ kind: "revises", target, reason }revision

target is the sha256: hash of the earlier record. A revision must give a reason. Every call takes a content object, and may add informed_by with the hashes of records that led to it. Each kind expects its own content fields:

Recordcontent
observation{ what, why_noted?, topics? }
annotation{ importance, summary, topics? }, where importance is critical, high, medium, low or noise
revision{ prior_position, new_position }

Records are grouped by context_id. Pass one with the call, set ATRIB_CONTEXT_ID in the server's environment, or run the server under a harness it can read a session id from, such as Claude Code or Codex. With none of these, each call starts a context of its own. The environment variable and the harness session id apply to a server started over stdio; atribd over HTTP takes the context from each request.

The content stays in the local mirror. The signed record carries only args_hash, a SHA-256 commitment to it, so the public log never sees what the agent wrote. Anyone you later show the content to can check it against that hash.

If the log cannot be reached, attest still signs and returns the record hash, and sends the commitment later. A malformed call, such as a revision with no reason, signs nothing and returns the reason it refused.

recall

recall is one tool too. The shape argument picks the read:

shapeReturns
historyRecords filtered by context, signer, type or tool.
contentRecords ranked against a free-text query.
chainOne context's records in order.
walkThe records linked to one record, backward or forward.
annotationsThe notes left on one record.
revisionsThe revisions that replaced one record.
stateThe current head of each revision line.
orphansRecords nothing else cites.
by_signerA summary for each signing key.

Every returned record carries signature_verified. A passing signature proves the named key signed the record. It does not prove the record reached the log: for that, fetch its inclusion proof as described in Verify a record.

From code

@atrib/sdk gives application code the same two verbs:

import { createAtribClient } from '@atrib/sdk'

const client = createAtribClient()

const note = await client.attest({
  content: { what: 'chose sqlite over postgres', why_noted: 'deployment constraint' },
})

const history = await client.recall({ shape: 'history', limit: 10 })

The SDK's recall takes filters such as context_id at the top level of the query, where the MCP tool nests them under filters. Some shapes have other names in the SDK: by_content for content, session_chain for chain, trace and trace_forward for the two directions of walk, and verify for checking another agent's records before you cite them.

The SDK talks to a local atribd daemon when one is running. With no daemon, attest signs in process, and recall falls back to reading the mirror in process only for history and state, and only if @atrib/recall is installed beside the SDK. verify falls back the same way with @atrib/verify-mcp.

Older tool names such as emit, atrib-annotate and recall_walk still work and return the same results as the verbs; the write tools sign the same bytes. The full reference is in the @atrib/attest and @atrib/recall READMEs.