AI in pharma quality assurance is no longer an open question of principle: there is a draft rule, and anyone evaluating a tool should read it before reading a brochure. The European Commission's consultation draft of EU GMP Annex 22 covers AI models used in critical GMP applications, and it says that generative AI and large language models are outside its scope and "should not be used in critical GMP applications" — while allowing them in non-critical ones provided a qualified person is responsible for judging the output. FDA's draft guidance draws a different but compatible line around AI that supports a regulatory decision on safety, effectiveness or quality. Read together, the two drafts point to one safe design for quality work, and it is the design Botminds' Deviation & CAPA Management is built to: the model may read, gather, rank and draft, with a confidence score and a cited record behind every claim; a named person decides, and the decision is the record.
Nothing on this page is a claim of regulatory approval. Both documents quoted are drafts and neither is in force; no authority has approved, validated or certified this or any other product; and the mapping between the draft's clauses and this solution's design is our reading, offered so a quality or validation lead can disagree with it specifically.
What the draft annex keeps in, what it puts out, and what Deviation & CAPA Management does
In scopeStatic models — models that do not adapt during use by taking in new data
Out of scopeDynamic models that continuously and automatically learn and adapt in use
What this solution doesNo model in the solution learns from a plant’s investigations in use. What changes behaviour is a setting a named person edits.
In scopeDeterministic output — identical inputs give identical outputs
Out of scopeProbabilistic output, where identical inputs may differ
What this solution doesLanguage model output is probabilistic. The solution treats every such output as a draft for a person, never as a classification that stands on its own.
In scopeAcceptance criteria set by a subject matter expert before testing, and at least as high as the process being replaced
Out of scope—
What this solution doesThis is the shape of the pilot the solution proposes: measure your own closed cases first, then replay them.
In scopeTest data kept independent of anyone who trained or tuned the model
Out of scope—
What this solution doesA plant’s own closed investigations are the test set, and the people choosing them are the plant’s, not ours.
In scopeFeature attribution — recording what in the data drove a classification
Out of scope—
What this solution doesEvery fact on the evidence board carries the record passage it came from, and every claim in the report is cited.
In scopeA confidence score logged for each prediction, with a threshold below which the outcome is flagged undecided
Out of scope—
What this solution doesEach candidate cause carries a confidence, and the plant sets the level below which no cause may be called most likely.
In scopeChange control over the model, the system and the whole process before deployment
Out of scope—
What this solution doesA customer obligation the solution cannot discharge for them, and the first thing a validation lead should ask about.
In scope—
Out of scopeGenerative AI and large language models, which the draft says should not be used in critical GMP applications
What this solution doesStated plainly on this page. In this design no model output is a GMP decision; a named QA person decides and signs, and the signature is the record.
Can AI be used in a GMP environment?
Yes, and it already is — in vision systems that inspect vials, in models that predict a process parameter, in tools that read and index documents. What the draft annex does is sort those uses by how much damage a wrong output could do, and then apply a different weight of evidence to each. Its subject is AI models "used in critical applications with direct impact on patient safety, product quality or data integrity", and it positions itself as additional guidance to Annex 11, the existing annex on computerised systems. Anything that does not touch those three things sits outside it.
That framing is more useful than a yes or no, because it moves the question from "is AI allowed" to "which of your uses is critical". A model that classifies a vial as reject is making a decision about product quality. A model that reads a maintenance work order and presents the operating hours to an investigator, with the line of the work order it came from, is not — a person reads the line and decides what it means. The two are not the same risk and do not need the same evidence, and a plant that treats them identically will either over-validate the harmless one or under-validate the dangerous one.
The draft also contains a sentence most readers skip and validation leads should not: the model, the system it sits in, and "the whole process it is automating or assisting" should be put under change control before deployment, with any change evaluated for whether retesting is needed and any decision not to retest "fully justified". That is an obligation on the plant, not on the supplier, and it is the part of an AI programme that costs real time.
What does EU GMP Annex 22 say about AI, and what it refuses
It draws three lines, each of them a refusal. The first is about learning: the draft applies to static models, those that do not adapt during use by taking in new data, and says that dynamic models which continuously and automatically learn and adapt "should not be used in critical GMP applications". The second is about determinism: it applies to models whose identical inputs give identical outputs, and puts probabilistic models outside the same boundary. The third follows from the first two.
The draft's own wording is short: having limited itself to static, deterministic models, it states that it does not apply to generative AI and large language models, and that "such models should not be used in critical GMP applications". The next sentence opens the door it has just half-closed — in non-critical applications, with no direct impact on patient safety, product quality or data integrity, qualified and trained personnel should always be responsible for making sure the output of such a model is suitable for its intended use: a human in the loop (draft EU GMP Annex 22 §1, Scope — a consultation draft, not in force).
Two readings of that paragraph are available, and only one of them is honest. The dishonest one stops at the first sentence and concludes that language models have no place in a GMP plant. The second sentence refutes it: the draft anticipates their use in non-critical applications and states the condition — a qualified, trained person responsible for judging whether the output is fit for its purpose, with records kept of that review. The question a buyer has to answer is therefore not whether a tool uses a language model, but whether any of its outputs is a critical GMP decision, and who is named as responsible for each one.
It is worth being precise about the draft's status. It is a consultation text: it carries no entry-into-force date on its face, and the European Commission's own list of EudraLex Volume 4 annexes still runs to Annex 21, with no Annex 22 among them. Nobody is obliged to comply with it today. It is nonetheless the clearest available statement of what European inspectors are likely to expect, which makes it the right document to design against.
Can a large language model be used in a critical GMP application?
On the draft's text, no — and a tool that wants to use one anyway has to make sure the critical decision is not the model's. That distinction carries the whole design, so it is worth stating concretely with the work of a deviation investigation.
Reading a maintenance work order and reporting that a nozzle set has run 1,840 operating hours, with a link to the line of the work order that says so, is not a decision. Finding the supplier manual section that sets a 1,500-hour replacement interval is not a decision. Ranking a worn tip seal above piston wear as a candidate cause, with the evidence for and against each, is a proposal. Approving that the root cause of the deviation is a worn tip seal, deciding the product impact, and signing the CAPA plan is the decision — and in this design it is made by a named QA person, with a password, and with the meaning of the signature recorded, which 21 CFR 11.50 requires of every signed electronic record (21 CFR 11.50).
Put another way: the boundary the draft asks for already exists in GMP, and predates AI entirely. 21 CFR 211.22(a) gives the quality unit the responsibility and authority to approve or reject, and the authority to review production records to make sure that no errors occurred or that any errors were fully investigated (21 CFR 211.22). A system that leaves that authority exactly where the regulation puts it does not need the annex's permission to read a record.
Does the FDA allow AI in pharmaceutical quality?
FDA has not prohibited it, and in January 2025 published draft guidance setting out how to establish the credibility of an AI model's output when that output supports a regulatory decision. Its scope statement is where the useful line sits: the guidance covers AI used "to produce information or data to support regulatory decision-making regarding safety, effectiveness, or quality for drugs", and does not address AI used "for operational efficiencies (e.g., internal workflows, resource allocation, drafting/writing a regulatory submission) that do not impact patient safety, drug quality, or the reliability of results" (FDA draft guidance, January 2025).
The guidance then scales the evidence rather than fixing it. The oversight, "the stringency of the credibility assessments and the performance acceptance criteria, the risk mitigation strategy, and the type and extent of documentation" should all be "commensurate with the AI model risk and tailored to the specific" context of use — FDA's term for the precise role and scope the model plays in answering a particular question. A context of use is not a product; it is one job a model does in one place, and two uses of the same model can sit at very different risk.
The two drafts therefore fit together rather than conflict. Europe's names a class of model and keeps it away from critical work; FDA's names a class of use and scales the evidence to its risk. A plant that can state, for each thing a tool does, which decision it feeds and who makes that decision, has the answer both regulators are asking for. A plant that can only say "we use AI in quality" has neither.
What actually exists, and whether it binds you
| Document | Status | What it governs |
|---|---|---|
| ICH Q9(R1), Quality Risk Management | Adopted 18 January 2023 — final | How much formality to apply to a risk-based decision; the backbone both AI drafts lean on. |
| EU GMP Part I, Chapter 1 §1.4(xiv) | In operation since 31 January 2013 | Root cause analysis during a deviation investigation, and what has to be shown before human error stands as a cause. |
| EU GMP Annex 1 §3.2 | In operation since 25 August 2023 | For sterile products: the investigation scope decision, and the requirement to record why a product or batch was included or excluded. |
| FDA, Considerations for the Use of AI to Support Regulatory Decision-Making | Draft guidance, January 2025 — "for comment purposes only" | Credibility evidence for an AI model whose output supports a regulatory decision on safety, effectiveness or quality. |
| Draft EU GMP Annex 22, Artificial Intelligence | Consultation draft — not in force, not listed in Volume 4 | Static, deterministic models in critical GMP applications: acceptance criteria, test data, explainability, confidence, change control. |
Can AI determine a root cause?
It can rank candidate causes against evidence, and in a GMP system it must not do more than that. The reason is not caution for its own sake; it is that a root cause in a GMP investigation is a determination with consequences — batch disposition, product impact, a CAPA commitment, sometimes a notification — and those consequences belong to the quality unit.
What is genuinely useful is the part before the determination, and it is mostly reading. In the sample investigation the evidence gatherer pulls the batch record steps, the equipment run logs, the utility and environmental data for the window around the event, and quotes each fact with the passage it came from. The similarity finder searches thirty-six months of closed deviations and CAPAs for the same failure mode, equipment class and product. The root-cause analyst fills the six bones of the fishbone, ranks the candidates with a confidence and — this is the part that matters — shows what argues against each one as well as what supports it. A worn tip seal at 76%, with the four points for it and the two against it, is a case a QA lead can test. "Root cause: worn tip seal" is not.
The discipline that keeps this honest is older than the tooling. EU GMP's Chapter 1 requires that where human error is suspected or identified as the cause, it "should be justified having taken care to ensure that process, procedural or system-based errors or problems have not been overlooked" (EU GMP Part I, Chapter 1 §1.4(xiv)). A model that proposes causes will propose the easy one unless it is built not to, which is why the analyst in this solution accepts a people cause only with the process reason behind it. What that test looks like in practice is a guide of its own.
Reading the records, bone by bone, before anything is proposed

Who is accountable when an agent drafts an investigation?
The same people who were accountable before: the investigator who owns the deviation, the quality unit that approves the root cause and the CAPA plan, and the qualified person or head of quality where the product decision sits. Software does not redistribute responsibility, and neither draft suggests it does — the draft annex puts the obligation on "personnel with adequate qualification and training" to be responsible for ensuring the outputs are suitable for their intended use.
What does change is what accountability requires in practice. If a person is responsible for an output they did not write, they need three things to discharge it: the evidence the output rests on, in a form they can open; the reasoning, including what argues against; and a record that they looked. The first two are design choices in the tool. The third is a procedure, and it is the one most quality systems have not written yet — who reviews what, to what depth, and what is retained from the review.
One investigation in Deviation & CAPA Management, marked by who does each step
A person decides
The production supervisorReports the event in one sentence with the area, the time and the batch — a person saw it and a person says so.
Agent
Clock keeperProposes the classification from the plant’s own written rules, starts the 30-day clock, counts every open investigation each morning and drafts an extension request at day 25.
Never: Never extends a clock. Only the head of quality approves an extension.
Agent
Evidence gathererReads the batch record steps, equipment run logs, maintenance work orders, utility and environmental data for the window around the event, quoting each fact with its source passage.
Never: Never changes a GMP record, and reads only the plant, batch and equipment named in the deviation.
Agent
Similarity finderSearches the look-back window of closed deviations and CAPAs for the same failure mode, equipment class and product, shows the similarity score and the reason, and checks whether the earlier CAPA covered this line.
Never: Never merges or closes a record.
Agent
Root-cause analystFills the six bones, ranks the candidate causes with a confidence and the evidence for and against each, and builds the why chain down to a system cause.
Never: Never approves. Proposes only, and accepts human error only with the process reason behind it.
A person decides
EngineeringInspects the equipment the analysis points at, and the inspection result can refute the proposal — in the sample case it is listed under evidence against until it is done.
Agent
Report writerDrafts the investigation report in the plant’s own template — summary, event, data reviewed, root cause, product impact, CAPA plan.
Never: No claim without a citation, and the draft is marked a draft until QA signs.
A person decides
The QA leadReviews the cause, the plan and the product impact, and signs with a user ID, a password and the meaning of the signature recorded. The signature is the decision.
What is human in the loop in GMP, and the records it has to leave
Human in the loop means a person stands between a model's output and the effect that output would otherwise have. In GMP it means something more specific than reading a screen: the person is responsible for judging whether the output is suitable for its intended use, and that responsibility has to be described in advance, in the statement of what the model is for.
The draft annex adds a requirement that is easy to miss and expensive to retrofit. Where a model gives input to a decision made by a human operator "and where the effort to test such model has been diminished, records should be kept from this process" — and, depending on the criticality and the level of testing, that may mean a consistent review or test of every output, according to a procedure. A plant that skips testing because a person checks the work has taken on an obligation to evidence the checking. It also says the operator's own training and consistent performance should then be monitored like any other manual process, which is a sentence worth showing to whoever owns training records.
In this solution the review leaves three kinds of record: the activity trail, which carries each agent step and each human action with its time and its actor; the citation on every fact, so a reviewer can open the record passage rather than take the summary on trust; and the signature itself, with its meaning chosen from the plant's list. Whether that constitutes the records a given inspector would want is a question for the plant's validation lead, not for a vendor's page.
The decision, and the meaning of the signature that records it

Confidence scores, thresholds, and the word ‘undecided’
The draft annex asks for two things about confidence, and they are the most directly implementable clauses in the document. The first is that the system should log the confidence score for each prediction or classification. The second is the useful one: models should have "an appropriate threshold setting to ensure predictions or classifications are made only when suitable", and where the confidence is very low, it should be considered whether the model should flag the outcome as "undecided", rather than making potentially unreliable predictions.
Declining to answer is a feature. In the sample plant the proposed root cause carries 76%, the alternatives carry 17%, 5% and 2%, and the plant sets the level below which no cause may be called most likely — 50%, 60% or 70%. Above the line the analyst proposes with its evidence; below it, the investigation says so rather than producing a cause nobody can defend. A buyer should ask any vendor what their tool does at low confidence, and treat "it always gives an answer" as the warning it is.
Two cautions about the number itself. A confidence score is a property of the model's own ranking, not a probability that the cause is true, and nobody should treat 76% as "three times in four this is right" without a measurement that says so. And a threshold is a safety setting, not a performance target: raising it makes the tool decline more often, which is the correct direction when the cost of a wrong cause is a CAPA aimed at the wrong equipment.
How do you validate an AI model under GMP?
The drafts converge on the same five steps, and none of them is new to anyone who has validated a computerised system. State the intended use in detail, including the data the model takes in and its rare variations, and have a process expert own that statement before testing starts. Define the test metrics and the acceptance criteria, which the draft annex says must be at least as high as the performance of the process being replaced — so the old way has to be measured first. Keep the test data away from anyone who developed or trained the model, with access control and an audit trail over it. Run the test to an approved plan and document every deviation from it. Then put the model, the system and the process under change control, monitor its performance and watch for drift in the inputs.
The step that catches people out is the second one, because it is a measurement of themselves. "At least as high as the performance of the process it replaces" means a plant that cannot say how often its own investigators reach a cause that holds has no acceptance criterion to test against. Running that baseline and the replay on your own closed cases is a project of its own, and it is the pilot design the draft's acceptance criteria point to.
A quality chatbot, and an agent doing one step of an investigation
A chatbot over your documents: Whatever was indexed, usually procedures and past reports. The boundary is the index.
An agent in Deviation & CAPA Management: The batch record, equipment and utility data, maintenance records and closed cases for the plant, batch and equipment named in this deviation, and nothing else.
A chatbot over your documents: An answer in a conversation. Nothing lands in a quality record.
An agent in Deviation & CAPA Management: A draft investigation report in the plant’s own template, marked a draft until QA signs it.
A chatbot over your documents: Usually a document name, sometimes a page. Often nothing.
An agent in Deviation & CAPA Management: The passage behind each fact, opened in the record itself, with twelve numbered sources on the sample case.
A chatbot over your documents: Nothing, and it will still answer with the same confidence either way.
An agent in Deviation & CAPA Management: Nothing. It proposes with a confidence and shows what argues against; a named QA person approves.
A chatbot over your documents: A chat history, if anyone keeps it.
An agent in Deviation & CAPA Management: Each agent step and each human action on the activity trail with its time, and a signature with its meaning recorded.
What the five agents may never do
A limit is only real if it is written as a prohibition rather than a preference, and if the product would be visibly broken without it. The five in this solution are: the evidence gatherer has read-only access to GMP records and never changes one, and reads only the plant, batch and equipment the deviation names; the similarity finder never merges or closes a record; the root-cause analyst proposes and never approves, shows what argues against each cause, and accepts human error only with the process reason behind it; the report writer makes no claim without a citation and marks the draft a draft until QA signs; and the clock keeper cannot extend a clock, only draft the request for the head of quality to approve.
What the solution does not do is also worth naming, because a buyer's risk sits there. It does not approve anything. It does not replace a quality management system's document control, training records or change control. It does not come validated for your plant — qualification against your intended use is yours, and so is the change control the draft annex asks for. And no part of it has been reviewed or approved by FDA, EMA, MHRA or any other authority.
Eight questions for any vendor claiming AI in a GMP workflow
- Does any model output become a decision without a named approver?
Ask them to name the decisions and the roles. If the answer is a workflow diagram rather than a person, the question has not been answered.
- What is logged for each output?
The draft annex asks for the confidence score per prediction and for records from the human review. Ask to see one, exported.
- Is there a threshold below which it declines to answer?
And is the threshold the plant’s setting or the vendor’s? A tool that always produces a cause is telling you less than it appears to.
- Can every claim be traced to the record passage it came from?
Not a document name — the line, opened in the record. Test it on a claim you know is marginal.
- What is the intended use statement, and who owns it?
The draft puts it with a process subject matter expert, documented and approved before acceptance testing starts. Ask whose expert.
- What was the acceptance criterion, and against whose performance?
The draft requires it to be at least as high as the process being replaced, which means your baseline, measured on your cases.
- What happens to the model under change control?
Who tells you it changed, what triggers a retest, and what justification is recorded when there is no retest.
- What is kept when a human reviews?
If the testing effort was reduced because a person checks the output, the checking is now the evidence. Ask what it leaves behind.
The thresholds and approvers are the plant’s settings, not the vendor’s

The honest summary is short. A draft European rule says language models should stay out of critical GMP decisions, and this design keeps them out of decisions altogether — the reading, searching, ranking and drafting are the model's; the determination is a person's, signed, with its meaning recorded. Whether that satisfies your inspector is your judgement to make, on your intended use, against the final text when it arrives. To look at the evidence, the thresholds and the signature on real screens, start from Deviation & CAPA Management, or see the questions that separate one system from another.
Questions people ask
Is EU GMP Annex 22 in force?
No. It is a consultation draft, and the European Commission's published list of EudraLex Volume 4 annexes still ends at Annex 21. Nothing in it binds a manufacturer today, and the final text can differ from the draft in any respect. It is worth designing against anyway, because it is the clearest available statement of what European inspectors are likely to look for.
Does an AI tool in quality need computerised system validation?
If it touches GMP records or decisions, treat it as a computerised system and validate it for your intended use; 21 CFR 11.10(a) requires validation of systems to ensure accuracy, reliability and consistent intended performance. The AI-specific additions in the draft annex — the intended use statement, the acceptance criteria, the independence of test data, the confidence logging and the change control — sit on top of that, they do not replace it.
Can an agent close a deviation?
Not in a design that follows either draft. Closing a deviation is a quality unit determination with product consequences, and 21 CFR 211.22(a) places that authority with the quality control unit. In this solution only named people move an investigation to CAPA or to Closed, and the move is recorded as a signature with its meaning.
What does a confidence score actually mean here?
It is the model's own ranking of one candidate cause against the others on the evidence assembled, not a measured probability that the cause is correct. Use it as an ordering and a threshold — below the level the plant sets, no cause may be called most likely — and not as a statistic, unless you have measured it against your own closed cases where the answer is already known.
Who is accountable if an AI-assisted investigation reaches the wrong cause?
The people who approved it. The draft annex is explicit that qualified personnel are responsible for ensuring model outputs are suitable for their intended use, and GMP already places approval authority with the quality unit. A tool can make the mistake easier to catch — by showing what argues against a cause, and by citing the record behind every fact — but it cannot absorb the responsibility.
Does using AI have to be declared to a regulator?
There is no general declaration requirement, and FDA's draft guidance addresses AI whose output supports a regulatory decision rather than internal workflow. What an inspector will expect to see is ordinary GMP evidence: what the system is for, how it was qualified for that use, who approves what it produces, and the change control over it. Engage early if you are unsure whether a particular use crosses into the guidance's scope — FDA's draft invites exactly that.