Skip to main content
DeepSeek Harness is a TypeScript agent harness from DeepSeek AI built on the Cordis plugin system. Braintrust traces DeepSeek Harness sessions, turns, LLM steps, tool calls, and nested child sessions.

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 the dsh CLI.
1

Add the Braintrust plugin

Run the following command, replacing web with the Harness profile you want to instrument:
The command installs @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 braintrust entry to the profile’s cordis.patch.yml:
cordis.patch.yml
The configurable fields are:
  • apiKey - Braintrust API key. Falls back to BRAINTRUST_API_KEY when 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 to DeepSeek 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, and deepseek_harness.session_id, deepseek_harness.turn, and deepseek_harness.stop_reason in 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.

Resources