Blog · AI

AI project observability: proving an agent does what it should

Dec 04, 202611 min readby Lilian
LangFuse
On this page

An AI project cannot be proven by conventional acceptance testing. The four proofs to produce, what Langfuse tools, and what to put in the contract.

A conventional software project is proven by acceptance testing: test cases, an expected result, a signed report. A project built on a language model has no expected result down to the character, and that is the whole problem. The nature of the proof changes: it no longer rests on an exact output, but on traces, repeatable evaluations and quantified thresholds monitored in production.

This is the chapter missing from most AI specifications, and the one that tells you whether a team has shipped before. Here is what has to be produced, and how Langfuse, currently the most widely used open source tool for the job, lets you produce it without depending on a vendor.

Why conventional acceptance testing is not enough

We have described our acceptance testing and qualification method elsewhere: test strategy, representative datasets, functional then operational verification, automated regression testing. All of it still applies to the deterministic part of an application. But three properties of a model knock the rest down.

  • The same input does not give the same output. Two identical calls can produce two different wordings, both acceptable. A strict equality test fails without there being any defect.
  • Behaviour changes without you touching the code. The provider updates its model, deprecates a version, adjusts a filter. Your application starts answering differently while your repository has not moved a line.
  • The defect is usually drift, not an outage. Nothing falls over. Answers simply become less relevant, longer, more expensive. Without continuous measurement, nobody sees it before a user complains.

The practical consequence is simple: replace the equality test with a quality measurement, and the one-off check with permanent monitoring. That is exactly what observability means for an AI project.

The four proofs to produce

In a serious tender, or simply in front of a committee that has to authorise a production release, four proofs make the difference. They are built during scoping, not after the first incident.

1. The trace: knowing what actually happened

A trace records the full path of a request: the prompt sent, the documents retrieved, the tool calls, the intermediate responses, the final output, and the latency and cost of each step. Without it, diagnosing a bad answer is guesswork. With it, you know whether the model answered badly or whether document retrieval gave it nothing useful, which is the more frequent case in a RAG setup.

Require the trace to cover the whole chain, not just the model call. This is the point where in-house instrumentation almost always falls short.

2. Evaluation: measuring quality instead of guessing it

An evaluation applies a reproducible judgment to a frozen set of cases. Three families combine in practice: code rules for whatever can be checked mechanically, such as a format or the presence of a citation; a model that judges another model's answers against written criteria, known as an LLM judge; and human annotation, which remains the reference on sensitive cases.

The deliverable to ask for is not an overall score, it is a versioned evaluation dataset with the written criteria and the history of past runs. A score without its test set cannot be replayed, so it proves nothing.

3. Cost: a budget line, not a surprise

Cost per request, per user and per feature has to be visible from the first week. This is the measurement that quietly kills the most AI projects: a system costing thirty cents a question becomes untenable at scale, and nobody notices before the third monthly invoice. It is also what lets you choose between models on evidence, a subject we covered in our article on OpenRouter.

4. Regression testing: proving a change broke nothing

Every change of prompt, model, version or document source must replay the evaluation set and compare the scores with the previous version. It is the exact counterpart of automated regression testing on a conventional project, and the only defence against a provider's silent update.

What Langfuse brings, and what it does not cover

The official repository presents it as an open source AI engineering platform for agent evaluation and observability. In plain terms, it is the tooling for the four proofs above in a single product: tracing, evaluations by rule, LLM judge and human annotation, datasets and experiment runs, versioned prompt management, cost and latency tracking, dashboards, and a playground to compare two prompts.

Two technical choices explain why we recommend it over in-house instrumentation. It is built on OpenTelemetry, the observability standard your teams already use for the rest of the system, which avoids yet another silo. And it exposes Python and TypeScript SDKs, with other languages going through OpenTelemetry, plus more than a hundred ready-made integrations including LangChain, LangGraph, LlamaIndex, LiteLLM, the Vercel AI SDK, Google's agent kit and Amazon Bedrock.

What it does not do, and this needs saying: it is not a security gateway, a content filter or an access control layer. Observability documents what happened, it prevents nothing. Guardrails, isolation and access logging belong to the security and accreditation file, and the quality of the input data belongs to data governance. The three are complementary and none replaces another.

Self-hosted or managed: the choice that commits your data

This is the deciding point for many of our clients, because traces contain, by construction, the content of the exchanges: often personal data or client information.

The self-hosted edition is advertised as free under the MIT licence, with the core features and unlimited usage, and the project states it can run fully offline, in an air-gapped environment. Deployment goes through Docker Compose, through Kubernetes with Helm, which the repository presents as the preferred production mode, or through Terraform on AWS, GCP and Azure. Plan for the real infrastructure behind it: a ClickHouse analytical database, a Redis queue for ingestion and object storage for large payloads. This is not a single container you drop next to the application.

One licensing nuance to know before committing: the home page states that all product features are MIT licensed, while the repository specifies that everything is MIT except the ee folders. And the self-hosting matrix reserves for a commercial licence exactly the items that matter in a company: audit logs, project-level permissions, retention policies, server-side data masking and account provisioning. If your accreditation requires audit logs, you are in the paid offer, self-hosted or not.

On the managed side, the published pricing shows a free tier at 50,000 units a month, two users and thirty days of history, then 29 dollars a month for 100,000 units and ninety days, 199 dollars for three years of history, and 2,499 dollars for the enterprise offer with an uptime commitment. Beyond the plan, overage is billed at 8 dollars per 100,000 units, tapering to 6 dollars on very large volumes. Watch the billable unit: it is any data point sent, so every trace, every observation and every score, not every conversation. A talkative agent burns through them far faster than you would expect.

On location, the managed offer provides a European region, in Ireland, alongside the American and Japanese regions. The security page claims annual SOC 2 Type 2 and ISO 27001 audits, GDPR compliance and a data processing agreement, while noting that the reports are only available to the higher tiers. For a public project or a regulated sector, self-hosting settles the debate, and the logic is the same as for hosting an open source model.

What to put in the contract

Observability is only worth something if it stays with you. Four clauses are enough, and they extend our article on reversibility directly.

  • Ownership of traces and evaluation sets. They are part of the deliverable, exactly like the code. They are what lets another team take the system over without starting from scratch.
  • A documented export format. Traces and scores exportable in a readable format, without going through the supplier's interface.
  • Quantified acceptance thresholds. A rate of answers judged correct, a maximum cost per request, a latency at the ninety-fifth percentile. Without numbers, no acceptance testing is possible.
  • Mandatory replay before a release. Any change of prompt, model or source replays the evaluation set, and the report is attached to the release request.

Where to start, concretely

The temptation is to build the full setup before plugging it in. That is the mistake that makes teams give up, because the work looks enormous. The order that works fits in a week, and it starts by looking before judging.

  • Days 1 and 2: trace, evaluate nothing. Instrument a single journey, the most used one, end to end. The goal is not to measure, it is to see. At this stage you will discover that half the bad answers come from document retrieval, not from the model.
  • Day 3: freeze the test set on real cases. Thirty to fifty cases taken from the traces, not cases invented in a meeting. A test set built from real usage catches the defects nobody anticipated.
  • Day 4: write the criteria in plain language. Three or four, not fifteen. For example: the answer cites at least one source from the corpus, it does not contradict the source it cites, it stays within the authorised scope. These sentences are what will later feed the automated judge.
  • Day 5: first run and baseline score. Record the share of compliant answers and the average cost per request. Those two numbers become your point of comparison for the rest of the project.
  • Then: wire the replay into continuous integration. Any change of prompt, model or corpus triggers the run and compares it against the baseline.

One recommendation that runs against the usual order: do not start with the automated judge. A judge calibrated on imaginary cases produces reassuring and false scores. It is only worth something when backed by real cases and a few dozen human annotations used as a yardstick.

Reservations worth keeping in mind

Langfuse joined ClickHouse in January 2026, according to its own repository. That is reassuring about the durability of the analytical database, but it is a recent change of governance, and prudence suggests checking that the MIT licence on the core remains the policy over time. It is in fact the main argument for self-hosting: the licence protects you, the roadmap does not.

Several recent components are labelled as beta, including the model gateway and skill management. Keep them off the critical path of a production project. Finally, the adoption figures the project advertises, more than fifty thousand companies and more than a hundred thousand engineers, are vendor claims that cannot be verified from outside. The only indicator we checked ourselves is the repository's star count, a little over 38,000 on 2 December 2026, which places its popularity correctly while proving nothing about quality.

Our position

An AI project without observability is not a project, it is a demo. The difference is measured very simply: ask to see the trace of a request from last week, the evaluation set, and the cost per request. If all three exist, the team knows what it shipped. If one is missing, nobody will be able to prove anything the day an answer causes a problem.

We instrument this way from the scoping phase, because adding traces afterwards costs more than planning them, and because it is what lets you pick a model on measurements rather than impressions. If you want to know what this would look like on your own case, our AI scoping starts there, and we are happy to discuss it directly.

FAQ

Frequently asked questions

What is observability for an AI project?

It is the set of means that let you know what a system built on a language model actually did, and measure it over time. It rests on four elements: traces, which record the full path of each request; evaluations, which apply a reproducible judgment to a frozen set of cases; cost and latency tracking; and regression testing, which replays the evaluations on every change. It replaces the strict equality test, which cannot be applied to a non-deterministic output.

Why is conventional acceptance testing not enough for an AI application?

Because three properties of a language model make it inoperative. The same input does not produce the same output, so an equality test fails without any defect being present. Behaviour changes when the provider updates its model, without your code moving. And the typical defect is a gradual drift in quality, not a visible outage. Acceptance testing remains necessary for the deterministic part of the application, but it has to be completed by continuously measured evaluations.

What is Langfuse?

Langfuse is an open source AI engineering platform dedicated to agent evaluation and observability. It covers request tracing, evaluations by rule, by LLM judge and by human annotation, datasets and experiment runs, versioned prompt management, cost and latency tracking, and dashboards. It is built on OpenTelemetry, exposes Python and TypeScript SDKs, and advertises more than a hundred integrations.

Can Langfuse be self-hosted, and under what conditions?

Yes. The project advertises a free self-hosted edition under the MIT licence, with the core features and unlimited usage, able to run in a fully air-gapped environment. Deployment goes through Docker Compose, through Kubernetes with Helm, presented as the preferred production mode, or through Terraform on AWS, GCP and Azure. You need to plan for a ClickHouse analytical database, a Redis queue and object storage. Some functions expected in a company, including audit logs, project-level permissions, retention policies and server-side masking, require a commercial licence.

How much does managed Langfuse cost?

The published pricing shows a free tier at 50,000 units a month with two users and thirty days of history, then 29 dollars a month for 100,000 units and ninety days of history, 199 dollars a month with three years of history, and 2,499 dollars a month for the enterprise offer. Overage is billed at 8 dollars per 100,000 units, tapering on large volumes. The billable unit is any data point sent, meaning every trace, every observation and every score, which adds up quickly with an agent that chains many steps.

Do traces contain personal data?

Yes, by construction, since a trace records the prompts and the responses. That is why the choice between self-hosting and the managed offer is first a compliance decision, not a technical one. The managed offer provides a European region located in Ireland and claims SOC 2 Type 2 and ISO 27001 audits as well as a data processing agreement. For a public project or a regulated sector, self-hosting with data masking remains the easiest answer to defend in front of a data protection officer.