Skip to main content

Can AI write deviation reports and help with root cause analysis and CAPA?

Yes, as a drafting and evidence-gathering aid, but people own the investigation. AI can assemble the chronology, search past deviations and CAPAs for similar events, and list candidate causes with the evidence for and against each. The investigator decides the root cause; QA approves the investigation and CAPA. 21 CFR 211.192 requires a thorough investigation with written conclusions, and a 2026 FDA warning letter says AI output used for CGMP work must be reviewed and cleared by the quality unit.Checked against its sources on 26 November 2026. How these answers are made

Illustration of a seal reviewing RUN-214, with its 7.8-hour hold duration circled in red.

1How to use AI in a deviation investigation, step by step.

The requirements do not change when AI drafts. A deviation must be “recorded and justified” (21 CFR 211.100(b)).1 An unexplained discrepancy “shall be thoroughly investigated”, extending to other batches that may be associated with it, and the written record “shall include the conclusions and followup” (211.192).2 EU GMP asks for “an appropriate level of root cause analysis”.3 An HPRA inspector, asked in May 2026 about AI writing deviations, said “testing / confirming the outputs is key”, and that the company and responsible personnel “are responsible for the decisions made based on the outputs of those models”.4

  1. Set up before first use. Write a procedure saying which steps the tool may assist, what data it may be given and how its output is checked. Validate the tool for that intended use to an extent “commensurate with the risk posed by the automated system” (FDA), based on “a justified and documented risk assessment” (Annex 11).5,6 Train the investigators who use it.7 Validating AI for GxP and ChatGPT and LLMs in GMP set out how.
  2. Decide whether the use is critical. In the EU this decides the answer. Draft Annex 22 says large language models “should not be used in critical GMP applications”, those with “direct impact on patient safety, product quality or data integrity”; in non-critical use, qualified and trained personnel should always be responsible for ensuring the outputs suit the intended use.7 That human review is the condition of non-critical use, not a way past the critical bar. Our reading: drafting stays defensible while the investigator’s tested conclusion and QA’s approval, not the AI’s text, carry the decision. A tool that classifies events, sets investigation depth or feeds disposition unchecked is much harder to call non-critical. Record the call and its reasons in the intended-use assessment; human in the loop AI covers what makes the review real.
  3. Contain and record. People hold product and record the event. AI can draft the description from the batch record; the deviation is recorded and justified by the people involved.1
  4. Build the chronology. AI pulls timestamps from execution records, alarms, laboratory results and maintenance logs into one timeline, each entry linked to its source. The investigator checks every time against that source and leaves gaps as open questions.
  5. Search the history. AI searches earlier deviations, CAPAs, complaints and changes for similar events. Record what was searched and over what period. ICH Q9(R1) controls subjectivity partly by “maximizing the use of relevant data and sources of knowledge”.8
  6. List candidate causes. AI proposes causes, with the evidence for and against each. The investigator adds what it missed. FDA’s March 2026 draft warns that “testing that only supports the first hypothesized root cause may exclude the real (or complete) root cause”.9
  7. Test and conclude. The investigator tests each cause and concludes on the root cause, or the most likely causes where the true one cannot be found. A human error conclusion should be justified against process, procedural and system causes.3
  8. Choose the CAPA. AI can propose actions and show what earlier CAPAs for similar events did. The CAPA owner chooses and QA approves, through the CAPA system ICH Q10 describes.10
  9. Check effectiveness. AI can compare event rates before and after the action against how much the process ran. Whether the action worked is a quality judgment, made in line with quality risk management.3,10
  10. Close. The quality unit approves the written record with its conclusions and follow-up. The AI signs nothing.2,11

2Example: an AI draft and what the investigator changed.

This example is invented: Exemplol 50 mg tablets, press P-⁠2 and Batch 26-⁠061 are illustrative. On Tuesday 20 October 2026 an in-process weight check found 3 of 10 tablets below the 195.0 mg lower limit (target 200 mg ±2.5%; lowest 194.2 mg). An AI tool drafted the investigation that afternoon from the batch record, press alarms, maintenance records and deviation history.

Table 1. Invented example; QA approved the investigation on 3 November 2026, ten working days after the event.
SectionAI draftInvestigator’s findingRequirement
ChronologyHopper refilled 10:21; low-weight alarms 10:33 and 10:38, acknowledgedConfirmed, and added: feeder speed 34 rpm against 38 in the master recipe since maintenance on 12 October211.1922
HistoryDEV-⁠26-⁠0311 (2 July) and DEV-⁠26-⁠0377 (28 August), both closed as operator errorConfirmed; each event came 2 to 8 days after maintenance on P-⁠2 (30 June, 25 August, 12 October)ICH Q9(R1) 5.38
Candidate causesOperator set the wrong fill depth after the refill (favored); new lactose lot; feeder setpointPress log shows fill depth unchanged all run; lactose lot ran 4 batches without failure; setpoint mismatch found on the pressFDA 2026 draft9
Root causeOperator errorRejected. Maintenance procedure does not require setpoints to be restored and verified; earlier closures accepted operator errorEU GMP 1.4(xiv)3
ScopeBatch 26-⁠061Batches run after each maintenance date, including the two earlier events211.1922
CAPARetrain operatorsSetpoint check by a second person after maintenance; MES checks setpoints against the recipe before start; two closures reopenedICH Q10 3.2.210
EffectivenessNone proposedNo setpoint mismatch and no low-weight failure in the 10 batches after each of the next three maintenance visitsEU GMP 1.4(xiv)3

The draft was useful: it found the two earlier events and set out the chronology. Its conclusion was wrong, and wrong in the way the earlier reports it drew on were wrong. The full report format is in how to write a deviation investigation report; the method behind the cause chain is in root cause analysis.

3Template: recording AI use in an investigation.

Add these fields to the investigation report wherever AI contributed. The third column fills them in for the example above. For an LLM in non-critical use, draft Annex 22 says its principles “may be considered where applicable”, so the lines citing it are good practice, not a requirement.7

Table 2. Template, with the invented example filled in.
FieldWhat to recordExample: Batch 26-⁠061Requirement
Tool and versionName, model version and the version of its instructionsSite assistant, model 4.2, prompt set DEV-⁠P-⁠03 rev 2Draft Annex 22 10.1 and 10.27
InputsRecords given to it, with versions and date rangesBatch record 26-⁠061; P-⁠2 alarm and maintenance logs, 1 June to 20 October 2026FDA Q&A 65
History searchWhere it searched, the terms, the period and what it returnedDeviations, CAPAs and changes for P-⁠2 since January 2025; two events returnedICH Q9(R1) 5.38
AI outputThe draft as produced, kept unchangedDraft of 20 October 2026, attachedDraft Annex 22 10.57
VerificationWhich AI statements were checked against their sources, and by whomInvestigator checked every time against the press log; added the feeder speedHPRA, May 20264
Causes testedEach candidate cause, the test applied and the result, including those rejectedFill depth and lactose lot rejected on the press log and lot history; setpoint confirmed21 CFR 211.192;2 FDA 2026 draft9
Human errorIf concluded, why process, procedure and system causes were ruled outNot concluded; the draft’s operator error rejectedEU GMP 1.4(xiv)3
ConclusionRoot or most likely cause, who concluded, QA approvalMaintenance procedure lacks a setpoint check; QA approved 3 November 202621 CFR 211.192, 211.222,11

FDA’s data integrity guidance says: “All data required to recreate a CGMP activity should be maintained as part of the complete record.”5 Without the AI fields, nobody can later tell which parts of the report were checked. Across investigations, trend how often investigators correct the drafts: draft Annex 22 asks for a model’s performance to be “regularly monitored” (10.3), and responses at EMA’s 2026 workshop named “recording of AI outputs and human modifications, and monitoring of human-⁠AI team performance” as evidence of oversight.7,12

4Where AI misleads an investigation.

4.1The first plausible cause.

An AI draft that ranks its causes puts a favorite first, and the favorite reads best. FDA’s draft on responding to Form 483 observations says establishments “should be aware of and minimize bias in risk evaluation and decision-making when determining root cause”, and that “addressing the most obvious causal factor is often not sufficient”.9 Ask the tool for the evidence against its favorite, and test the others before concluding, as the investigator did with the feeder setpoint.

4.2The human error default.

EU GMP says that where human error is suspected or identified, “this should be justified having taken care to ensure that process, procedural or system-based errors or problems have not been overlooked”.3 A draft built from earlier reports carries their conclusions forward. FDA’s March 2026 draft defines a root cause with examples that include a “design flaw that led to human error”.9 More in is human error a root cause?

4.3Confident text without evidence.

NIST describes confabulation as content that generative systems “confidently present” though it is erroneous or false, including logic or citations that make a wrong answer look justified, and warns of “excessive deference to automated systems”.13 Check that every record the draft cites exists and says what the draft says it does.

5What inspectors cite.

FDA’s 2026 warning letters reject investigations that stop at a convenient cause, whoever drafted them:

“For example, your investigation did not include in-depth analysis of the conditions that create the circumstances for human error. It is imperative that you conduct in-depth, root-cause analysis to identify effective CAPA including design remediations.” Pharmathen International S.A., warning letter 320-⁠26-⁠80, 27 May 202614
“Attributing a failure to inherent drug product behaviors is not scientifically sound when a change in the test method yields a different outcome.” Intas Pharmaceuticals Limited, warning letter 320-⁠26-⁠57, 30 March 202615

Both letters ask for an independent assessment of the firm’s whole system for investigating deviations, covering investigation competencies, scope, root cause evaluation and CAPA effectiveness.14,15 On AI itself, FDA told Purolea Cosmetics Lab, which had used AI agents to write specifications, procedures and master production records:

“If you use AI as an aid in document creation, you must review the AI generated documents to ensure they were accurate and actually compliant with CGMP. Your failure to do so is a violation of 21 CFR 211.22(c).” Purolea Cosmetics Lab, warning letter 320-⁠26-⁠58, 2 April 202616

It added that AI output used for CGMP work “must be reviewed and cleared by an authorized human representative of your firm’s QU”;16 more in FDA’s first AI warning letter.

6Where the rules stand in November 2026.

  • EU Annex 22. The line in step 2 may move. EMA’s report of its June and July 2026 workshop, published on 2 October 2026, says the drafting group has discussed allowing generative AI and LLMs in GMP applications with a “fully documented, robust, risk-based control strategy”. Its key messages include “Criticality alone is insufficient; model influence, uncertainty, complexity and detectability must be considered”, and it notes that definitions of direct impact may need strengthening. An industry use case for deviation management illustrated how human involvement might be high where a model has high impact, and fall as experience grows.12 EMA’s inspectors aim to give the Commission a final text in Q4 2026; it was not in EudraLex on 26 November 2026.17,18
  • EU Chapter 4. The July 2025 draft says accountability for the integrity of records and data produced or processed with AI “rests with the regulated user”.19
  • FDA. The January 2025 draft on AI for regulatory decision-making is still a draft, and it excludes AI used for “operational efficiencies (e.g., internal workflows …) that do not impact patient safety, drug quality” or study results.20,21 Whether or not it reaches a drafting tool, the CGMP rules do: output from a computer system “shall be checked for accuracy” (211.68(b)), the investigation must meet 211.192, and the quality unit approves it (211.22).22,2,11

7How it runs in Seal.

Neil can draft a deviation investigation. It reads the deviation description and affected records, execution timestamps and equipment events, and the relevant procedures, then drafts an investigation with a timeline, sources and open questions. The investigator determines root cause, and QA approves the investigation and any CAPA. Missing evidence stays visible as an open question. In Seal’s deviation management, the deviation links the batch, sample and procedure version behind the event, and containment, competing explanations and disposition are separate records, each with its own evidence and authority.

For CAPA, Neil can compare a CAPA’s event rates, setting recurrence after the action against a defined population, exposure measure and effectiveness criteria instead of relying on closure status. The CAPA owner assesses effectiveness and QA approves the conclusion. Neil drafts and proposes; it signs nothing.

AQuestions and answers

Can AI decide the root cause of a deviation?

No. It can list candidate causes and the evidence for and against each, but the root cause is a conclusion of the written investigation, and the people responsible for the activity answer for it. Where the true cause cannot be found, EU GMP says to consider identifying and addressing the most likely causes, which is also a human judgment.

Can AI find similar past deviations?

Yes, and it is a good use of it: recurrence is easy to miss when each deviation is read alone. Search across deviations, CAPAs, complaints and changes, not only events with the same title, and record where the tool searched and over what period, so a reviewer can see what was and was not covered.

Can AI classify deviations as minor, major or critical?

It can propose a classification against the criteria in your procedure, with its reasons. Classification sets how deep the investigation goes and whether the event is reported, so a person confirms it. A model left to classify deviations unchecked is among the uses most likely to count as critical under the EU draft Annex 22.

Who is accountable if an AI-drafted investigation is wrong?

The company and the people who approved it. An HPRA inspector said in May 2026 that the company and personnel responsible for a GMP activity are responsible for decisions made on AI outputs, and the draft revision of EU GMP Chapter 4 puts accountability for the integrity of records produced with AI on the regulated user. A signature on an AI draft is a signature on its content.

Will inspectors ask whether we use AI for deviations?

They may. An HPRA inspector said in May 2026 that inspectors may ask at the opening meeting whether AI is used in any GMP system or process, and update the inspection plan to allow time to inspect it. Be ready to show the procedure, the record of AI use in a recent investigation and how the outputs were checked.

References22 sources

References

  1. 121 CFR 211.100, Written procedures; deviations, eCFR. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211/subpart-F/section-211.100 (read 26 November 2026)
  2. 221 CFR 211.192, Production record review, eCFR. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211/subpart-J/section-211.192 (read 26 November 2026)
  3. 3EudraLex Volume 4, Part I, Chapter 1: Pharmaceutical Quality System, section 1.4(xiv), European Commission, in operation since 31 January 2013. https://health.ec.europa.eu/system/files/2016-11/vol4-chap1_2013-01_en_0.pdf (read 26 November 2026)
  4. 4Question & Answers, QP Forum, Trinity College Dublin, question 1, Richard O’Sullivan, GMP Inspector, Health Products Regulatory Authority (HPRA), 12 May 2026. https://www.tcd.ie/media/tcd/pharmacy/images/qp-forums/qp-forum-2026/presentations/9.3-HPRA-QA.pdf (read 26 November 2026)
  5. 5Data Integrity and Compliance With Drug CGMP: Questions and Answers, guidance for industry, questions 3 and 6, FDA, December 2018. https://www.fda.gov/media/119267/download (read 26 November 2026)
  6. 6EudraLex Volume 4, Annex 11: Computerised Systems, principle and section 1, European Commission, in operation since 30 June 2011. https://health.ec.europa.eu/system/files/2016-11/annex11_01-2011_en_0.pdf (read 26 November 2026)
  7. 7Annex 22: Artificial Intelligence, draft for consultation, sections 1, 10.1 to 10.3 and 10.5, European Commission and PIC/S, July 2025. https://picscheme.org/docview/9715 (read 26 November 2026)
  8. 8ICH Q9(R1), Quality Risk Management, section 5.3, ICH, Step 4, 18 January 2023, corrections 26 January 2023 and 15 January 2025. https://database.ich.org/sites/default/files/ICH_Q9%28R1%29_Guideline_Step4_2025_0115_0.pdf (read 26 November 2026)
  9. 9Responding to FDA Form 483 Observations at the Conclusion of a Drug CGMP Inspection, draft guidance for industry, section IV.C and glossary, FDA, March 2026. https://www.fda.gov/media/191427/download (read 26 November 2026)
  10. 10ICH Q10, Pharmaceutical Quality System, section 3.2.2 and Table II, ICH, Step 4, 4 June 2008. https://database.ich.org/sites/default/files/Q10%20Guideline.pdf (read 26 November 2026)
  11. 1121 CFR 211.22, Responsibilities of quality control unit, eCFR. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211/subpart-B/section-211.22 (read 26 November 2026)
  12. 12Multistakeholder workshop on expert contributions to artificial intelligence guidance development (Annex 22), report, EMA/156789/2026, introduction and topics 3 and 5, European Medicines Agency, workshop of 30 June and 1 July 2026, published 2 October 2026. https://www.ema.europa.eu/en/documents/report/report-multistakeholder-workshop-expert-contributions-artificial-intelligence-guidance-development-annex-22_en.pdf (read 26 November 2026)
  13. 13NIST AI 600-⁠1, Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, sections 2.2 and 2.7, National Institute of Standards and Technology, July 2024. https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf (read 26 November 2026)
  14. 14Warning letter 320-⁠26-⁠80 to Pharmathen International S.A., item 2, FDA Center for Drug Evaluation and Research, 27 May 2026. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/pharmathen-international-sa-723680-05272026 (read 26 November 2026)
  15. 15Warning letter 320-⁠26-⁠57 to Intas Pharmaceuticals Limited, item 1, FDA Center for Drug Evaluation and Research, 30 March 2026. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/intas-pharmaceuticals-limited-721151-03302026 (read 26 November 2026)
  16. 16Warning letter 320-⁠26-⁠58 to Purolea Cosmetics Lab, MARCS-⁠CMS 722591, section on artificial intelligence, FDA Center for Drug Evaluation and Research, 2 April 2026. https://www.fda.gov/inspections-compliance-enforcement-and-criminal-investigations/warning-letters/purolea-cosmetics-lab-722591-04022026 (read 26 November 2026)
  17. 173-year work plan for the GMP/GDP Inspectors Working Group, 2026 to 2028, Annex 22, EMA, 2026. https://www.ema.europa.eu/en/documents/other/3-year-work-plan-inspectors-working-group_en.pdf (read 26 November 2026)
  18. 18EudraLex Volume 4, Good Manufacturing Practice guidelines, European Commission. https://health.ec.europa.eu/medicinal-products/eudralex/eudralex-volume-4_en (read 26 November 2026)
  19. 19Chapter 4: Documentation, draft for consultation, section 4.24, European Commission and PIC/S, July 2025. https://health.ec.europa.eu/document/download/fa336a6e-753b-46fc-b53b-9178bacd8878_en?filename=mp_vol4_chap4_consultation_guideline_en.pdf (read 26 November 2026)
  20. 20Considerations for the Use of Artificial Intelligence To Support Regulatory Decision-⁠Making for Drug and Biological Products, guidance page, draft, FDA, January 2025. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/considerations-use-artificial-intelligence-support-regulatory-decision-making-drug-and-biological (read 26 November 2026)
  21. 21Considerations for the Use of Artificial Intelligence To Support Regulatory Decision-⁠Making for Drug and Biological Products, draft guidance, section II, Scope, FDA, January 2025. https://www.fda.gov/media/184830/download (read 26 November 2026)
  22. 2221 CFR 211.68, Automatic, mechanical, and electronic equipment, paragraph (b), eCFR. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211/subpart-D/section-211.68 (read 26 November 2026)

See your process in Seal.

Bring a procedure or a recurring problem. See how your team configures it with Neil and improves the next run.