Table of Contents
Fetching ...

AgentTrace: A Structured Logging Framework for Agent System Observability

Adam AlSayyad, Kelvin Yuxiang Huang, Richik Pal

TL;DR

AgentTrace addresses the security and governance challenges of LLM-powered agents by introducing a schema-based, multi-surface observability framework. It instruments agents at runtime with minimal overhead, capturing cognitive, operational, and contextual traces and exporting them to OpenTelemetry alongside JSONL logs. The core idea is the formal representation $L(S:E:C)\to R$, enforcing properties of consistency, causality, fidelity, and interoperability to enable end-to-end traceability. This framework lays the groundwork for improved risk analysis, accountability, and real-time monitoring in high-stakes deployments, with potential extensions to threat modeling and agent evaluation.

Abstract

Despite the growing capabilities of autonomous agents powered by large language models (LLMs), their adoption in high-stakes domains remains limited. A key barrier is security: the inherently nondeterministic behavior of LLM agents defies static auditing approaches that have historically underpinned software assurance. Existing security methods, such as proxy-level input filtering and model glassboxing, fail to provide sufficient transparency or traceability into agent reasoning, state changes, or environmental interactions. In this work, we introduce AgentTrace, a dynamic observability and telemetry framework designed to fill this gap. AgentTrace instruments agents at runtime with minimal overhead, capturing a rich stream of structured logs across three surfaces: operational, cognitive, and contextual. Unlike traditional logging systems, AgentTrace emphasizes continuous, introspectable trace capture, designed not just for debugging or benchmarking, but as a foundational layer for agent security, accountability, and real-time monitoring. Our research highlights how AgentTrace can enable more reliable agent deployment, fine-grained risk analysis, and informed trust calibration, thereby addressing critical concerns that have so far limited the use of LLM agents in sensitive environments.

AgentTrace: A Structured Logging Framework for Agent System Observability

TL;DR

AgentTrace addresses the security and governance challenges of LLM-powered agents by introducing a schema-based, multi-surface observability framework. It instruments agents at runtime with minimal overhead, capturing cognitive, operational, and contextual traces and exporting them to OpenTelemetry alongside JSONL logs. The core idea is the formal representation , enforcing properties of consistency, causality, fidelity, and interoperability to enable end-to-end traceability. This framework lays the groundwork for improved risk analysis, accountability, and real-time monitoring in high-stakes deployments, with potential extensions to threat modeling and agent evaluation.

Abstract

Despite the growing capabilities of autonomous agents powered by large language models (LLMs), their adoption in high-stakes domains remains limited. A key barrier is security: the inherently nondeterministic behavior of LLM agents defies static auditing approaches that have historically underpinned software assurance. Existing security methods, such as proxy-level input filtering and model glassboxing, fail to provide sufficient transparency or traceability into agent reasoning, state changes, or environmental interactions. In this work, we introduce AgentTrace, a dynamic observability and telemetry framework designed to fill this gap. AgentTrace instruments agents at runtime with minimal overhead, capturing a rich stream of structured logs across three surfaces: operational, cognitive, and contextual. Unlike traditional logging systems, AgentTrace emphasizes continuous, introspectable trace capture, designed not just for debugging or benchmarking, but as a foundational layer for agent security, accountability, and real-time monitoring. Our research highlights how AgentTrace can enable more reliable agent deployment, fine-grained risk analysis, and informed trust calibration, thereby addressing critical concerns that have so far limited the use of LLM agents in sensitive environments.
Paper Structure (22 sections, 1 equation, 1 figure, 1 algorithm)

This paper contains 22 sections, 1 equation, 1 figure, 1 algorithm.

Figures (1)

  • Figure 1: AgentTrace system flow. End-to-end runtime architecture showing initialization (logger setup, OpenTelemetry enablement, and auto-instrumentation hooks), runtime instrumentation with trace/span ID generation and cognitive extraction, logging pipeline for event encoding and routing, and downstream storage and visualization. Contextual spans are enriched with OpenTelemetry attributes via auto-instrumentation.