By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: BraintrustPublished June 26, 2026

TL;DR: Logs capture discrete events while traces connect the full request path, which is essential when LLM and agent workflows branch across retrieval, model calls, and tools, according to Braintrust. The practical lesson is that request-level observability, not event-level noise, determines whether teams can debug, evaluate, and improve production AI behaviour.


At a glance

What this is: This is an explanation of why tracing and logging solve different observability problems in LLM and agent applications, with traces providing the request context logs cannot.

Why it matters: It matters because IAM, security, and platform teams need to understand how AI systems move through data, tools, and credentials when investigating failures, misuse, or governance gaps.

👉 Read Braintrust's explanation of tracing vs logging for LLM apps


Context

LLM applications often fail in ways that single event logs cannot explain, because one user request can pass through retrieval, model inference, tool use, and post-processing before producing an answer. In that environment, the security and governance problem is not whether logs exist, but whether teams can reconstruct the exact request path and tie it to the data, tools, and controls involved. That same challenge appears in agentic AI programmes, where a run may cross multiple services and decision points before a response is returned.

Tracing solves the missing context problem by grouping step-level activity into one request view, while structured logs preserve the operational detail inside each step. For identity and access practitioners, that distinction matters because AI systems often touch secrets, downstream systems, and sensitive data through delegated access. In this case, Braintrust is using observability to connect debugging with evaluation, which is a typical pattern for modern LLM stacks rather than an edge case.


Key questions

Q: How should teams instrument LLM apps so logs and traces work together?

A: Teams should keep structured logs for event detail, but every log record must be attached to the request trace through shared identifiers. That way, retrieval, model, tool, and post-processing steps remain readable in sequence, and investigators can move from a single failure to the full run without rebuilding context from a raw log stream.

Q: Why do traces matter more than logs for debugging AI agents?

A: Traces matter because AI agents do not always follow the same path twice. A trace preserves the parent-child relationship between steps, so teams can see which retrieval result, tool call, or model decision changed the final answer. Logs still help, but they cannot reliably show the complete execution path on their own.

Q: What do organisations get wrong about AI observability?

A: They often confuse technical telemetry with governance evidence. Dashboards can show latency, throughput, and error rates, but that does not prove the AI system stayed within approved data, policy, or accountability boundaries. Effective observability must capture the decision path, not just the system status.

Q: How do logs and traces support access review for AI workflows?

A: They create evidence about which request touched which data, tool, or downstream system. That is important when AI services operate with delegated access, because reviewers need the surrounding context, not just a timestamped event, to understand whether the action was expected and appropriately scoped.


Technical breakdown

Why logs fail to explain multi-step LLM behaviour

Logs are discrete events. They show that retrieval ran, a model call completed, or a tool returned a value, but they do not automatically preserve the causal chain that links those events to one request. In LLM and agent apps, that matters because the same prompt can produce different paths on different runs, and interleaved traffic makes event streams hard to reconstruct by hand. Without a shared request context, engineers can see symptoms but not sequence, which slows root-cause analysis and weakens auditability.

Practical implication: Use logs for step detail, but require a request identifier or trace context whenever AI systems call tools or access data.

How traces expose the full request path in LLM apps

A trace is a tree of spans that represents one request from entry to completion. Each span can hold inputs, outputs, timing, metadata, token counts, and cost, so the team can see how retrieval, model inference, tool execution, and post-processing interacted. That structure is especially useful for non-deterministic behaviour, where the code path alone cannot explain why a model chose a different tool or returned a different result. Tracing therefore turns observability into a narrative of execution rather than a flat event feed.

Practical implication: Instrument each retrieval, model, and tool step as a span so investigators can read one run end to end.

Why observability becomes governance data for AI systems

When traces and structured logs are linked, they stop being only debugging artefacts and become evidence for evaluation, compliance, and access oversight. That is important where AI systems act with delegated access or touch sensitive datasets, because the record must show not just that an action happened, but which request, step, and context produced it. This is where the identity angle becomes real: the trace is effectively the audit path for a machine workflow, and without it, access review becomes guesswork.

Practical implication: Treat traced AI activity as governance evidence and retain the step context needed for review, investigation, and quality scoring.


NHI Mgmt Group analysis

Tracing is becoming the audit layer for AI workflows. When LLM systems retrieve data, call tools, and hand off between services, a flat log stream is no longer enough to explain who or what caused an outcome. The missing piece is request context, and that is the same governance problem identity teams face when access is delegated across systems. Practitioners should treat traceability as a control requirement, not an engineering preference.

Logs and traces are complementary, but only traces preserve the execution path. Logs still matter for infrastructure faults, exceptions, and audit events, yet they do not reconstruct the chain of decisions inside an AI run. That makes traces the better foundation for investigating misrouted data, incorrect outputs, or tool misuse in agentic workflows. Teams that rely on logs alone will continue to struggle with root cause and accountability.

Request-level observability is now part of identity governance for AI systems. Once an AI workflow can touch data or invoke tools, the question becomes which request triggered which action and under what context. That is a machine-identity problem as much as an observability problem, because the system needs a durable, reviewable path from invocation to effect. The practical conclusion is that AI programmes need trace context wherever delegated access exists.

Named concept: observability-to-evaluation continuity. The strongest pattern in this article is the idea that the same trace used for debugging can also be scored for quality and regression analysis. That closes the loop between operations and governance, because teams are no longer collecting telemetry once and discarding it after incident response. Practitioners should build AI telemetry so evidence, review, and evaluation all reuse the same request record.

What this signals

Observability for LLM applications is no longer only an engineering concern. Once an AI workflow can touch data, call tools, or act on behalf of a user, the trace becomes part of the control environment because it preserves the context needed for accountability, investigation, and evaluation.

Trace context gap: the real risk is not the absence of logs, but the absence of a connected request path that shows how one AI run moved through retrieval, inference, and tool use. Teams that cannot reconstruct that path will struggle to explain outcomes, prove boundaries, or support review.

For identity and platform owners, the forward signal is clear: telemetry design should be treated as part of AI governance architecture. Where workflows have delegated access, traces need to be retained and queryable in the same way access records are, because the machine pathway is now part of the trust model.


For practitioners

  • Link logs to trace IDs by default Require every structured log emitted by an LLM or agent service to carry the same trace and span identifiers as the request it belongs to. That lets teams reconstruct one run across retrieval, model, and tool activity without manual correlation.
  • Instrument each AI step as a span Break the workflow into retrieval, model call, tool call, and post-processing spans so timing, inputs, outputs, and metadata are visible at the step level. This is the only reliable way to explain non-deterministic behaviour across repeated runs.
  • Retain request context for governance reviews Keep the trace record long enough to support incident investigation, access review, and quality scoring. When AI systems handle sensitive data or delegated access, the request path becomes evidence, not just telemetry.
  • Use the same telemetry for evaluation and debugging Score production traces for relevance, answer quality, or task completion so the team can turn recurring failures into regression cases. That reduces the gap between what engineering fixes and what governance can actually verify.

Key takeaways

  • Logs are useful, but they do not preserve the full causal path of a multi-step LLM run.
  • Traces provide the request-level context needed to debug, evaluate, and govern AI workflows that branch across retrieval, model calls, and tools.
  • Teams should design observability so the same telemetry supports incident response, access review, and continuous quality scoring.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK address the attack surface, NIST CSF 2.0, NIST SP 800-53 Rev 5 and NIST AI RMF set the technical controls, and ISO/IEC 27001:2022 define the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0DE.CM-7Tracing and log correlation support continuous monitoring of AI system behaviour and anomalies.
NIST SP 800-53 Rev 5AU-3AU-3 requires content of audit records that can support reconstruction of events and outcomes.
NIST AI RMFMEASUREAI observability feeds measurement of model and agent behaviour over time.
MITRE ATT&CKTA0007 , Discovery; TA0009 , CollectionTrace data can reveal discovery and collection patterns inside AI workflows that logs alone obscure.
ISO/IEC 27001:2022A.8.15Logging and monitoring controls are directly relevant to trace-linked observability and auditability.

Extend logging and monitoring controls so AI traces remain available for review and incident analysis.


Key terms

  • Unified Logging: Unified logging is the practice of collecting access and security events from multiple systems into one consistent audit trail. For AWS and NHI governance, it connects identity events to resource activity so teams can investigate misuse, prove compliance, and detect anomalous privilege changes more reliably.
  • Distributed Tracing: Distributed tracing is a method for following a request across multiple services so operators can see where latency or failure occurs. It is especially valuable in Kubernetes, but it also captures fine-grained runtime behaviour that should be restricted to those with a clear operational need.
  • Span: A span is one discrete operation inside a trace, such as a retrieval query, prompt assembly step, or model call. Spans make it possible to pinpoint which part of an AI workflow consumed time, introduced error, or passed bad context to the next stage.
  • Request Context: Request context is the per-request data carrier used in Go to pass deadlines, cancellation, and identity information through the application. For authentication, it usually holds the authenticated subject after middleware runs, and it must be keyed carefully to avoid collisions.

What's in the full article

Braintrust's full article covers the operational detail this post intentionally leaves for the source:

  • How the platform represents traces, spans, and structured log events in one workflow
  • The exact fields attached to retrieval, model, and tool spans for debugging and evaluation
  • How OpenTelemetry links log records to trace identifiers in practice
  • Examples of scoring traced production behaviour for retrieval quality, answer quality, and task completion

👉 The full Braintrust article shows how traces, structured logs, and evaluation connect in one workflow.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps practitioners connect access control, lifecycle oversight, and AI governance to the wider security programme.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org