Part 6: Observability for AI Agents: Tracing, Metrics, and Drift Developer Akash Pal's open-source 'agent-from-scratch' project demonstrates a framework-free approach to observability for AI agents, emphasizing structured tracing with hashed arguments and truncated summaries to ensure safe, readable logs. The trace log doubles as CLI output, and the design anticipates future online metrics and drift detection without requiring changes to the tracing code. Part 6 of a series building a support-ticket agent with no framework. Previous: Part 5 guardrails . Repo: github.com/akash-pal/agent-from-scratch "Run the eval set" and "is this agent healthy right now" are different questions, and it's easy to only build infrastructure for the first one. Eval sets run offline, on cases you already thought of. Production traffic doesn't ask permission to send you a ticket type you didn't anticipate. Observability is what tells you when that's happening — and it's also, unglamorously, what makes offline evaluation possible in the first place: you can't debug a failing eval case without knowing what the agent actually did, step by step. Every tool call in this build logs a structured record — src/trace.ts https://github.com/akash-pal/agent-from-scratch/blob/main/src/trace.ts : export interface TraceStep { trace id: string; step id: number; tool name: string; args hash: string; // hashed, never raw args duration ms: number; result summary: string; model: string; token usage: { input: number; output: number }; } Two details here that look small and aren't: args hash, not raw args. This trace log is meant to be safe to keep around, ship to a monitoring system, or paste into a bug report — none of which should require thinking about what secrets might be embedded in a tool call's arguments. Hashing means you can still confirm two calls used identical arguments for debugging idempotency, for instance without ever persisting the actual values: export function hashArgs args: Record