Best Practices for Building Agents Recap
Arthur

Prove It: Data Lineage for Agent Outputs Under Audit

July 23, 20267 min read

A regulator points at one answer your agent produced. Not the system, not the monitoring dashboard, one specific output: a customer-facing explanation of why a transaction was flagged. They ask you to prove it. Show the exact documents, the data, and the model call behind that sentence, and prove the agent didn't make it up. Your monitoring stats say the agent passes 98% of its continuous evals. That number does not answer the question. The auditor is not asking whether the program works. They are asking where this one answer came from.

Passing a governance review proves your agent has controls. Answering an auditor's challenge about a specific output proves what that one answer was built from. Those are different problems. Data lineage is the ability to walk a single output backward through the full chain that produced it: every retrieved document, every tool result, every model call. This post covers what lineage means for an agent output, why tracing depth is the foundation, how to reconstruct one answer on demand, and how to prove that answer stayed grounded in real sources.

Why aggregate governance evidence isn't enough

The broader auditability story is about showing a reviewer that your agent has controls: active continuous evals, running guardrails, a named owner, a full risk surface. That evidence clears the agent to operate. It is aggregate and program-level.

An auditor's challenge to a specific output is a different question. Regulators in financial services, healthcare, and insurance increasingly point at individual decisions: a loan denial explanation, a clinical summary, a reported figure, a fraud flag. They want to know where that one answer came from. Demonstrating that a monitoring program exists does not reconstruct the provenance of a single response. You need to walk one output backward through everything that produced it, and produce that chain as evidence.

What lineage actually means for an agent output

For any single output, lineage is the complete set of inputs and steps that produced it:

  • The retrieved documents the agent had in context: which chunks, from which sources, at what version
  • Every tool call and the exact result each one returned
  • The model or models invoked, with their prompts, completions, and parameters
  • The reasoning and decision path across agents and subagents

Lineage is not a summary or a single log line saying "answer generated." It is the reconstructable chain that lets someone independently verify the answer was supported by real, identifiable sources. If you can't point to the specific document chunk that grounded a claim, you can't prove the claim was grounded at all.

Why tracing depth is the foundation

Lineage is only reconstructable if your traces capture retrieval and tool detail as structured, first-class spans. Generic logging records that an answer was produced. It does not record which document chunk grounded a claim or what a tool returned.

This is where the OpenInference semantic conventions that Arthur is built on matter for lineage specifically:

  • RETRIEVER spans capture which documents were pulled, and often just as important, which were not.
  • LLM spans capture full prompt, completion, model, and parameter detail.
  • TOOL spans capture inputs and outputs for every API call, query, or code execution.
  • Message, document, and tool-call sub-types preserve the structure of what the agent actually saw.

Compare traces from the same agent side by side and OpenInference produces more expressive, debuggable output than conventions that flatten retrieval and tool logic into generic function spans. That depth is exactly what lineage requires. A retrieval step buried inside an untyped span tells you the agent retrieved something. A first-class RETRIEVER span tells you which document, which chunk, which version, which is the difference between reconstructing an answer and guessing at it.

Reconstructing a single output on demand

Here is what it takes to answer the auditor's question for one response.

  • Pin the output to a trace. Application metadata, user ID, session ID, request ID, is what lets you find the exact trace for the challenged interaction. Without it, you are searching blind through production traffic. With it, the flagged-transaction explanation maps to one specific trace.
  • Walk the trace backward. Start from the final output and follow the spans back through the model call, the tool results, and the retrieval spans to see exactly what context the agent had when it produced the answer.
  • Identify the grounding sources. Show which retrieved documents, and which versions, supported the claim. Confirm the answer did not assert anything outside that context.
  • Produce the evidence. The reconstructed chain is the artifact you hand the regulator: here is the answer, here are the documents behind it, here is the tool result it used, here is the model and prompt that produced it.

The reconstruction is only possible because the depth was captured at the time the answer was produced. You cannot add lineage after the challenge arrives.

Proving an answer wasn't fabricated

Lineage tells you what the agent had access to. It does not, by itself, tell you whether the answer stayed within it. That second half is a groundedness question.

A groundedness eval or post-LLM hallucination guardrail checks whether the answer's claims are supported by the context the agent actually had. Together with lineage, that forms the proof: the RETRIEVER span shows the source documents, and the groundedness check shows the answer's claims were supported by those documents. The regulator gets both the sources and the confirmation that the answer didn't stray beyond them.

The self-correction loop makes this stronger at the point of generation. When a hallucination check flags an unsupported claim, the flagged content goes back to the model with a correction prompt, and the agent revises before the response is ever returned. An ungrounded claim gets caught in the moment rather than surfacing months later as an output that fails an audit.

Versioning and reproducibility

An auditor may challenge an output from months ago. If the prompt has changed since then, you need to know which prompt version was live at the time the answer was produced.

This is where prompt versioning and environment tagging complete the lineage picture. The reconstructable chain is only accurate if you can pin the output to the exact prompt version, model, and configuration in effect when it ran. Prompts managed externally with explicit versions and clear change history give you that pin. Regression datasets built from real traces preserve historical behavior, so the way the agent behaved at the time of the challenged output is not lost to a later change.

Lineage for multi-agent and RAG-heavy chains

The hard case is a chain. When an orchestrator delegates to subagents, or an answer draws on multiple retrieval steps, lineage has to span the whole chain: every hop, every retrieval, every tool call.

The distributed tracing model handles this. End-to-end traces that follow execution across agents and system boundaries are what make chain-wide lineage possible. An answer that passed through a research subagent, two retrieval steps, and a summarization agent has to be reconstructable across all of them. A single flattened log per agent cannot show where a multi-hop answer came from. A connected trace can walk the full path from the final output back to the specific document three agents deep that grounded the claim.

Arthur's role here is the tracing-depth and telemetry layer that makes single-output lineage reconstructable: first-class retrieval, tool, and model spans, application metadata to pin an output to its trace, groundedness checks to prove the answer stayed within its sources, and prompt versioning to reproduce the exact configuration behind a historical answer. Lineage alone does not satisfy any specific regulation, and no honest platform should claim it does. What it does is let you answer the question when a regulator asks it.

Takeaway

An auditor's challenge to a single output is not answered by aggregate monitoring stats. It is answered by the reconstructable chain of documents, tool results, and model calls behind that one answer, and that chain only exists if you captured retrieval and tool detail as first-class spans when the answer was produced.

Instrument retrieval and tool calls as first-class spans now, so any output can be reconstructed later. Book a demo with an AI expert or explore the Agent Development Toolkit.

SHARE