Install
Install the tenbri CLI, the tenbrid server, the Python and Node packages, the Rust crates, the WASM verifier and the framework adapters.
Pre-release
The latest release is 0.1.0-beta.5. Nothing is ready for production yet. Records written by
pre-releases are not covered by the format promise: the format stays provisional until its
external cryptography review ends. Every registry holds pre-releases on its pre-release channel,
so each command below names it: --version for cargo, --pre for pip, @next for npm.
Tenbri ships one version everywhere. Pick what you need:
| You want to | Install |
|---|---|
| Record and verify from a shell, a script or CI | the tenbri CLI |
| Let agents in any language write over HTTP or gRPC | tenbrid |
| Record from a Python agent | the tenbri Python package |
| Record from a Node or TypeScript agent | the tenbri npm package |
| Record from a Rust program | the Rust crates |
| Verify a stream in the browser | @tenbri/wasm |
| Record a Claude, OpenAI or LangGraph agent with one line | an adapter |
The Python and Node packages and the CLI write the same streams with the same Rust core: a stream
written from Python verifies with tenbri verify, and the other way round.
The CLI
The CLI is the tenbri binary: init, append, verify, query, show, tail,
checkpoint, receipt, keys, erase, index and schema check. On a terminal, query and
tail print one line per entry; piped, they print JSON. Every command that takes a stream reads
it from TENBRI_STREAM when you leave it out.
Needs Rust 1.85 or later. The crate is tenbri-cli; the binary it installs is tenbri.
Pre-releases only install when you name the version:
cargo install tenbri-cli --version 0.1.0-beta.5cargo binstall and Homebrew are not set up for pre-releases. The Homebrew formula
(tenbri/homebrew-tap) is published for stable releases only.
Check the install:
tenbri --versiontenbri 0.1.0-beta.5Cargo features
The CLI turns on two features by default:
| Feature | What it adds |
|---|---|
keychain | tenbri init --keychain: keep secret keys in the OS keychain instead of key files. macOS Keychain and Windows Credential Manager only; on other systems the keychain backend fails and you use key files. |
s3 | Streams in object stores: s3://bucket/<root>/<stream> (AWS S3, MinIO) and r2://bucket/<root>/<stream> (Cloudflare R2). |
To build without the keychain:
cargo install tenbri-cli --version 0.1.0-beta.5 --no-default-features --features s3Object stores take their credentials from the environment, as the providers' own tools read them:
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION and the other AWS_* variables;
AWS_ENDPOINT_URL for MinIO and other S3-compatible stores (with AWS_ALLOW_HTTP=true for plain
HTTP); CLOUDFLARE_ACCOUNT_ID (or AWS_ENDPOINT_URL) for R2. The Python and Node packages read the
same variables. See Streams on object storage.
In progress
AWS S3 support is tested on MinIO; a test on real S3 comes before 0.1.0-rc.1. Cloudflare R2 and
MinIO are done. Google Cloud Storage, Azure Blob and Postgres are not built yet.
The tenbrid server
tenbrid serves the REST and gRPC API, so agents in any language can write to a stream. The
release binaries and the container above include it. With cargo, it comes from the
tenbri-server crate:
cargo install tenbri-server --version 0.1.0-beta.5From a checkout, cargo build -p tenbri-server --release builds target/release/tenbrid.
It reads a TOML configuration file: --config <FILE>, else $TENBRI_CONFIG, else tenbrid.toml
in the working directory. The file must exist. A minimal one:
keys = "keys" # default: ~/.config/tenbri/keys
[streams.support] # the stream's name in URLs (its tnb1: id works too)
path = "audit/support" # or s3://bucket/prefix, r2://bucket/prefix
key = "sha256:..." # pin; default: the stream key held in `keys`
[[tokens]] # make one with `tenbrid token`
sha256 = "sha256:..." # SHA-256 of the bearer token; the token is never stored
principal = { kind = "agent", id = "support-assistant" }Relative paths are relative to the file's directory. These settings have defaults and an environment variable that overrides the file:
| Setting | Default | Environment |
|---|---|---|
listen (REST) | 127.0.0.1:7070 | TENBRI_LISTEN |
grpc_listen | 127.0.0.1:7071 | TENBRI_GRPC_LISTEN |
keys | ~/.config/tenbri/keys | TENBRI_KEYS |
schema (action schemas) | none: nothing is checked | TENBRI_SCHEMA |
queue (appends waiting per stream) | 10000 | TENBRI_QUEUE |
deadline_ms (how long an append waits for the queue) | 2000 | TENBRI_DEADLINE_MS |
Make a bearer token, then start the server:
tenbrid token
tenbrid --config tenbrid.tomltenbrid token prints the token once (it is not stored) and the [[tokens]] entry that
configures it by its hash. Open http://127.0.0.1:7070 to browse the stream in
Tenbri UI. tenbrid serves until SIGINT or SIGTERM, then stops accepting requests
and waits for the writes in flight. It exits 0 after a clean shutdown and 2 on a configuration or
startup error. Walk through it in tenbrid over REST; the routes are
in the API reference.
Python
The tenbri package is an abi3 wheel for Python 3.10 and later, on Linux (manylinux and
musllinux, x86_64 and aarch64), macOS and Windows. Nothing to compile.
pip install --pre tenbriCheck it:
python -c "import tenbri; print(tenbri.__version__)"0.1.0-beta.5tenbri.init() opens the process's default stream and @tenbri.decision records each call of a
function on it, sync or async. Tenbri (it releases the GIL) and AsyncTenbri open streams
yourself. Start with the quickstart or
Write from code.
Node and TypeScript
The tenbri package is a native addon (napi-rs) for Node 20 and later on Linux (glibc and musl),
macOS and Windows, with TypeScript types. npm installs the prebuilt binary for your platform; nothing
to compile.
npm install tenbri@nextKeep the @next tag until 0.1.0. The latest tag still points at a 0.0.0 placeholder, so a
plain npm install tenbri installs a package that does nothing.
Check it:
node -e "console.log(require('tenbri').version)"0.1.0-beta.5init() opens the process's default stream and decision({...}, fn) records each call of fn
on it. Tenbri.open opens streams yourself. Start with the
quickstart or Write from code.
Configure init()
init() in Python and in Node reads its settings from the environment; arguments win:
| Variable | What it sets | Default |
|---|---|---|
TENBRI_STREAM | The stream: a directory, file://..., s3://bucket/prefix or r2://bucket/prefix | none: required |
TENBRI_KEYS | The keys directory, apart from the stream | see Where keys live |
TENBRI_AGENT | Who acts when nothing narrower says: agent:support | none |
TENBRI_APPROVER | Who answers the agent frameworks' approval prompts: person:alice | none |
TENBRI_SCHEMA | The action schemas | ./tenbri.toml when there is one |
It creates the stream and its keys on first use, and flushes and closes the stream at exit.
Rust crates
tenbri-writer writes and verifies streams; tenbri-core holds the entry types, tenbri-keys the
keys and tenbri-store local and object storage:
cargo add tenbri-core@0.1.0-beta.5 tenbri-keys@0.1.0-beta.5 tenbri-store@0.1.0-beta.5 tenbri-writer@0.1.0-beta.5
cargo add tokio --features macros,rtAdd --features s3 to tenbri-store for s3:// and r2:// streams. The tenbri facade crate
is a placeholder that will re-export these; depend on the crates above for now. See
Write from code.
WASM verifier
@tenbri/wasm is the offline verifier compiled to WebAssembly, about 150 KB gzipped. It checks an
export of a stream against a pinned key, in the browser or in Node. It cannot write.
npm install @tenbri/wasm@nextAn export is the stream's batch files concatenated in order. In Node:
cat audit/support/batches/*.jsonl > support.jsonlimport { readFileSync } from 'node:fs'
import { createRequire } from 'node:module'
import { initSync, verifyExport } from '@tenbri/wasm'
const require = createRequire(import.meta.url)
initSync({ module: readFileSync(require.resolve('@tenbri/wasm/pkg/tenbri_wasm_bg.wasm')) })
console.log(verifyExport(readFileSync('support.jsonl', 'utf8'), process.argv[2]))node verify.mjs sha256:13410a435d5a70cc7f96ae05209410bb37cd301124e0719229b3184530789b61{
broken: null,
checkpoint: null,
entries: 4,
ok: true,
pinnedKey: 'sha256:13410a435d5a70cc7f96ae05209410bb37cd301124e0719229b3184530789b61',
stream: 'tnb1:13410a435d5a70cc7f96ae05209410bb'
}In the browser, await init() fetches tenbri_wasm_bg.wasm next to the module, then
verifyExport(jsonl, key) works the same way.
Framework adapters
An adapter records an agent framework's tool calls, approvals and handoffs as Tenbri decisions,
with one line after init(): tenbri.instrument_claude_agent_sdk(),
tenbri.instrument_openai_agents() or tenbri.instrument_langchain() in Python;
instrumentClaudeAgentSdk(options), instrumentOpenAIAgents() or instrumentLangChain() in
TypeScript. Each installs the matching tenbri package with it.
| Framework | Python | npm |
|---|---|---|
| Claude Agent SDK | pip install --pre tenbri-claude-agent-sdk | npm install @tenbri/claude-agent-sdk@next tenbri@next @anthropic-ai/claude-agent-sdk |
| OpenAI Agents SDK | pip install --pre tenbri-openai-agents | npm install @tenbri/openai-agents@next tenbri@next @openai/agents |
| LangGraph and LangChain | pip install --pre tenbri-langgraph | npm install tenbri@next @tenbri/langgraph@next |
With uv, poetry, pnpm, yarn or bun, use the same names with the pre-release flags shown above.
All adapters: Adapters.
Where keys live
Every writer (the CLI, tenbrid, the Python and Node packages) keeps signing keys in a keys
directory, chosen in this order:
--keys <DIR>(a global CLI flag), orkeys=/keys:when you callinit()or open a stream from code;$TENBRI_KEYS;$XDG_CONFIG_HOME/tenbri/keys, else~/.config/tenbri/keys(%APPDATA%\tenbri\keyson Windows).
Each stream gets its own subdirectory, named after the stream id with : written as -
(tnb1-5db31441baa2d080326d9f6c83c95319). Directories are created mode 0700 and key files
0600 on Unix. Without the stream's keys, a stream opens read-only: verify and query work, writes
fail.
tenbri init also appends the new stream's location and fingerprint to pins in the keys
directory, so tenbri verify <stream> on the same machine needs no --key. Streams created
another way, and every other machine, need --key
(CLI reference).
The keys directory and a local stream directory must not contain each other: tenbri init refuses
that layout. Whoever can read or copy the log must not be able to sign as it. See
Keys.
Next: the quickstart.