The Parse LayerDocument workflows in regulated industries

Chain-of-Custody Logging for AI-Extracted Data in Clinical Trials

Log each retrieval, extraction, and review as it happens.

Cover illustration for “Chain-of-Custody Logging for AI-Extracted Data in Clinical Trials”

Tracking the provenance of AI-extracted clinical trial data requires documenting the progression from a source passage to a regulated record. This requires traceable records of retrieval, extraction, transformation and human review, with each fact anchored to the passage it came from. The key design decision is to capture records contemporaneously. A history reconstructed afterward cannot substitute for evidence needed to examine what originally occurred.

Why AI extraction creates a custody gap that manual workflows did not

If an inspector asks about the protocol origin of a coded term within the analysis dataset, the system reveals only what was accepted and who approved it. It cannot display what the model initially generated or which text served as its basis. The reviewer approved that result months ago, and the evidence needed to explain the approval is gone.

Hand review of long, varied protocols was slow and uneven, yet transcribers could point to the protocol passage behind each recorded endpoint, treatment detail, or timing plan. AI creates a new break in the custody chain. A model cannot later reconstruct how that first judgment was made. The connection from source text to structured field depends solely on the state preserved in that moment.

Banting Health AI’s April 2026 paper showed that coordinators working in simulated workflows strongly preferred AI-assisted extraction and finished tasks substantially faster. Such rapid throughput lets unlogged pulls pile up beyond anyone's ability to trace them back, worsening the provenance gap. The failure happens quietly when the system keeps what the reviewer decided yet throws away every confidence signal along with the suggested value, fetched chunk, and span of origin. Another blind spot emerges whenever inferred or normalized data is passed off as though pulled verbatim. An accurate deduction still falsifies its origin when logged as though taken directly from the source.

What the regulations actually require, and why "audit trail" means more than a change log

For electronic records, Part 11 applies only when a predicate rule requires that record, including 21 CFR Part 312 for a drug trial. So regulatory weight attaches differently to adverse-event codes used in analysis datasets than to documents created for internal planning. Duties turn on which side of the record line the work falls, even if the same models and prompts support both uses.

For in-scope records, relying solely on a change log cannot reveal what touched them, what data went in, or what came out. The mandate in Part 11 for “consistent intended performance” governs whichever system houses the model. Requiring faithful, full reproductions likewise creates a custody gap whenever original outputs and their supporting records remain accessible solely through the console provided by the vendor.

Final guidance issued on September 9, 2025, in the Federal Register, ICH E6(R3) requires audit trails to encompass automated actions and human entries. By adding data lifecycle governance, it also positions regular scrutiny of audit trails and the accompanying metadata as something GCP expects. Parts 11 and 312 impose binding regulations, whereas its status as final guidance is separate. It also differs from the developing, non-binding AI-specific documents.

On January 14, 2026, the FDA and EMA jointly released a document establishing ten core principles to ensure sound AI use throughout pharmaceutical development. Principle 6 requires maintaining auditable, traceable records of data origins and handling steps as GxP standards demand. Similarly, the January 2025 FDA draft guidance FDA-2024-D-4689 recommends connecting intended use, architecture, training data, evaluation criteria, and oversight strategies into a verifiable sequence. No final version has come out as of mid-2026.

How hallucination risk makes source-span anchoring a data-integrity requirement, not just a usability feature

Tying a claim to its source span makes persuasive wording possible to audit. Because LLMs predict likely text rather than verify facts, a field without support cannot prove its accuracy. By opening the precise evidence passage, a reviewer can determine if the value comes from the text or from inference. Citing only the document title cannot settle that difference. Evidence starts with one claim tied to the exact span that supports it.

A June–July 2025 assessment comparing LLMs against FDA oversight and trial records identified hallucination as the leading error category among the models examined. Structured, validated data plus prompt-based mitigation lessened the problem without eliminating it. Banting reported analogous results: trial-specific retrieval pipelines outperformed standalone LLMs relying on optimized prompts at extraction accuracy. The paper’s chunk-level citations enable verification and replication.

In their June 2026 perspective, Thomas Luechtefeld alongside Thomas Hartung highlight a further danger of chained agentic pipelines: minor early mistakes may snowball into assured advice even as the process seems internally coherent. The Evidence-based Agent Stack they outline assigns defined roles that mandate tracking of origins and versions throughout every step, treating such tracking as a computable connection from claims to span identifiers, supported through retrieval logs plus corpus snapshots. Opposing spans need to remain displayed together, since automated reconciliation risks obscuring them and presenting uncertainty as agreement.

The layered architecture: what must be captured at each stage from retrieval through record

Diagram: Four Logging Layers: From Retrieval to Record. Visualizes: Show a vertical or horizontal stepped flow of the four distinct logging layers described in the article: (1) Retrieval — document ID, page/section reference, boundaries, and query…

Recording retrieval activity establishes what evidence came into the workflow. The log needs to hold the document identifier, a page or section reference, the boundaries, and the retrieval query for every retrieved chunk. Since an amendment might leave a document title unchanged, versioned corpus snapshots must reveal the specific protocol version that was searched. This applies the custody idea from eTMF systems to the retrieval stage. Without it, extraction offsets that look precise can still target an incorrect iteration of the protocol.

The extraction log records the model’s output based on that evidence. For every field, the log must capture its character or token offsets in the retrieved chunk, identify which model and setup were used along with the applicable prompt or template revision, and preserve any reported confidence or uncertainty measure. The initially generated output must be preserved unchanged. Model versioning allows changes across extraction runs to be inspected and documents retraining events. WORM (write-once, read-many) storage prevents alterations to extraction logs and supplies an integrity control beyond that offered by conventional lake-based storage.

Transformation logging establishes the point where reading turns into interpretation. Normalizing terms, mapping to controlled vocabularies, converting units, and inferring values left unstated all require explicit tagging as transformations. When several agents collaborate, every transfer needs a log entry since what one system produces feeds directly into the next without guaranteed human oversight. Tracking origins and versions across such interfaces reveals precisely when a value shifted in meaning or form.

Human review logging records who approved or modified the outcome. The log has to keep the reviewer’s identity, the review timestamp, the model’s initial output, and any edits that follow. Attribution goes to the person who directs the action. The four layers cannot replace each other. Knowing who reviewed something won't show which protocol version was pulled, and a locked extraction log can't expose a normalization step nobody recorded.

Why real-time capture is the only viable compliance posture — post-hoc reconstruction is not an equivalent

Recording data in real time safeguards material prone to rapid loss. When a sponsor needs to defend a record, the fetched segments, instructions, model state, plus pre-edit outputs might have already vanished. Repeating an identical query on the matching document and model version cannot consistently regenerate a stochastic result. Such a run merely yields a fresh output incapable of verifying the reviewer's original experience.

A similar issue comes up when retrieval and output logs are kept apart and the link between them is lost. Documenting the response fails to reveal the source material consulted, regardless of whether either system retains corroborating details. Evidence integrity relies on tamper-proof storage, and NTP synchronization ensures logging components share a unified temporal baseline. Decentralized trial platforms use blockchain-secured audit trails to protect records uniformly across jurisdictions and systems. Such safeguards only matter if the pertinent occurrence is recorded at the moment it unfolds.

When full enforcement arrives in August 2026, EU AI Act Article 12 introduces a distinct automatic-logging duty for high-risk AI systems. For systems under point 1(a) of Annex III, the mandated log details must capture the reference databases used, the inputs matched, and the verification personnel involved. That limit keeps the duty from being read too broadly.

A genuine proportionality concern is raised by the ISPE GAMP AI Guide. Not every exploratory prompt demands records or signatures meeting Part 11 standards. What gets captured depends on risk, yet inspectors still need core proof preserved in advance. Choosing to log in real time prevents expensive reconstruction issues.

Where the framework is still unsettled: ICH E6(R3) Annex 2, agentic AI limits, and the scope problem

Three gaps persist even with the design principles already in place. The custody framework for decentralized trials remains incomplete until ICH E6(R3) Annex 2 is finalized. Jurisdictions continue to differ on where agentic AI logging must be mandated. The FDA has yet to specify how far AI audit duties reach when tools shape protocol design. While leaving current duties for regulated records intact, each gap still blocks any claim that one architecture resolves all compliance questions.

Agentic systems strain logging models built around a single captured output. Systems that choose steps, use tools, and direct sub-agents produce action chains that need to remain open to review. Setting operating boundaries in advance, keeping structured logs, and requiring human review before consequential steps manage that risk without treating unrestricted autonomy as acceptable. Collaborators with Harvard Medical School have put forward the MedLog protocol to define a syslog-like common logging standard for medical AI. Because it is still only a proposal, common rules across systems for documenting model actions, timing, actors, and beneficiaries remain unsettled.

Requiring Part 11 controls for every exploratory prompt may cost more than the use warrants. The ISPE guide takes a wider view of data and model governance, which does not justify requiring each prompt-output session to be treated as a regulated record that can be audited independently. Instead, logging should reflect the risks involved and align with the appropriate record boundary, avoiding both indiscriminate capture and categorical exclusion of AI-assisted work.

Building a defensible logging practice now, within the framework that exists

Before anything else, sponsors and CROs should map the predicate-rule records touched by every AI-assisted workflow. Outputs that reach those records need the full set of four logging layers, whereas internal planning artifacts call for lighter controls that are proportionate. This categorization determines where validation ends. Validation ought to focus on the AI's designed operating range, keeping prompt frameworks, retrieval corpus, and model setup under unified version control. Any component change, including model retraining or updates, must go through documented change control.

Agreements must identify who holds extraction records, how they are structured and stored, and if sponsors can supply audit-ready versions independently of vendors. Per FDA’s finalized October 2024 guidance, sponsors retain regulatory responsibility even after outsourcing tasks to vendors. Banting merits attention from groups assessing extraction modules because of its RAG workflow tailored to clinical trials and references tied to individual chunks. Such capabilities aid traceable evaluation, yet the broader system demands clear scrutiny of storage duration, data conversions, provenance, and output.

Use WORM storage as the baseline for logs of retrieval and extraction, link human review to named individuals, and use NTP-synchronized timestamps. Represent transformation flags as part of the data structure. Regularly check AI session-log records against accepted values to detect recurring divergence in model outputs and reviewer calls before inspectors find it. Treat that check as part of ongoing monitoring under E6(R3).

Every new piece from The Parse Layer, as it's published.

Follow

Margaret Solloway

More from The Parse Layer

  1. October 8, 2026Validation and Exception Handling in Automated Document Processing for Insurance9 min read →
  2. October 7, 2026Audit Trails and Provenance Tracking in Document AI Systems10 min read →
  3. November 19, 2026Structured Data Extraction From Financial Regulatory Filings9 min read →