A regular application fails in ways you can trace: an exception, a timeout, a bad query. An LLM application can fail while returning a perfectly normal 200 response. The answer is wrong, the agent called the wrong tool, or it read something it should not have, and nothing in your usual dashboards turns red.
That is what LLM observability is for. This guide explains what it is, what to record in LLM apps and AI agents, how it differs from monitoring, and why it is also one of your best security controls. It is written from the point of view of a team that builds and runs AI agents in production.
Last reviewed: November 2026.
What is LLM observability?
LLM observability is the ability to see what an LLM application or AI agent did, step by step, and why. For each request, that means being able to answer:
- What did the user ask, and what prompt did the system actually send to the model?
- Which documents or data did it retrieve as context?
- Which tools did it call, with which inputs, and what did they return?
- What did the model answer, how long did it take and how much did it cost?
- Was the answer good? And if not, where did it go wrong?
Without that, every complaint (“the assistant gave a customer the wrong price”) turns into guesswork.
LLM monitoring vs LLM observability
The two terms get used interchangeably, but they answer different questions.
- Monitoring answers “is something wrong?” It looks at aggregates: error rate, latency, cost and volume. For example: “cost per day doubled this week”. You need it to get alerted.
- Observability answers “why is it wrong?” It looks at individual requests, step by step. For example: “this request looped through the search tool nine times”. You need it to debug, improve and audit.
You need both. Monitoring tells you where to look; observability lets you see what happened.
What is AI agent observability?
AI agent observability is LLM observability applied to systems that take actions. An agent doesn’t make one model call: it runs a loop. It reads the request, decides on a step, calls a tool, reads the result, decides again, and so on until it finishes.
So besides prompts and answers, agent observability records:
- Each step of the loop, in order, as part of a single trace.
- The tools the agent chose, with the exact inputs and outputs.
- External content the agent read: emails, web pages, documents, results from other systems.
- Actions with side effects: what it created, updated, sent or deleted.
- Human approvals: who approved what, and when.
The last two are what turn observability into an audit trail. When a customer or an auditor asks “why did the agent do this?”, you can show them.
What to log in an LLM application or AI agent
A practical starting list:
- Trace and request IDs that connect every step of one request, including calls to your own APIs.
- The full prompt sent to the model, including system instructions and retrieved context, not only the user’s message.
- The model and its settings: which model, which version, temperature and other parameters.
- Tool calls: name, inputs, outputs, duration and errors.
- The response and any post-processing.
- Tokens and cost per step and per request.
- Latency per step, so you can see which part is slow.
- Feedback: user ratings, corrections, escalations to a person.
- The user and tenant, so you can check that data from one customer never appears in another’s request.
Be careful with what you store. Prompts and context often contain personal or sensitive data. Decide what to mask, who can see the traces and how long you keep them. When data can’t leave the company, models and logs can stay inside your own cloud: we use Amazon Bedrock for this, so the data stays in the client’s AWS account.
What to measure
Logs are the raw material. These are the numbers we usually track for agents in production:
- Quality: answers rated correct on a sample, or scored against a test set of real cases.
- Task success: how often the agent finished the task without a person stepping in.
- Escalations: how often it handed off to a person, and why.
- Tool errors: failed calls, retries and loops.
- Latency: time to first token and total time per task.
- Cost: per request, per task and per customer.
- Drift: how these numbers change after a new model, prompt or tool.
The last one matters more than it seems. Model providers update models, prompts get edited, tools change. Without a baseline, you won’t notice that quality dropped until customers do.
Observability is also a security control
Most guides treat observability as a debugging tool. For agents, it is also how you detect misuse.
The main risks in the OWASP Top 10 for LLM Applications, like prompt injection and excessive agency, are visible in traces:
- Prompt injection: an instruction hidden in an email or a web page changes what the agent does. In a trace, you can see the external content and the unexpected tool call right after it.
- Excessive agency: the agent uses a tool it didn’t need for the task. Logs show which tools each agent really uses, so you can remove the ones it doesn’t.
- Data leaks: content from one customer appears in another customer’s request. Tracing the tenant in every step makes that detectable.
- Runaway costs: an agent stuck in a loop shows up as a trace with dozens of steps.
If your agents connect through MCP servers, the same applies to every server they call. We explain how those connections work in what an MCP server is.
Observability doesn’t replace testing. It tells you what happened; a security test tells you what could happen if someone tried. Our AI agent security service tests agents against these risks with the same method we use in penetration testing, and our cybersecurity team reviews access, data handling and integrations.
Tools for LLM observability
You don’t need to build this from scratch. Common options:
- Open source: Langfuse and Arize Phoenix, which you can host yourself.
- Platforms: LangSmith (from the LangChain team) and Helicone.
- General observability tools that added LLM features, like Datadog LLM Observability.
- OpenTelemetry, which has semantic conventions for generative AI, so traces can follow a standard format and move between tools.
The choice depends on where your data can live, which frameworks you use and whether you already have an observability stack. For most teams, the hard part is not the tool. It is deciding what to log, masking sensitive data and actually looking at the traces.
Conclusion
LLM applications and AI agents fail quietly: the response looks fine and the mistake is in the content, the context or the tool the agent chose. LLM observability lets you see each step, measure quality and cost, and detect misuse before a customer does. For agents that take actions, it is also your audit trail.
We build observability into the AI agents we build for businesses and the AI features we add to existing products from the first version, so you can see what they are doing from day one.
Frequently asked questions
What is LLM observability?
LLM observability is the ability to see what an LLM application or AI agent did and why: the prompts it received, the context it used, the tools it called, the answer it gave, how long it took and what it cost. It lets you debug, improve and audit AI systems in production.
What is the difference between LLM monitoring and LLM observability?
Monitoring tells you that something is wrong: errors went up, latency spiked, costs doubled. Observability lets you find out why, by following a single request step by step through prompts, retrieved documents, tool calls and responses.
What is AI agent observability?
AI agent observability is LLM observability applied to agents that take actions. Besides prompts and answers, it records every step of the agent's reasoning loop: which tools it chose, with which inputs, what they returned and what the agent did next.
Which tools are used for LLM observability?
Common options include open source tools like Langfuse and Arize Phoenix, platforms like LangSmith and Helicone, and LLM features in general observability platforms like Datadog. OpenTelemetry also has semantic conventions for generative AI, so traces can follow a standard format.