> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Claude Managed Agents runs

> Send Claude Managed Agents spans to a Collector you run with a Console telemetry destination, then import them offline as self-reported agent runs.

Claude Managed Agents runs the agent loop for you. Its telemetry arrives as
OpenTelemetry spans that a Claude Console **telemetry destination** sends to
an OTLP endpoint you choose. EvalGate imports those spans offline into the
same `evalgate.agent-run.v2` runs as Claude Code, so a view or report can
compare the two.

> [!WARNING]
>
> This profile is **Experimental**. It is written from Anthropic's beta span
> reference and tested against a synthetic capture, not a real one. Span names
> and attributes can change during the beta. It ships in the TypeScript 4.0.0
> source candidate of `@evalgate/sdk`, which is not published yet. EvalGate has
> no hosted intake for these spans yet: you run the Collector and the import.

## 1. Run a Collector that writes spans to a file

The destination needs an OTLP/HTTP endpoint that Anthropic can reach over
HTTPS. Put an OpenTelemetry Collector with the `file` exporter behind it:

```yaml theme={null}
receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318
exporters:
  file:
    path: ./claude-managed-agents.jsonl
service:
  pipelines:
    traces: { receivers: [otlp], exporters: [file] }
```

Protect the endpoint with a header you choose, and terminate TLS in front of
it. EvalGate never sees this endpoint or its header.

## 2. Add a telemetry destination in the Claude Console

Follow Anthropic's
[OpenTelemetry setup](https://platform.claude.com/docs/en/manage-claude/opentelemetry/api)
and set:

* **Base URL:** your Collector's HTTPS address. The Console adds `/v1/traces`.
* **Content mode:** keep **Metadata only**, the default. Full content sends
  messages, system instructions, tool arguments and tool results. EvalGate
  drops them at import either way, but they still reach your Collector.
* **Workspaces:** choose **Selected** and pick only the workspaces that run
  managed agents. A destination receives every span from the workspaces it
  covers, including plain Messages API requests.

If you run agents in your own sandbox (self-hosted environments), Anthropic
states that self-hosted mode is not eligible for zero data retention or
HIPAA. That is a property of the sandbox choice, not of this import.

## 3. Import the spans

```bash theme={null}
npx @evalgate/sdk harness import --from ./claude-managed-agents.jsonl \
  --agent claude-managed-agents \
  --runtime-host anthropic --runtime-hosting vendor_hosted \
  --tier light --task deposit-trace --apply
```

One run is written per Managed Agents session (`anthropic.session.id`).
Delivery is at least once, so a span delivered twice is counted once. Use
`--runtime-hosting self_hosted` and `--sandbox-provider <id>` when the session
ran in your own sandbox; EvalGate never infers either from the spans.

## What the run contains

| Measure | Where it comes from |
| - | - |
| Input, output, cache read and cache write tokens | `anthropic.model_request` usage. The reported input includes cached tokens, so EvalGate subtracts them to get uncached input. |
| Estimated cost | Priced from EvalGate's offline Anthropic price snapshot using the turn's model. The spans carry no cost. |
| API requests and errors | One per `anthropic.model_request`; an error status or `error.type` counts as an API error. |
| Tool calls and failures | `anthropic.tool_use` and `anthropic.mcp_tool_use` spans and their status. MCP tool names are recorded as `mcp`. |
| Time | Span start and end times; wall-clock time runs to the end of the last turn. |

These stay `n/a` with reason `not_exported`, never `0`: file reads and edits,
subagent tokens and depth, time waiting on a person, prompts and permission
prompts, refusals, compactions and the 5-minute and 1-hour cache-write split.
Outcome-evaluation (grader) tokens are not counted yet, and the grader's
verdict does not set the run's outcome.

Spans without a session, such as `anthropic.messages.create` from the
Messages API, are counted as ignored and never become runs. The organization
id is kept only as a salted digest. `user.id`, the workspace id, agent names
and descriptions, MCP server names and URLs are dropped.

Every number is self-reported by Anthropic's telemetry and is not verified
against billing data. To compare runs, continue with
[cost of quality for coding agents](/docs/guides/cost-of-quality-for-coding-agents.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.