Hosted (default)
ReasonBlocks operates the capture gateway, durable storage, trace reconstruction, distillation pipeline, and relegation serving for your tenant. What ReasonBlocks runs- Hosted gateway at a tenant-specific URL (copy from app.reasonblocks.com Quickstart)
- Capture storage and trace reconstruction
- Distillation jobs, training reports, and relegation routing (cheaper model + frontier fallback)
- Dashboard views for capture volume, golden-run counts, reports, and serving status
Your agent process only needs the gateway URL via
ANTHROPIC_BASE_URL, your existing API key,
and optionally the client shim. No DuckDB files, no local rbtrace proxy, and no SSH access
required for the default path.
Anthropic Messages is the primary path for training and relegation serving. OpenAI Chat
Completions, Responses API, Gemini, and other routes are supported for capture via the same
gateway URL with the correct client env var. See Endpoint compatibility.
See the Quickstart for the end-to-end hosted flow.
Security and privacy (hosted)
- Anthropic API keys pass through the gateway to upstream and are not stored by ReasonBlocks.
- Capture data and distillation artifacts stay in your tenant scope on ReasonBlocks infrastructure.
- The optional agent shim (~150 lines) only stamps HTTP headers on LLM API paths; it does not replace the hosted gateway.
Integration paths
Where the gateway runs is separate from how you label runs in your agent process. See Integrating your agent for Path A (gateway only), Path B (install()),
and Path C (install() + with rbtrace.client.run() per job).
Advanced: self-hosting the gateway
Use this when you must run the capture gateway and storage on your infrastructure. ReasonBlocks can still run distillation in the hosted product if you export traces; or you can run the full pipeline locally with therbtrace CLI.
Architecture (self-hosted)
Three roles, usually split across processes on your ops hosts:- Gateway: HTTP forwarder and capture writer (
python -m rbtrace.proxy) - Storage: append-only DuckDB file on a durable volume
- Analysis: read-only CLI (
python -m rbtrace inspect|trace|distill|loop) on a schedule or on demand
Install
git clone + pip install -e . as the default customer path. Reserve editable
installs for ReasonBlocks engineers and contributors.
Docker
Use a released container image or your own build fromtrace-reconstructor. Example shape:
- Listens on 8787
- Persists to a named volume at
/data/capture.duckdb - Health:
GET http://<host>:8787/__rbtrace/stats
host.docker.internal on Mac/Windows or the service name on the
same compose network.
Extract outputs from the volume
tools if your compose file defines distill/loop services for scheduled jobs.
Bare metal
restart=always. Mount
/var/lib/rbtrace on persistent disk.
Flush before backup
The writer batches inserts. Before snapshotting the DuckDB file:Long-term capture (self-hosted)
- Single DuckDB file grows with traffic. Plan disk by exchange count (roughly tens of KB per exchange compressed, varies with prompt size).
- No automatic retention is built in. Rotate by stopping the gateway, archiving
capture.duckdb, and starting with a new--dbpath. AGENTRECON_NOTE(or--noteon the CLI) tags each capture run for slicing later.
Local distillation outputs
provenance.supports_universal_claims: true (shown as golden
in CLI summaries).
Self-hosted relegation serving after training:
Monitoring (self-hosted)
writer.queue_depth, writer.dropped, and exchange counts. Non-zero dropped means
the writer fell behind. Increase resources or raise AGENTRECON_MAX_QUEUE.
Security and privacy (self-hosted)
- You operate the gateway, storage, and analysis CLI on your infrastructure.
- API keys flow through the gateway to upstream. They are redacted in stored message text when
RBTRACE_REDACT=1(default). - Keep
*.duckdbcapture files anddistill-*/artifacts on ops hosts, not in agent images.
What not to deploy to agent containers
Agent surface (hosted or self-hosted): gateway URL + optional shim + your existing agent code.

