preste docs

Telemetry & Attestation

Every preste session emits OpenTelemetry traces and produces an Ed25519 attestation certificate. Verification is fully offline ; no Vauban infrastructure required. Optional Starknet anchoring and Brain cross-session memory extend the trust chain on-chain and across sessions.

OpenTelemetry: gen_ai.* attributes

preste instruments all LLM calls with the OpenTelemetry Semantic Conventions for Gen AI Systems (gen_ai.* namespace).

Emitted attributes (per span)

Attribute Example value Description
gen_ai.system "litellm" Provider identifier: litellm | groq | openai.
gen_ai.request.model "qwen3-8b" Requested model name.
gen_ai.response.model "qwen3-8b@v1" Model name as returned by the provider (may include version suffix).
gen_ai.usage.input_tokens 312 Prompt tokens consumed by this LLM call.
gen_ai.usage.output_tokens 47 Completion tokens returned by this LLM call.
gen_ai.operation.name "chat" Operation type: chat | completion.
preste.strategy "ooda" Active agent strategy for this run.
preste.run_id "run_abc123" Unique run ID (matches attestation certificate).
preste.step 3 OODA step index within the current run.

Connecting to an OTel collector

Set standard OTLP environment variables before launching preste:

# OTLP gRPC (default)
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_SERVICE_NAME=preste

# OTLP HTTP
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf

export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=none

preste --strategy ooda

Grafana/Tempo. preste traces are compatible with Grafana Tempo, Jaeger, and any OpenTelemetry-compliant backend. Each run maps to a root span with step-level child spans.

Ed25519 auto-attestation

Every preste run that completes with attestation enabled (default) writes a signed Run Certificate to ~/.preste/attestations/<runId>.json. The key pair is generated once at first run and stored in ~/.preste/keys/.

Certificate format

{
  "version":    1,
  "run_id":     "run_f3a9c1...",       // unique run identifier
  "timestamp":  "2026-05-21T14:32:11Z", // ISO-8601 UTC
  "model":      "qwen3-8b",            // model used
  "strategy":   "ooda",                // agent strategy
  "input_hash": "sha256:c4f2...",       // SHA-256 of concatenated user inputs
  "output_hash":"sha256:9b1e...",       // SHA-256 of final answer
  "public_key": "MCo...",              // Ed25519 SPKI DER, base64url
  "kid":        "key-20260521",        // key identifier
  "signature":  "mFW9..."              // Ed25519 over JCS(cert minus signature)
}

The signature covers the JSON Canonicalization Scheme (JCS, RFC 8785) serialization of all fields except signature itself. A Poseidon hash of the certificate is used for on-chain anchoring.

Verification (offline)

preste attest verify run_f3a9c1.json

Output on success:

  run_id     run_f3a9c1...
  timestamp  2026-05-21T14:32:11Z
  model      qwen3-8b
  strategy   ooda
  signature  OK valid (Ed25519)

No network connection required. The certificate is self-contained ; the public key is embedded in the public_key field.

Key management

preste manages signing keys automatically. Each key has an identifier (kid) that links certificates to their verification key. Keys are stored in ~/.preste/keys/.

# Show current key
preste attest key show

# Rotate key (new certs will use the new key; old certs remain verifiable)
preste attest key rotate

Audit-ready by default. Disabling attestation requires an explicit --no-attest flag. Institutional deployments should keep the default.

Starknet anchor

The optional anchoring step commits a Poseidon felt252 hash of the Run Certificate to the Vauban attestation smart contract on Starknet. This creates an immutable on-chain record that cannot be forged retroactively.

Dry-run (default)

# Compute Poseidon hash, no transaction
preste attest anchor run_f3a9c1.json

Output:
  poseidon_felt  0x049f3...
  network        dry-run (no transaction)

Submit to Starknet Sepolia

export STARKNET_PRIVATE_KEY=0x...
export STARKNET_ACCOUNT=0x...

preste attest anchor run_f3a9c1.json --network sepolia

Submit to Starknet mainnet

preste attest anchor run_f3a9c1.json \
  --network mainnet \
  --confirm   # required for mainnet

Verify with on-chain state

# Add --check-anchor to also fetch L3 anchor state from CC server
preste attest verify run_f3a9c1.json --check-anchor

Additional output:
  anchor     verified_on_chain
  katana_tx  0x1a2b3c...
  block      874201

Anchor states

pending Transaction submitted, not yet confirmed.
anchored Transaction confirmed on-chain (block included).
verified_on_chain Contract read confirms certificate hash is present in Merkle tree.

Brain stage-3 memory

When brain.api_key is set in ~/.preste/config.yaml, preste archives compaction summaries to Brain after each context compaction. On next launch, these summaries are restored as a system prompt prefix, giving the agent persistent cross-session memory.

Setup

# ~/.preste/config.yaml
brain:
  api_key: bk-your-key-here
  url: https://brain.api.vauban.tech/mcp

How it works

  1. When maybeCompact() triggers (fill ratio > 70%), older turns are summarized by the LLM.
  2. The summary is archived to Brain via createBrainCompactionLlmFn() (fail-soft: Brain unavailability never blocks the session).
  3. On next session start, restoreSessionContext() queries Brain for summaries tagged with the session tag and injects them as a system prefix.
# Enable/disable Brain mid-session
/settings brain on
/settings brain off

Privacy note. Compaction summaries contain condensed conversation history. They are archived to your own Brain instance, which you control. The preste CLI never transmits conversation content to any third party.

Certificate export

Export a Run Certificate in JSON or PDF format (PDF requires CC server access):

# JSON (offline, from local store)
preste attest export run_f3a9c1

# PDF (requires CC_SERVICE_TOKEN)
preste attest export run_f3a9c1 --format pdf > cert.pdf