Guide: what the draft Annex 22 requires of AI in GMPRead the guide

The seven pieces of evidence to validate an AI model in GMP, one by one

Validating an AI model in GMP takes seven pieces of evidence a conventional system does not need. What each one is and what draft Annex 22 says

Validating an AI model in a GMP process takes more than adding tests to the usual validation. The model needs seven pieces of evidence of its own: intended use, level of autonomy, test data, sources for each proposal, version under change control, recorded oversight, and monitoring in production. The draft Annex 22 already asks for most of them, and the ones it does not name in those words follow from what it proposes.

Why a model needs its own evidence

A conventional computerized system does what its specification says: same input, same output, and a well-written test proves it. An AI model gets its behavior from training on data, not from someone programming it line by line. Its output can be probabilistic, and if the model comes from a third party, the vendor releases new versions on its own schedule.

That is why the validation documentation for a system with AI includes items a conventional system does not need. The system is still validated under Annex 11, and the model adds its own. Together, those items make up the model documentation: what you show an inspector who asks how the company knows the model does what it claims.

Keep the regulatory status in mind. Annex 22 of EudraLex Volume 4 is still a draft: it went out for public consultation on July 7, 2025, the consultation closed on October 7, 2025, and as of this article the final text has not been published. A draft creates no obligation yet, but it shows what inspectors will ask. We summarize it section by section in our Annex 22 guide.

1. Intended use

What task the model performs, on what data, and what is out of scope. It comes first because everything else is measured against it: you cannot say whether a model works well without first writing down what it is for.

The draft Annex 22 is demanding here (section 3). It asks for a detailed description of the task and the input data, with common and rare variations, limitations, and possible erroneous or biased inputs. Where applicable, the data is divided into subgroups: by outcome (accept or reject), by site or equipment, by material, or by defect type and severity. A process subject matter expert approves the description before acceptance testing starts.

In practice, a well-written intended use heads off a common inspection discussion: the model was tested on one set of cases and sees a different set in production.

2. Level of autonomy

Whether the model suggests, drafts, or executes with approval. It is decided based on the risk to the patient, the product, and data integrity, and the decision is justified in writing.

The draft approaches this from the human side. If the model provides input to a decision made by an operator, and testing effort has been reduced because of that, the intended use should include the operator's responsibility, and the operator's training and performance are monitored like any manual process (section 3.3). On generative AI and large language models the draft is firmer: they should not be used in critical applications, and in non-critical ones a suitably qualified person is responsible for making sure the output fits the intended use.

There are decisions where we do not put AI: certifying a batch, deciding to notify an authority, approving a change, or dispositioning an out-of-specification result. The model can prepare the information. A named, accountable person decides.

3. Test data

Real, representative cases, kept separate from the ones used to tune the system. The acceptance criterion is set before testing.

This is the most detailed part of the draft (sections 4 to 7). Metrics are chosen to fit the use: for a classification model, the text cites the confusion matrix, sensitivity, specificity, accuracy, precision, or F1 score. A process subject matter expert defines and approves the acceptance criteria before testing, and they cannot fall below the performance of the process the model replaces. That requires something many companies have not measured: how often today's manual inspection or review actually gets it right.

Test data should cover every subgroup, be large enough to calculate the metrics with statistical confidence, and have verified labels. It should also be independent: the people who train the model should never have seen it, access is captured in the audit trail, and the company records which data was used, when, and how many times. Generating test data with generative AI is not recommended.

4. Sources for each proposal

Each proposal shows which documents or records it comes from, so the reviewer can check it.

The draft frames this as explainability (section 8): when testing a model used in a critical application, the system records which features of the data led to each classification, using techniques such as SHAP, LIME, or heat maps, and reviewing them is part of approving the test results. It adds confidence (section 9): the score for each prediction is logged, and a threshold is set below which the model can flag the case as undecided instead of risking an answer.

For a model that drafts text, such as one that prepares a deviation investigation draft, the practical form of this evidence is the citation: every statement in the draft links to the record it comes from. A proposal without a source cannot be reviewed, only trusted.

5. Version under change control

The model, its version, its instructions, and its configuration are part of the validated system. A new vendor version does not go into production without change control.

The draft asks for change control and configuration control before the model goes into operation (sections 10.1 and 10.2). Any change to the model, the system, or the process, including the physical objects the model uses as input, is documented and assessed to decide whether retesting is needed, and a decision not to retest is justified. It also calls for measures to detect unauthorized changes.

With third-party models, this shapes the design. The system has to pin the exact version that was validated and be ready to switch models through change control, without being rebuilt.

6. Recorded oversight

The audit trail stores what the model proposed, with which version, and what the person accepted, corrected, or rejected. That person has the training to understand the output and challenge it.

The draft asks for records of human review when the model supports a decision and testing effort has been reduced. Depending on criticality, that can mean reviewing every model output according to a procedure (section 10.5). It is also a data integrity question: if the audit trail only keeps the final result, no one can tell later which part the person decided and which part the model did.

7. Monitoring in production

The share of proposals that get corrected or rejected is measured continuously. If it rises, the system flags it before an audit finds it.

The draft asks for regular monitoring of model performance against its metrics, and of whether input data still falls within the intended sample space and use, with defined metrics to detect drift (sections 10.3 and 10.4). Its own example comes straight from the shop floor: a change in the lighting on the line. The model has not changed, but what it sees has.

An example: visual inspection of vials

This is an illustrative example, not a real case. A vision model checks every filled vial on the line, sets aside the defective ones, and sends the ones it is unsure about to a person. Here is what each piece of evidence would look like:

  • Intended use: which defects it detects, in which vial formats and line conditions, and what is out of scope.
  • Level of autonomy: it sets the vial aside when its confidence is above the threshold; below it, the inspector decides.
  • Test data: vials with known defects of every type and severity, never seen by the training team, with an acceptance criterion approved before testing and no lower than current manual inspection.
  • Sources for each proposal: the heat map of the area of the vial that led to setting it aside.
  • Version under change control: model version and threshold are fixed; changing the camera or the lighting opens a change control.
  • Recorded oversight: every vial sent for review keeps the model's proposal and the inspector's decision.
  • Monitoring in production: the share of vials sent for review and of corrections, by shift and by format.

What it means if you work in a regulated environment

For quality assurance and validation, the question shifts from whether the model works to whether you can show it works for this use, with this version, and on this data. Three practical consequences follow.

Before choosing a model, measure the current process. Without that figure there is no acceptance criterion the draft would accept.

Set aside the test data from day one. Getting independence back after training is usually impossible.

If the model comes from a vendor, your company still reviews the documentation (section 2.2), and GMP responsibility stays with you. Ask in the contract for the records and the output justification you will need.

And if the risk analysis concludes that a model's uncertainty cannot be controlled, the conclusion is not to use it, and that is documented.

At ComplAI we deliver these seven pieces of evidence for every model, along with the validation documentation for the application. You can see how on AI an inspector can review and how we work. If you have a model in use or in the works, let's talk.

Sources

See all articles

Let's talk about your process

Tell us which process you want to solve and we'll tell you how we would approach it.