Skip to content
Blog
October 17, 2026Compliance10 min readUpdated November 3, 2026

What audit trail does an AI agent need for regulated review? Part 11, Annex 11 and the EU AI Act compared

A regulated reviewer needs a system-generated, time-stamped record of each agent action: who it was for, what ran, when, and proof the record wasn't changed. Here's what 21 CFR 11.10(e), EU GMP Annex 11 and EU AI Act Articles 12 and 19 ask, and what an agent log should capture to meet them.

byPleach maintainers

Drafted by an AI agent, from a research brief, primary sources and the Pleach docs; reviewed by a maintainer before publishing.

No @pleach/* package is on npm yet. Each name holds a 0.0.1 placeholder until its first release, so the code here describes the source, not an install that works today. Package status

An AI agent under regulated review needs a system-generated, time-stamped record of every action it takes: whose behalf it acted on, which model and tool actually ran, when, and evidence the record wasn't changed afterwards. 21 CFR 11.10(e), EU GMP Annex 11 and the EU AI Act all ask for a version of this. None of them names AI agents in the audit trail clauses, so you map the agent's actions onto the general requirement. The bar validation teams use is reconstructibility: a competent reviewer, working only from the trail, can say what happened months later.

This post maps each requirement to the fields an agent log should carry. For the storage side, see hash chain vs append-only table vs OTel traces. For adding a ledger to an existing loop, see add an audit ledger without rewriting your agent loop.

This is engineering guidance, not legal advice. Your quality and regulatory functions decide how each clause applies to your system.

Requirements side by side

RequirementWhat it asksWhat an agent log must capture
21 CFR 11.10(e)Secure, computer-generated, time-stamped audit trails of operator entries and actions that create, modify, or delete records. Changes don't obscure prior entries. Retained as long as the records.One system-written row per model call and tool action, with a timestamp set by the system, append-only, kept on the records' retention schedule.
21 CFR 11.10(b)Accurate, complete copies in human-readable and electronic form for agency review.A queryable store that exports every row behind one decision in order.
Annex 11 §9 (2011)Risk-based, system-generated record of GMP-relevant changes and deletions. Reason documented. Convertible to intelligible form. Regularly reviewed.The action, its cause (tool name, routing decision), and a reason field for any human change or override.
Annex 11 §12.4 (2011)Identity of operators entering, changing, confirming or deleting data, with date and time.User, tenant, and actor kind on every row, plus the identity of any human approver.
Annex 11 §12 (2025 draft)Who, what, when, why; old and new value; time zone; recorded at the time of events; locked and not editable by any user; sortable and searchable.All of the above, plus UTC timestamps, write-time recording, and edit refusal at the store.
AI Act Art. 12High-risk AI systems technically allow automatic recording of events over the system's lifetime.Automatic event recording at the runtime, not opt-in per call site.
AI Act Art. 19 and 26(6)Providers and deployers keep logs under their control for a period appropriate to the intended purpose, at least six months.A retention policy on the log store, at or above the six-month floor and any longer GxP period.

These texts have different legal standing. Part 11 is a US regulation. Annex 11 is EU GMP guidance, and its 2025 revision is still a consultation draft. The AI Act is an EU regulation whose Article 12 applies to high-risk AI systems only.

What does 21 CFR 11.10(e) require of an audit trail?

21 CFR 11.10(e) requires "secure, computer-generated, time-stamped audit trails to independently record the date and time of operator entries and actions that create, modify, or delete electronic records." The same paragraph adds: "Record changes shall not obscure previously recorded information."

Retention is tied to the records themselves. The trail "shall be retained for a period at least as long as that required for the subject electronic records and shall be available for agency review and copying."

Three neighbouring controls matter for agents. 11.10(a) asks for validation that includes "the ability to discern invalid or altered records." 11.10(b) asks for "accurate and complete copies of records in both human readable and electronic form." 11.10(g) asks for authority checks so only authorized individuals can alter a record or perform the operation.

For an agent, "operator entries and actions" includes what the agent does on a user's behalf. The safe reading is one record per model call and per tool action, attributed to the user who started the turn.

What do EU GMP Annex 11 §9 and §12.4 require?

The 2011 Annex 11 §9 asks you to consider, "based on a risk assessment," building in "a record of all GMP-relevant changes and deletions (a system generated 'audit trail')." For a change or deletion, "the reason should be documented." Audit trails "need to be available and convertible to a generally intelligible form and regularly reviewed."

§12.4 covers attribution: systems "should be designed to record the identity of operators entering, changing, confirming or deleting data including date and time." §17 adds that archived data "should be checked for accessibility, readability and integrity."

The July 2025 draft revision went to consultation from 7 July to 7 October 2025. The draft text grows the audit trail clause into section 12, with ten sub-clauses:

  • 12.2 Who, what, when, why. Capture the user (with role), "the old and the new value," and the date and time "including the time zone if applicable." Data "should be recorded at the time of events, not at the end of a process."
  • 12.3 No edit or deactivation. Audit trail functionality "should be enabled and locked at all times," and "it should not be possible for any user to edit audit trail data."
  • 12.4 Accommodate review. Users can "sort and search audit trail data (who, what, when and why)," or export it to a tool that can.
  • 12.7 Scope of review. Reviews "should be targeted, based on risk," and "a key element should be to verify the reason why a change is made."

The draft glossary defines an audit trail as a record "that allows reconstruction of the events relating to the creation, modification, or deletion of an electronic record." That is the reconstructibility bar in the regulator's own words. Treat the draft as direction of travel until the final text is published.

What logs does the EU AI Act require?

Article 12(1) states: "High-risk AI systems shall technically allow for the automatic recording of events (logs) over the lifetime of the system." Article 12(2) ties the logs to three purposes: identifying situations that may present a risk under Article 79(1) or a substantial modification, post-market monitoring under Article 72, and deployer monitoring under Article 26(5).

Article 12(3) lists minimum fields only for remote biometric identification systems (Annex III, point 1(a)). Those include the start and end time of each use and "the identification of the natural persons involved in the verification of the results." Other high-risk systems get the purpose test, not a field list.

Retention sits in two places. Article 19(1) requires providers to keep the Article 12 logs "to the extent such logs are under their control." The period is "appropriate to the intended purpose of the high-risk AI system, of at least six months." Article 26(6) sets the same floor for deployers. Article 19 lets other EU or national law, in particular on personal data, set the period instead.

If a system is both GxP-regulated and high-risk under the AI Act, plan retention to the longer of the two periods.

What makes an agent's decision reconstructible?

A reconstructible agent trail answers five questions from the records alone. They track the ALCOA+ attributes that the draft Annex 11 glossary lists: attributable, legible, contemporaneous, original, accurate, plus complete, consistent, enduring and available.

  • Attributable. Which user, tenant, and actor kind does each call belong to? Copy the principal onto every row rather than resolving it through a session join.
  • Contemporaneous. Did the system write the record when the call happened, with a system timestamp? Draft 12.2 asks for exactly this.
  • Complete and ordered. Can a reviewer pull every call behind one answer, including calls made by subagents, in the order they ran? A root-turn key on every row makes this one query. The same key supports attributing subagent cost to the turn.
  • Provenance. Which provider, model and transport served the call, after any retry or failover? Record what ran, not what the application requested.
  • Integrity. Can anyone show the record is unchanged? That takes edit refusal at the store, plus a verifiable check such as a hash chain.

Human decisions need the same treatment. When a person approves or rejects a tool call, record their identity, the time, and the branch chosen. The draft's "why" field maps to that approval record. See approving a tool call before and after it runs.

Who decides whether the system is compliant?

Your validation process decides, not a component vendor. Annex 11 §1 bases "decisions on the extent of validation and data integrity controls" on "a justified and documented risk assessment." The draft's §9.9 states that the regulated user "is fully accountable" even when a vendor supplies validation documentation.

ISPE GAMP 5 Second Edition, published July 2022, is titled "A Risk-Based Approach to Compliant GxP Computerized Systems." ISPE's page says it expands appendices to cover AI/ML and discusses FDA's Computer Software Assurance activity. It also stresses "critical thinking" by subject-matter experts.

For AI output used in drug and biologic decisions, FDA's January 2025 draft guidance proposes "a risk-based credibility assessment framework" for an AI model "for a particular context of use (COU)." It is a non-binding draft. Its credibility assessment concerns the model; the audit trail clauses above concern the records.

When to use each

  • US-regulated GxP records (FDA). Start from 21 CFR 11.10(e), (a), (b) and (g). Retention matches whatever period applies to the records the trail covers.
  • EU GMP computerised systems. Validate against the 2011 Annex 11. Design new systems against the 2025 draft's section 12 so you aren't rebuilding when it's final.
  • High-risk AI systems in the EU. Add Article 12 automatic logging and the Article 19 or 26(6) six-month floor.
  • Finance or public-sector review without a GxP rule. The same five reconstructibility questions still help a reviewer, but they don't settle a firm's recordkeeping duties. For broker-dealers, see the SEC and FINRA mapping.
  • AI output feeding an FDA regulatory decision. Pair the audit trail with the credibility assessment in the January 2025 draft guidance.

How Pleach does it

Pleach writes records that a validation and review process can use. It doesn't validate your system, write your user requirements, or run your audit trail review.

One row per LLM call

With an AuditEmitter registered, Pleach writes one append-only row per LLM call to the call ledger. The row shape is post-routing, not what was requested. See the AuditableCall row for every field.

Reviewer questionFields
Who was this for?Tenant, user, actor kind, session auth method
What was the unit of work?Session, turn, stage, sequence within the turn
Did a child agent do this?Subagent depth, parent turn, root turn
What caused the call?Tool name
Which model actually ran?Provider, model, transport
What was the result?Status, finish reason, latency
When, and in what order?Creation time (UTC), record id (monotonic ULID)

Every row names its depth-0 user turn as the root turn, including subagent rows. The regulated-domain agent guide uses it to pull everything behind one answer. Filter the call ledger on the root turn and order by record id. Each row returns its call class, tool name, subagent depth, provider, model, status, routing decision and time.

The event log covers what the session experienced: messages, tool calls, interrupts, turn boundaries. The audit ledger page treats it as the review surface. A human-in-the-loop resolution lands as an InterruptDecisionRecord, carrying the resolver's identity and the chosen branch.

Provenance after failover

Under family-lock, a session locks one provider family and one transport at start. A failed call falls back to the next model in the same family and writes a fallbackStep row with the original model, the attempted model, and inFamily: true. A deliberate change goes through sessions.updateProviderModel, which re-locks the session and saves the new provider and model as a new session version. permittedFamilies narrows the cascade to a vetted list.

Integrity

The event log carries the previous row's hash and its own hash on every row, with writer-side stamping on by default. The call-row ledger has its own per-session chain, also on by default; hashChain: false opts out. The hash chain page lists what each verifier reports.

The chain is tamper-evident, not tamper-proof. Pair it with a signingKey held outside the database, a recorded head passed back as expectedHead, least-privilege credentials for the writer, and the opt-in WORM tier, which refuses UPDATE, DELETE, and TRUNCATE on the event log and the call-row table. Signed attestation envelopes with RFC 3161 timestamps ship as beta, and signing uses the key store you provide.

Replay

@pleach/replay re-folds the recorded event log through the same reducer the runtime uses, and the reconstructed state is byte-identical to the original fold. In headless-replay mode a missing recorded result throws ReplayDivergenceError instead of calling the live model. A fresh rerun against a hosted model isn't guaranteed to match. projectReplayManifest stamps model, provider, versions and config so a divergence is attributable. See eval and replay and determinism.

Package status and versions are on /docs/packages.

Key takeaways

  • The bar is reconstruction. The 2025 Annex 11 draft defines an audit trail as a record that "allows reconstruction" of events.
  • Record at the time of the call. Part 11 asks for computer-generated, time-stamped trails, and the draft says "not at the end of a process."
  • Record what ran. Provider, model and transport after failover answer the provenance question a reviewer asks first.
  • Retention stacks. The AI Act sets a six-month floor; Part 11 ties the trail to the retention period of the records it covers.
  • No library makes a system compliant. Your computerized system validation, procedures, and risk assessment decide that.

References

  1. US eCFR, 21 CFR § 11.10, Controls for closed systems. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-11/subpart-B/section-11.10
  2. European Commission, EudraLex Volume 4, Annex 11: Computerised Systems (revision 1, in operation from 30 June 2011). https://health.ec.europa.eu/system/files/2016-11/annex11_01-2011_en_0.pdf
  3. European Commission, Stakeholders' consultation on EudraLex Volume 4: Chapter 4, Annex 11 and new Annex 22 (7 July to 7 October 2025). https://health.ec.europa.eu/consultations/stakeholders-consultation-eudralex-volume-4-good-manufacturing-practice-guidelines-chapter-4-annex_en
  4. European Commission, Draft revised Annex 11: Computerised Systems (consultation version, 2025). https://health.ec.europa.eu/document/download/40231f18-e564-4043-94de-c031f813d38b_en?filename=mp_vol4_chap4_annex11_consultation_guideline_en.pdf
  5. Regulation (EU) 2024/1689 (AI Act), Article 12: Record-keeping. European Commission AI Act Service Desk. https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-12
  6. Regulation (EU) 2024/1689 (AI Act), Article 19: Automatically generated logs. https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-19
  7. Regulation (EU) 2024/1689 (AI Act), Article 26: Obligations of deployers of high-risk AI systems. https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-26
  8. US FDA, Considerations for the Use of Artificial Intelligence to Support Regulatory Decision-Making for Drug and Biological Products (draft guidance, January 2025, docket FDA-2024-D-4689). https://www.fda.gov/regulatory-information/search-fda-guidance-documents/considerations-use-artificial-intelligence-support-regulatory-decision-making-drug-and-biological
  9. ISPE, GAMP 5: A Risk-Based Approach to Compliant GxP Computerized Systems (Second Edition), July 2022. https://ispe.org/publications/guidance-documents/gamp-5-guide-2nd-edition

Frequently asked

What audit trail does an AI agent need for 21 CFR Part 11 review?

It needs a secure, computer-generated, time-stamped audit trail that independently records the date and time of entries and actions that create, modify, or delete records, per 21 CFR 11.10(e). Changes must not obscure earlier entries. The trail must be kept at least as long as the records it covers and be available for agency review. For an agent, that means one record per model call and tool action, written at the time it happens.

What does EU GMP Annex 11 say about audit trails?

Annex 11 §9 (2011) asks for a risk-based, system-generated record of all GMP-relevant changes and deletions, with the reason documented. The trail must be convertible to an intelligible form and regularly reviewed. §12.4 asks systems to record the identity of operators entering, changing, confirming or deleting data, with date and time. The July 2025 draft revision expands this into a full section on who, what, when and why.

What logs does the EU AI Act require for high-risk AI systems?

Article 12 requires high-risk AI systems to technically allow automatic recording of events over the system's lifetime. The logs must support identifying risk situations, post-market monitoring, and deployer monitoring. Article 19 requires providers to keep the logs under their control for at least six months. Article 26(6) sets the same six-month floor for deployers. Other EU or national law can set a different period.

Can a software library make an AI agent compliant with Part 11 or Annex 11?

No. Compliance is a property of the validated system and the procedures around it, not of a component. Annex 11 and GAMP 5 both put the extent of validation on a documented risk assessment by the regulated user. A library can supply records that the validation tests and the reviewers read. Whether those records meet the bar is decided by your computerized system validation, procedures, and risk assessment.

Is a hash-chained audit log tamper-proof?

No. A hash chain is tamper-evident, not tamper-proof. A verifier that walks the chain reports an edited, inserted, reordered, or removed row. Pair it with a signing key held outside the database, an independently recorded chain head, and database-level refusal of edits. The 2025 Annex 11 draft separately asks that audit trail data be impossible for any user to edit, which is a storage control, not a hashing one.

How does Pleach record an AI agent's decision for audit trail review?

Pleach writes one append-only row per LLM call to the call ledger when an AuditEmitter is registered. Each row carries tenant, user, turn, root turn, subagent depth, provider, model, status, and a monotonic ULID. The event log and the call-row ledger each support a hash chain. Replay re-folds the recorded log rather than calling the provider again. Pleach doesn't make a system compliant or validated.

ai agent audit trail21 cfr part 11eu gmp annex 11eu ai act article 12audit trail reviewcomputerized system validationreconstructibility

More posts