The European Commission, EMA and PIC/S released draft EU GMP Annex 22 for consultation in July 2025, the first GMP text written specifically for artificial intelligence, and it allows only locked models with deterministic output in critical GMP applications. For pharma teams running or planning ML in visual inspection, process control or quality review, the draft defines what AI validation in GxP has to prove: a precise intended use, traceable training data, independent test results, drift monitoring and controlled retraining.
The short answer
Key takeaways
You validate an ML model the way you validate any computerized system: risk-based, documented and tied to a defined use. What changes is where the logic lives. In conventional software it sits in code a reviewer can read. In a model it sits in the training data, so the data becomes part of the validated system.
That breaks three assumptions behind classic CSV. Data defines behavior: identical code trained on different datasets produces different systems. Outputs are probabilistic, so validation covers error rates instead of one pass/fail answer per script.
And performance decays. A model validated on last year’s vials can degrade when a supplier changes glass or maintenance swaps a camera, with no software change at all.
So keep the URS, risk assessment, IQ/OQ/PQ and traceability matrix, and add five AI-specific controls:
Validate the whole system, not just the algorithm. The data pipeline, user interface, human reviewer, MES or LIMS integration and audit trail are all in scope. A model with a 99% F1 score is useless if the upstream image feed silently drops frames.
GAMP 5 Second Edition, published by ISPE in July 2022, added Appendix D11 on AI/ML. It places an ML sub-system lifecycle (concept, project, operation) inside the overall computerized system lifecycle, so the model gets its own controls without a parallel quality system. ISPE followed in 2025 with a dedicated GAMP Guide: Artificial Intelligence.
On the FDA side, three documents matter:
The EMA adopted a reflection paper on AI in the medicinal product lifecycle in September 2024; it expects early regulator contact for high-impact uses. ICH Q9(R1) and ICH Q10 sit underneath all of it.
Annex 22 is the most specific text. It covers static models with deterministic output in critical GMP applications and states that continuously learning models and generative AI/LLMs should not be used there. They may run in non-critical applications with a qualified human in the loop. The draft also expects:
The consultation closed in October 2025. Check whether a final text has been adopted before you finalize SOPs, because wording can shift between draft and final.

Write an intended use precise enough that a tester could reject the model against it. “Detect defects in vials” fails. A usable version names the product and container format, defect classes (cracks, particulates, cosmetic scratches), camera and lighting setup, line speed, the decision the output drives (reject, divert to manual inspection, flag) and who reviews it.
Then score risk on the two FDA axes. Model influence: is the output the sole basis for the decision, or one input a qualified person weighs? Decision consequence: does a wrong output release a defective unit to patients, or raise a nuisance alert?
Human review is your main lever for lowering influence, but only if the reviewer has the time, training and information to disagree. Track override rates; a reviewer who accepts every suggestion is not an effective control.
For lineage, 21 CFR Part 11 and EU GMP Annex 11 apply to training sets, model artifacts, audit trails and inference outputs used in GxP decisions. ALCOA+ applies to all of them, per the MHRA GXP Data Integrity Guidance and PIC/S PI 041. A lineage record should capture:
DVC or MLflow handle hashing and versioning, and model cards give the documentation a standard shape. No regulator endorses specific tools, so qualify them for their use. The usual weak spot is labeling: if three inspectors disagree on what counts as a particulate, your metrics overstate quality. Measure agreement before you train.
A locked model always maps the same input to the same output and changes only through a controlled release. An adaptive model updates its parameters in operation, which turns the validated state into a moving target.
| Factor | Locked (static) model | Adaptive (continuously learning) model |
|---|---|---|
| Validated state | Stable between releases | Changes with every update |
| Critical GMP use (Annex 22 draft) | Allowed | Should not be used |
| Monitoring burden | Drift and periodic performance checks | Continuous verification of a shifting model |
| Change control | Each version released through change control or protocol | Hard to apply; changes happen without a release event |
| Performance over time | Can degrade until retrained | Can track genuine process changes, but also learns noise and bad labels |
For critical GMP decisions today, the defensible default is a locked model with human oversight. Scheduled retraining that releases new locked versions captures most of the benefit of adaptation.
Locked still needs reproducibility work. GPU nondeterminism, library updates and unpinned seeds can shift outputs. Containerize inference, pin versions, hash the artifact and keep a registry with approved, active and retired states. Here AI integration and MLOps for production models becomes a validation asset rather than plumbing.
Set acceptance criteria before anyone sees test results. For an inspection classifier, that might be a false-negative rate for critical defects at or below the current manual rate, with a confidence interval, plus a specificity floor that keeps false rejects tolerable. Report sensitivity, specificity, F1 and calibration per class and subgroup: a model can score 98% overall and miss half of a rare critical defect class.
Keep the test set out of training and hyperparameter tuning, and restrict access so you can prove it. Cover every product, line, shift and camera in scope. SHAP or Grad-CAM show reviewers whether the model looks at the right features; they do not replace performance against criteria.
Monitor inputs and outcomes against thresholds defined during validation, and route alerts into your deviation or CAPA process.
| Drift type | What changes | Detection | Labels needed | Typical response |
|---|---|---|---|---|
| Data (covariate) drift | Input distribution | PSI, Kolmogorov-Smirnov, Jensen-Shannon divergence | No | Investigate the source (camera, supplier, process) and assess impact |
| Concept drift | Relationship between input and correct output | Performance on periodically labeled samples | Yes | Retrain under change control |
| Label (prior) drift | Class frequencies | Predicted vs confirmed class rates | Partly | Recheck thresholds and calibration |
Many practitioners treat a Population Stability Index above roughly 0.1 as worth watching and above 0.25 as a significant shift, though cutoffs vary by author and none are regulatory. Derive and justify your own thresholds from your validation data.
Concept drift needs ground truth, so budget for a periodic labeled sample, such as manual re-inspection of a fixed number of units per batch. Evidently AI, WhyLabs, Arize or Fiddler compute the statistics. The GxP part is the documented threshold, the alert route and a periodic review signed by a QA owner.

Yes. New data produces a new model, even when code and architecture stay identical. The real questions are how much revalidation each change needs and whether you can pre-approve it.
| Change | Example | Expected revalidation depth |
|---|---|---|
| New data, same architecture | Add six months of images | Rerun acceptance tests on the independent set, compare with the prior version, check subgroups |
| Hyperparameter or threshold change | New learning rate or decision threshold | Above, plus targeted risk assessment and threshold justification |
| Architecture change | CNN replaced by a transformer | Near-full model revalidation, updated risk assessment, integration tests |
| Intended-use change | New product, defect class or decision | New validation for that scope |
Full change control for every retrain is slow but easy to defend, and continuous learning is ruled out for critical uses. The middle path is a pre-approved retraining protocol that fixes data rules, procedure, acceptance criteria and release steps in advance. A retrain that meets it releases through a lighter, documented change.
The template comes from devices. FDA’s December 2024 final guidance on Predetermined Change Control Plans (PCCP) for AI-enabled device software defines three parts: a description of modifications, a modification protocol and an impact assessment. FDA has not extended PCCP to GMP software, so treat it as a model. ICH Q12 change management protocols are the closer pharma analogue.
Vendor models follow the same rule, and accountability stays with you. A “validated AI” claim does not transfer validation. GAMP 5 and Annex 11 expect a supplier assessment, a quality agreement and access to the model card, training data description, test results and update process. Foundation models rarely disclose training data, so lean on your own acceptance tests and require contractual notice before updates. If a vendor can push a new version silently, you do not have a locked model.
LLMs fit non-critical roles where a qualified human reviews every output. They are non-deterministic and can produce fluent, wrong text, which is why Annex 22 keeps them out of critical decisions.
Reasonable GMP uses include drafting deviation summaries, triaging CAPA records, first-pass flags in batch record review and SOP search. The model proposes; a trained person decides and signs. Controls that hold up: pinned model versions and prompts under configuration management, logged inputs and outputs, retrieval limited to approved documents, and sampling-based quality checks.
Hosting matters too. A private LLM deployment for regulated industries keeps GxP data and prompts inside your validated boundary. For access, logging and abuse controls, see our notes on practical governance and security for AI features.
The EU AI Act is a separate obligation; meeting it does not satisfy GxP, or vice versa. Regulation (EU) 2024/1689 entered into force on 1 August 2024. Most high-risk obligations were scheduled for August 2026, and those for AI embedded in Annex I products such as MDR and IVDR devices for August 2027. The Commission’s 2025 Digital Omnibus proposal sought to delay some deadlines, so confirm current dates with counsel.
A vial inspection model or PAT soft sensor may fall outside AI Act high-risk categories while sitting squarely inside GMP. AI in a medical device can trigger both MDR and the AI Act. Keep device rules (PCCP, MDR, IEC 62304, ISO 14971) apart from GMP rules: the concepts overlap, the legal frameworks do not. ISO/IEC 42001 and ISO/IEC 23894 can anchor one AI management system that maps to both.

Yes. GAMP 5 Second Edition (ISPE, July 2022) added Appendix D11, which places an ML sub-system lifecycle inside the computerized system lifecycle. ISPE published a dedicated GAMP Guide: Artificial Intelligence in 2025.
It was published as a draft in July 2025, and the consultation closed in October 2025. Check whether a final text has been adopted before finalizing SOPs, since wording can change between draft and final.
Not under the Annex 22 draft. The practical alternative is scheduled retraining that releases new locked versions through change control or a pre-approved protocol.
There are no regulatory values. Practitioners often watch PSI above about 0.1 and treat 0.25 as significant, but you should derive and justify thresholds from your own validation data.
The regulated company. Supplier assessment, a quality agreement, access to test evidence and contractual notice of model updates are expected, and your own acceptance testing still applies.
Artezio builds compliance-ready ML systems for Pharma and Health Tech, with lineage, model registries and monitoring designed in from the first sprint. If you are scoping a GxP AI project, our AI integration and MLOps team can help you design it to pass validation.