For Full agent distillation in the platform dashboard, follow
Train your complete agent. It uses an isolated tool
environment, on-policy token scores and whole-task evaluation. This page describes
the older hosted gateway and golden-run workflow.
1. Get your gateway URL
We issue your tenant gateway URL when you onboard — reach out if you do not have one yet. It looks like:localhost.
2. Set the environment variable and run your agent
SetANTHROPIC_BASE_URL before starting your agent. Use your existing Anthropic API key as
you always have. ReasonBlocks passes it through to upstream and never stores it.
ANTHROPIC_BASE_URL. OpenAI and other providers use the same gateway with different base URL
env vars. See Endpoint compatibility. The gateway is
byte-transparent and fail-open: if capture ever breaks, your traffic still flows.
This step is half the integration. The other half is the two-line client shim in step 3, which
labels run boundaries. Both are required: without the shim the gateway still captures traffic,
but run boundaries are inferred rather than proven and far fewer runs qualify for training.
3. Add the client shim
Run boundaries are what make a trace minable, and the shim is what states them. Install it in your agent environment:rbtrace.client.install(), plus
with rbtrace.client.run(): per job when one process handles many. The gateway URL and capture
path are unchanged.
4. Training
Training is opt-in and tenant-scoped. Once there are enough golden runs for this workflow, ReasonBlocks mines policies from them and fine-tunes a cheaper task-specific model on your workflow, within a spend ceiling. When the job finishes, you get a report with the model identifier and whether it’s ready to go live.5. Go live with your trained model (same env var)
KeepANTHROPIC_BASE_URL pointed at the same gateway URL — nothing in your agent changes when
your trained model starts answering.
Per request, a classifier trained on your tenant’s own data decides whether your model’s
answer can be trusted or whether the gateway should send that request to your frontier model
instead. Escalated requests are captured as edge cases and feed the next training cycle, so
coverage grows from the runs you keep capturing.
The agent still speaks Anthropic Messages. ReasonBlocks serves the flat transcript contract
from the training report.
Next steps
Integrating your agent
The gateway env var plus the two-line shim.
Deployment
Hosted gateway, capture storage, and the distillation pipeline.

