AI agent observability is the practice of recording enough structured evidence to explain what an agent tried, which tools it used, how state changed, where control moved, and why the workflow succeeded or failed. For multi-agent coding workflows, a useful trace connects the original request to every agent run, tool call, file change, test result, handoff, and human decision.
That is more than application logging. A log line can tell you that a command failed. An observable workflow helps you answer the harder questions: Which agent chose the command? What evidence did it have? Did another agent change the same file first? Was the failure recovered, hidden, or passed downstream?
What Should AI Agent Observability Capture?
Start with five layers. Together they reconstruct the execution without relying on an agent’s after-the-fact explanation.
| Layer | Capture | Question it answers |
|---|---|---|
| Request | User goal, constraints, approvals, run ID | What was the system asked to do? |
| Agent | Agent name, role, model, start and end time, parent run | Who made each decision? |
| Tool | Tool name, sanitized inputs, result status, latency, retries | What action actually ran? |
| State | Task transitions, file versions, workspace, ownership, artifacts | What changed between steps? |
| Outcome | Tests, review decisions, deployment result, cost and duration | Did the workflow produce acceptable evidence? |
The trace needs stable identifiers. Give the user request a workflow ID, every agent run a span ID, and every tool call or handoff its own child span. Carry those IDs through queues, subprocesses, and agent messages. Without correlation, a dashboard becomes a pile of unrelated events.
OpenTelemetry’s emerging generative-AI conventions use the same basic model: operations become spans with attributes describing the provider, model, request, response, and agent or tool involved. The exact schema may evolve, but a vendor-neutral trace model is safer than hard-coding your debugging workflow to one agent framework.
Trace the Workflow, Not Private Reasoning
Observability does not require recording hidden chain-of-thought. Record decisions and evidence that operators can act on:
- the task or subtask assigned to an agent;
- the tools that were available and the tool selected;
- sanitized tool arguments and returned status;
- files or records read and written;
- messages and handoffs between agents;
- policy checks, approvals, and denials;
- tests, build results, and review outcomes;
- token use, latency, retries, and errors.
This distinction improves both privacy and signal quality. Full prompts, source files, shell output, and tool responses may contain secrets, personal data, or proprietary code. Default to metadata and redacted previews. Store full payloads only when they are necessary, access-controlled, encrypted, and governed by a retention policy.
Framework defaults deserve scrutiny. The OpenAI Agents SDK, for example, can trace agent runs, generations, function calls, guardrails, and handoffs, and it exposes controls for whether sensitive inputs and outputs are included. Treat those controls as part of the production security design, not as a debugging toggle to revisit later.
A Practical Trace Model for Multi-Agent Coding
A coding-agent trace should mirror the task graph. Consider a request to add a feature, test it, and deploy it:
- The root workflow records the request, repository, starting revision, allowed actions, and approval boundaries.
- A planning span records the proposed tasks, dependencies, and resource ownership.
- Each worker span links to its task, workspace or branch, files touched, and tool events.
- Test spans record the command, environment, exit status, and artifact locations.
- Integration records which revision was reviewed and whether conflicts or stale inputs appeared.
- Deployment records the exact commit, target environment, result URL, and health check.
- Human-review events record what evidence the reviewer saw and the decision, not just “approved.”
For the architecture behind those relationships, see the guide to AI agent architecture patterns. If agents can modify the same resources, pair traces with the locks, versions, or isolation described in multi-agent concurrency control. Observability can expose a race; it cannot prevent one by itself.
The Metrics That Reveal Real Failures
Traditional service metrics still matter, but agent workflows need a few additional measures.
Reliability metrics
- Task success rate: completed runs that pass the acceptance criteria, not merely runs that stop.
- Tool error rate: invalid calls, permission failures, timeouts, and non-zero exits by tool and agent.
- Recovery rate: failures corrected within the same workflow without hiding the original event.
- Human rejection rate: outputs returned for revision or rejected at a review gate.
- Repeat failure rate: recurring failure categories after a purported fix.
Efficiency metrics
- End-to-end duration: wall-clock time from request to accepted outcome.
- Critical-path time: time spent on dependent work that controls completion.
- Peak concurrency: simultaneous agent or model work, which often drives throttling and cost.
- Tool and model latency: separated so model slowness is not confused with a slow build or API.
- Tokens and cost per accepted task: normalized by successful outcome, not raw run count.
The LLM traffic management guide explains why peak concurrency and burst shape can matter more than total calls. A full-mesh team may look economical in aggregate while producing expensive synchronized bursts.
Coordination metrics
- handoffs per task;
- messages per accepted task;
- duplicate work or overlapping file ownership;
- blocked time waiting for another agent or a human;
- stale-state detections and merge conflicts;
- task reassignments and abandoned subtasks.
These metrics are diagnostic, not targets by themselves. Fewer messages are not automatically better, and a low human-rejection rate can mean that reviewers are missing problems. Combine counts with traces and sampled reviews.
How to Debug a Failed AI Agent Run
When a workflow fails, debug the first unrecoverable step rather than the loudest final error.
- Freeze the evidence. Preserve the trace, commit or workspace revision, tool versions, environment metadata, and test artifacts.
- Check the requested outcome. Confirm that the workflow understood the goal, constraints, and definition of done.
- Find the earliest divergence. Walk the task graph in order and identify the first step whose output violated a tool schema, policy, factual constraint, or dependency.
- Classify the failure. Separate bad planning, invented information, invalid tool use, misread tool output, stale state, access denial, and infrastructure failure.
- Reproduce against the same state. A rerun against a newer branch may hide the original problem.
- Change one control. Fix the prompt, tool contract, ownership rule, guard, or retry policy that caused the failure.
- Turn the trace into a regression case. Replay the smallest useful scenario and verify the fix without weakening other controls.
Microsoft Research’s AgentRx work makes the same root-cause point: long, probabilistic, tool-mediated runs often contain many errors, so diagnosis should locate the first critical failure and support it with auditable evidence. That is a better operating model than asking another model to summarize why the last step failed.
Alerts Worth Waking Someone Up For
Alert on conditions that need action, not every unusual model output. Useful alerts include:
- a destructive or external tool call without the required approval;
- repeated retries with the same arguments;
- a task running beyond its time, token, or cost budget;
- two agents writing the same resource without isolation;
- a test or deployment result that contradicts the reported task state;
- a handoff that loses its parent task or required artifact;
- sensitive data detected in a trace export;
- a sharp rise in one failure category after a model, prompt, or tool change.
Route warnings into the workflow when possible. An agent can pause for clarification or a human can reject a proposed action before it becomes an incident. Reserve paging for high-impact actions, systemic failures, or broken safety boundaries.
An AI Agent Observability Checklist
Before trusting a multi-agent coding workflow, verify that you can answer:
- Can one ID connect the user request, agents, tools, artifacts, and final outcome?
- Does each event have a timestamp, actor, parent, status, and duration?
- Can you reconstruct file and task state at the moment a decision was made?
- Are handoffs, retries, errors, denials, and human approvals explicit events?
- Do tests and review decisions attach to the exact revision they evaluated?
- Are sensitive prompts, code, credentials, and tool outputs redacted by default?
- Can you filter by model, agent, workflow version, tool, and failure category?
- Can a failed trace become a reproducible regression test?
- Are retention, access, export, and deletion policies documented?
- Can operators distinguish a completed run from an accepted outcome?
If the answer to any of these is no, add the missing evidence before adding more agents. More autonomy without better observability increases the number of places a failure can hide.
How Dorchestrator Makes Agent Work Visible
Dorchestrator is a local-first workspace for supervising coding agents. It keeps task state, agent communication, terminal work, tool activity, and review close to the project so a developer can see how work moved from request to result.
That visibility supports the practical observability model in this guide: bounded tasks, inspectable agent activity, isolated workspaces, explicit human review, and evidence attached to the code being changed. Explore the coding-agent orchestration workspace to see how Kanban, Swarm, Mux, skills, and tool timelines fit together.
Frequently Asked Questions
What is the difference between AI agent monitoring and observability?
Monitoring tracks known signals such as error rate, latency, token use, or failed tool calls. Observability preserves enough correlated evidence to investigate failures you did not predict. A production system needs both: monitoring tells you that something is wrong; observability helps explain where and why.
Do AI agents need distributed tracing?
They do when a task crosses agents, models, processes, tools, or queues. Distributed tracing connects those steps into one causal path. A single-agent local script may need only a structured event timeline, but the same stable parent-child identifiers make later expansion easier.
Should agent traces store prompts and responses?
Not by default. Capture metadata and redacted previews first. Store full content only for a defined debugging or evaluation need, with access controls, retention limits, and explicit handling for secrets and personal data.
How do you debug non-deterministic agent failures?
Preserve the original state and complete execution trace, then locate the earliest evidence-backed divergence. Reproduce with the same code, tool versions, inputs, and policy configuration where possible. Convert the failure into a regression case that checks outcomes and constraints rather than requiring identical model text.
Sources and Further Reading
- Google Cloud, Agent observability.
- OpenTelemetry, Semantic conventions for generative AI systems.
- OpenAI Agents SDK, Tracing.
- Microsoft Research, Systematic debugging for AI agents: Introducing the AgentRx framework.