Skip to main content
Route audit telemetry from Claude for Excel, PowerPoint, Word, and Outlook to your own OpenTelemetry (OTEL) collector. This gives you control over retention and encryption and lets you feed the data into a SIEM or observability platform. This capability is available to Claude Enterprise organizations and to direct-provider deployments on Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, or an LLM gateway.

What the collector receives

When a custom collector is configured, the add-in sends trace data for every user turn. Each turn produces a tree of spans covering the prompt, model calls, tool executions, and context compaction. Each uploaded file has a span of its own, outside that tree. For the setups described under Set up the collector, all span attributes are included. They carry user-generated content: prompt text, tool inputs and outputs, and document URLs. The allowlist filter that strips sensitive attributes on the Anthropic path does not run on this path. On spans, tool names are still normalized: MCP connector tool names are recorded as the literal mcp_tool rather than the connector-specific name, and any other name that is not one of the add-in’s own tools is recorded as unknown_tool. For these setups, assistant response text is not included. Your organization owns the collected data; treat the endpoint as containing prompt, document, mailbox, and calendar content when you scope access controls and retention. When the collector is instead delivered by an administrator-managed settings document, such as the one Claude for Government delivers, the add-in follows that document: it includes only the content categories the administrator selected, sends log records for prompts, model calls, and tool calls to {your_url}/v1/logs, and sends the spans only while the administrator has turned traces on. One of those categories is Claude’s responses: when selected, the reply is recorded as response on each model call’s span and sent as its own log record, office_agent.assistant_response. Each turn’s spans and log records also name the signed-in member as user.email and user.account_uuid, and with a Claude for Government sign-in the organization as organization.id, except a model call Claude makes while running a tool, which is reported with the model and token counts only. The add-in sends these log records to such a collector: Auxiliary model calls the add-in makes for itself, such as context compaction (the agent.compaction span), the short progress headline shown while Claude works, and connection checks, yield no log record. Every record except office_agent.assistant_response carries event.name, duration_ms, and the attributes of the span it reports, as listed in the span reference, minus tool output and the reply text. office_agent.assistant_response carries event.name, the reply as response and response_chars, model, request_id, and the same surface, session, member, and organization attributes as its model call. In Claude for Outlook, tool inputs and outputs can hold mail and calendar content, including the names, email addresses, and emails of people other than the user. Tool outputs can include:
  • Emails, attachments, and calendar entries that Claude reads with a tool, with the names and email addresses of senders, recipients, and attendees.
  • Other people’s free and busy times, when Claude looks for a meeting time. If a person’s calendar sharing lets the user see that person’s meeting titles, the collector can receive those titles as well.
Tool inputs can include:
  • The emails Claude drafts: the body, and any recipients and subject Claude sets.
  • The meeting invitations Claude drafts, with their title, attendees, time, location, and body.
  • Notes Claude saves to its scratchpad, which the add-in keeps on the user’s device for later conversations. These notes can name other people and give their email addresses.
A tool input is recorded when the tool starts, so it reaches the collector even if the user then declines a change the tool asks to make, or never sends the draft. Without Microsoft Graph consent, the add-in’s own tools read the email or event the user has open. With Microsoft Graph consent, they can read mail and calendar entries from anywhere in the user’s own mailbox and calendar, and look up other people’s free and busy times. A collector delivered by an administrator-managed settings document receives tool inputs only if the administrator selected the content category for tool inputs. It receives tool outputs only if the administrator selected the category for tool outputs and turned traces on. Metrics are not sent to custom collectors. The office_agent.* counter namespace routes to Anthropic only. Token usage is the only counter that also appears in the spans, as the office_agent.token.usage event described under Span events. Telemetry is sent over OTLP/HTTP to {your_url}/v1/traces, and the log records above to {your_url}/v1/logs. gRPC is not supported because of Office WebView constraints. Every custom collector, however it is configured, also receives the add-in’s own diagnostic log records at {your_url}/v1/logs. This includes a collector whose settings document turns traces off. Unlike the records in the table above, these carry no event.name. The add-in sends a record when it logs a warning or an error. The body of a record is a fixed message from the add-in’s code. It is not text from the conversation, the document, or an error message. For example, a failed tool call sends a record whose body is tool_execution_failed. The records are not a count of failures:
  • A tool call that fails in a way the add-in expects, such as a change the user declined or a tool a policy blocked, sends no tool_execution_failed record. Some policy refusals send a record of their own.
  • When a script that Claude wrote for execute_office_js throws an error or Office rejects one of its calls, the add-in sends a record for about one in a hundred of those failures.
  • A script that times out or that the add-in refuses to run sends a record each time.
A record can carry these attributes, in addition to the resource attributes. A collector delivered by an administrator-managed settings document that does not select tool inputs, the toolDetails category, receives these records in a reduced form. The add-in replaces the server and tool parts of each connector tool name with hashes, so one tool always has the same value, and adds a body.length attribute that holds the length of the message.

Endpoint requirements

The add-in exports telemetry from each user’s browser: the taskpane at https://pivot.claude.ai posts directly to your collector, so every export is a cross-origin request. The endpoint must:
  • Answer the OPTIONS preflight with Access-Control-Allow-Origin covering https://pivot.claude.ai and Access-Control-Allow-Headers covering Content-Type plus any headers you configure, such as Authorization.
  • Return the same Access-Control-Allow-Origin header on the POST response.
Managed OTLP ingest endpoints such as Grafana Cloud are built for server-to-server export and generally do not answer browser CORS preflights. Point the add-in at an OpenTelemetry Collector you run, configure the cors block on its OTLP HTTP receiver, and have that collector forward to your backend. The collector makes the authenticated call to your backend, so no credential needs to appear in export headers that reach every signed-in user’s browser.

Set up the collector

Configuration differs by how your users sign in.

Claude Enterprise organizations

An organization administrator sets the collector endpoint in the Claude admin console under Organization settings, Office agents. Two settings are available:

Direct-provider deployments

Deployments that authenticate against Bedrock, Vertex AI, Foundry, or a gateway supply these keys through the customer-configuration channels described in Use Claude for M365 with third-party platforms. The claude-for-msft-365-install setup plugin writes these for you. To set them by hand, use either channel below. A value in the bootstrap response overrides the manifest parameter. If entra_sso=1 is set and the add-in signs in through your own Entra app registration, you can also deliver these keys as ID token claims, as Per-user configuration describes. Manifest URL parameter. Append the keys to the taskpane URL in your custom manifest, with otlp_headers after # so the credential stays out of server request logs.
Bootstrap endpoint response. Include the keys in the JSON body your bootstrap endpoint returns.

Label spans with resource attributes

The otlp_resource_attributes configuration key adds attributes of your choice to the OpenTelemetry resource of every span and log record the add-in sends to your collector. Use it when your collector or tracing backend routes or filters on resource attributes, or to record which team or user a span belongs to. Set the key through a manifest, ID token claims, or a bootstrap endpoint, the channels that Per-user configuration describes. The add-in ignores the key when users sign in with a Claude account. It then takes its collector settings from the Claude admin console or, for members who sign in through the Enterprise Admin Console, from that console. Write the value as one string of comma-separated key=value pairs. A value cannot contain a comma, and the add-in ignores a pair with an empty key or value. In a bootstrap response or an ID token claim, the add-in uses each value as written and does not percent-decode it. If one of your keys is one the add-in already sets, such as service.name, your value replaces the add-in’s. The add-in adds your attributes only to the spans and log records it sends to your collector. It does not add them to the metrics it sends to Anthropic. Use the manifest for a value shared by everyone. In the manifest URL, percent-encode any space, &, #, +, or % in a value. The browser sends a value after ? to pivot.claude.ai each time the add-in loads, as Keep credentials out of the manifest URL query string explains. Put the key after # if a value names a person or team. The following taskpane URL adds the key to the URL already in a manifest and labels every user’s spans with an environment. It writes & as &, as the manifest XML requires.
Use a bootstrap endpoint or a claim for a value that differs per user. With entra_sso=1, the add-in sends the user’s Microsoft Entra token with each bootstrap request, so your endpoint can return a different value for each user or team. With your own Entra app registration, an ID token claim can also carry a per-user value. Unless members sign in through the Enterprise Admin Console, spans from a direct-provider deployment carry no Claude user identity. A per-user attribute is one way to attribute them to a user. The following bootstrap response labels one user’s spans with that user’s ID and team. The value must be a JSON string, not an object or an array.

Attribute size cap

Prompt, reply, tool-input, and tool-output attributes are truncated in the add-in at 4,000 characters each by default and marked with a trailing …[truncated]. Set the otlp_attr_max_chars configuration key to a positive integer to change the cap. Values are clamped to between 256 and 32,000. Before raising the cap, confirm your collector and tracing backend accept attribute values of the configured size: many backends truncate or drop over-limit attributes at ingest, and a dropped span is lost from the audit trail entirely.

Deployment modes

The audit trail differs slightly depending on the sign-in path. With either sign-in, each file a user attaches produces a file.upload span whenever your collector receives spans, and agent.query carries the MCP connection counts. The add-in takes the MCP connection counts and the three mcp.fetch_* attributes when it finishes loading the connectors of the user’s Claude account. The counts cover every MCP server that is connected or has failed at that moment, including servers from your deployment’s configuration. On a third-party platform connection, including one that your organization manages from the Enterprise Admin Console, the add-in does not load a Claude account’s connectors, so the counts read 0 even while MCP servers from your deployment’s configuration are connected. Claude Enterprise (OAuth): prompts, tool inputs and outputs, and document URLs, plus user identity (user.email, user.account_uuid, organization.id). Direct provider (Bedrock, Vertex AI, Foundry, gateway): core audit trail with prompts, tool inputs and outputs, and document URLs. No Claude user identity unless members sign in through the Enterprise Admin Console. Reconstruct a user session describes how to attribute activity to a user.

Span reference

Each user turn produces up to five span types. agent.query is the root, and agent.stream and agent.compaction are its children. agent.tool_execution is a child of agent.stream, or of agent.query when the tool starts after its model call has ended. file.upload arrives as a separate root span. The four agent.* spans each carry agent.surface, agent.vendor, and session.id, so each can be filtered on its own. With a Claude account or Claude for Government sign-in, they also carry user.email, user.bucket, user.account_uuid, and organization.id. file.upload carries session.id and, with one of those sign-ins, user.email; correlate it to a turn by session.id and timestamp, since it has its own trace ID. The attribute tables use three marks:
  • content: the attribute carries user-generated data.
  • Claude sign-in only: the attribute is sent only when users sign in with a Claude account or a Claude for Government sign-in. Members who sign in through the Enterprise Admin Console also get user.email, user.bucket, and user.account_uuid, and no other attribute with this mark. Claude for Government sign-ins never get org.rate_limit_tier.
  • managed settings document only: the attribute is sent only to a collector delivered by an administrator-managed settings document, and only when the administrator selected the attribute’s category, as described under What the collector receives.

Resource attributes

These are set on every span and log record. A deployment configured through a manifest, ID token claims, or a bootstrap endpoint can add its own with the otlp_resource_attributes key.

agent.query

Root span, one per user turn. SpanKind INTERNAL. mcp.fetch_status takes one of five values:
  • success: the add-in read the list.
  • error: a request for the list was refused or failed.
  • timeout: a response took more than 5 seconds.
  • no_auth: the add-in had no Claude sign-in token to send.
  • not_attempted: the load that mcp.configured_count describes had not finished by the end of the turn, or the add-in does not load the connectors of the user’s Claude account, as on a third-party platform connection, including one managed from the Enterprise Admin Console.

agent.stream

One span per model API call, child of agent.query. SpanKind CLIENT. The add-in requests prompt caching on every call. Cache token attributes are set from the provider’s response and omitted when the provider does not return them.

agent.tool_execution

At most one span per tool call. Its parent is the agent.stream span of the model call that requested the tool, or agent.query when the tool starts after that model call has ended. SpanKind INTERNAL. This is the primary record of what the model did to the document. The add-in sets tool.accept_decision when the tool starts. The value records whether the add-in required the user’s approval at that moment. It does not record whether an approval card was shown, before or during the run, or what the user answered.
  • manual: the add-in required the user’s approval before the tool ran. If the user declined, or pressed Stop before answering, the span carries tool.success false and tool.error_type user_rejected.
  • auto_accept: the add-in required no approval when the tool started. This is the value for most tools that only read, for most built-in edit tools while the permission mode is “Accept all edits” or “Skip all permissions”, and for a connector tool after the user chose to always allow that connector’s tools.
  • deferred: the add-in required no approval when the tool started, and the tool is one of six that the add-in does not hold for approval before they start: execute_office_js, which runs a script Claude wrote, store_blob, and Outlook’s present_draft_email, present_draft_event, set_appointment_recurrence, and update_writing_style.
Of the deferred tools, execute_office_js asks only if its script reaches a step that needs approval, for example a change to the document in “Ask before edits” mode or a mailbox search the user has not yet allowed, so it can finish without showing an approval card. set_appointment_recurrence and update_writing_style ask before they write. The other three never ask. When the user declines an approval card during the run, the call usually ends with tool.success false and tool.error_type user_rejected. The six tools are usually recorded as deferred in both “Ask before edits” and “Accept all edits” mode, whether or not they change anything. A script that only reads is deferred too. In “Skip all permissions” mode they are usually recorded as auto_accept. They can still ask there: execute_office_js before a mailbox search the user has not yet allowed or a step the add-in treats as a security risk, and set_appointment_recurrence and update_writing_style before they write. To see every script Claude ran, including the ones that changed the document, filter on tool_name execute_office_js. A filter or alert on auto_accept alone misses every script in the first two modes. auto_accept tools can ask during the run too. Examples are update_instructions, which changes the user’s saved instructions, and update_setting, which changes a setting such as web search. When the user declines one of those changes, the span still carries tool.success true, and tool.output holds the outcome.

agent.compaction

One span per automatic conversation summarization when context nears the window limit, child of agent.query. SpanKind CLIENT. Also carries office.platform and office.version beside the identity attributes the other agent.* spans carry.

file.upload

One span per uploaded file, emitted as its own root span rather than under agent.query. SpanKind CLIENT. Sent with either sign-in. Also carries session.id and, with a Claude account or Claude for Government sign-in, user.email. Correlate to the turn by session.id and timestamp.

Span events

Spans carry timestamped events for lifecycle transitions:
  • agent.query: exception, file_upload
  • agent.stream: first_token, stream_complete, stream_error
  • agent.tool_execution: tool_init, tool_run, tool_result, tool_error
  • agent.compaction: compaction_start, compaction_complete, compaction_error
  • file.upload: exception
Each file_upload event on agent.query describes one file attached to the turn and carries three attributes: Every collector that receives spans gets these three attributes, whichever content categories it receives. One counter also appears as a span event. office_agent.token.usage is emitted on each agent.stream span whose call completes, once for each token type with a nonzero count, with token_usage.type (input, output, cacheRead, or cacheCreation), token_usage.model, and token_usage.token_count. A collector that receives only some content categories gets this event without its attributes. The same counts are on the agent.stream span as input_tokens, output_tokens, cache_read_tokens, and cache_creation_tokens. The add-in’s other counters, such as the Excel cell-edit collision count and the Word document-edit counts, are not sent to custom collectors and do not appear on spans.

Reconstruct a user session

The span tree produces an ordered record of each turn’s prompt and of the tool calls that have agent.tool_execution spans, in both deployment modes. For the setups described under Set up the collector, it does not include the text of Claude’s replies. It also leaves out the clarifying questions that Claude asks the user with answer choices, and the user’s answers. For Claude Enterprise deployments, filter agent.query spans by user.email or user.account_uuid and session.id, order them by timestamp, and read user.message and document.url for each turn. Then follow each agent.query span’s trace ID to its agent.tool_execution descendants, ordered by timestamp, to see what was attempted (tool.input), the result (tool.output), and whether the add-in required the user’s approval before the tool started (tool.accept_decision). For direct-provider deployments, filter agent.query spans by session.id to isolate one session, and use document.url to identify the file. Per-turn reconstruction then follows the same trace-ID walk. Where users sign in with neither a Claude account nor a Claude for Government sign-in, the spans do not name the user. The add-in does not send session.id to your model provider, gateway, bootstrap endpoint, or identity provider, so their logs cannot be joined on it. The chat’s model requests carry a different identifier: the session_id key inside metadata.user_id holds an ID the add-in keeps for each saved chat, which does not match session.id. To attribute a session to a user, take request_id from one of its completed agent.stream spans and look for the same message id in the logs of the service the add-in calls: your gateway, or your cloud provider when the add-in connects to it directly. The response is streamed, and the id arrives near the start of the stream, in the message_start event. This works only if those logs record that id and identify each user, which a gateway token shared by all users does not do by itself.