Setup
Set your Braintrust API key as an environment variable. The plugin reads it automatically when no key is configured explicitly in the Cordis patch..env
Manual instrumentation
To trace DeepSeek Harness sessions, add the Braintrust plugin to your Harness profile using thedsh CLI.1
Add the Braintrust plugin
Run the following command, replacing The command installs
web with the Harness profile you want to instrument:@braintrust/deepseek-harness and applies its bundled Cordis patch to the selected profile. Traces appear in the project named DeepSeek Harness in your Braintrust organization.2
Configure the plugin (optional)
To override the defaults, add a The configurable fields are:
braintrust entry to the profile’s cordis.patch.yml:cordis.patch.yml
apiKey- Braintrust API key. Falls back toBRAINTRUST_API_KEYwhen omitted. Set it under Settings > Plugins in Harness. It is declared as a secret field so the settings UI handles it as a credential.projectName- Braintrust project receiving Harness traces. Defaults toDeepSeek Harness.metadata- Key-value pairs added to every top-level turn trace.orgName- Braintrust organization name.appUrl- Braintrust deployment URL for self-hosted deployments.
What Braintrust traces
Braintrust captures:- Turn spans (
deepseek_harness.turn), as individual traces, with user messages as input, the final assistant text as output, aggregated token metrics, anddeepseek_harness.session_id,deepseek_harness.turn, anddeepseek_harness.stop_reasonin metadata. - LLM step spans (
deepseek_harness.step), as LLM spans nested under their turn, with the full conversation history (including the system prompt) as input, the model response as an OpenAI-compatible choices array as output, and model, provider, and request parameters in metadata. - Tool call spans (named after the tool), as tool spans nested under their turn, with tool arguments as input and the tool result as output.
- Child session spans nested under the tool span that triggered them, preserving the full call hierarchy across spawned sub-sessions.
- Token usage metrics (prompt, completion, and total tokens, plus cache read, cache creation, and reasoning tokens when the model provides them) on LLM step spans, with aggregated totals rolled up to the parent turn span.
- Time-to-first-token on LLM step spans.
- Image attachments from the Harness attachment store, normalized and attached inline.
- Errors captured on every span.