Business case and benefits
- Head of QA
- A · Accountable
- Product owner
- R · Responsible
- Solutions architect
- C · Consulted
- Technical PM
- C · Consulted
- Engineers
- I · Informed
- Validation & CSV
- C · Consulted
- DPO
- I · Informed
- Security
- I · Informed
Every new deviation starts with the similar past cases, the likely root-cause areas and a draft outline already in front of the investigator, and recurring problems are spotted before the next one. QA decides every classification, root cause, CAPA and batch disposition.
At a glance
An illustrative scenario. The numbers are typical examples, not a client case study. The cloud services and UK rules were checked on 9 November 2026.
On a busy manufacturing site, deviations are a daily event: a granulation endpoint outside its range, a label reconciliation that doesn't add up, a balance found out of calibration, an environmental monitoring excursion. Each is logged in the eQMS, classified by QA, and the larger ones need a full investigation, a root cause and corrective and preventive actions.
The investigation is where time goes. An investigator gathers the batch record, MES events, LIMS results, maintenance history and training records, then searches the eQMS for anything similar. Search is by keyword, so a past case worded differently is missed. Under time pressure, 'human error' becomes the root cause and retraining becomes the CAPA. The same failure comes back a few months later on a different shift, and nobody connects the two until an annual review or an inspection.
Batches can wait on this. A deviation that may affect a batch must be investigated before the Qualified Person can certify it, so late investigations hold stock and, for some medicines, supply. Quality systems, including deviation and CAPA handling, have long been among the areas most often cited in the MHRA's published GMP inspection findings. Faster is only useful if the investigations are also better.
Agree these, and measure the baseline, before anything is built. Example targets are typical, not promises.
Days from a deviation being raised to its investigation being approved.
ExampleDown by a quarter, without lowering the approval bar
Share closed within the site's own target, often 30 days.
ExampleUp, measured against last year
Deviations with the same root cause on the same equipment or process within 12 months.
ExampleFalling quarter on quarter
How often the conclusion is human error alone. A falling share usually means deeper investigations.
ExampleDown, with QA review of each one
How often investigators mark the suggested past cases as relevant.
ExampleStable, and reviewed monthly
Batches whose certification is held by an open deviation.
ExampleFewer, and for less time
Cross-sector rules are on the UK regulation map.
The manufacturing licence holder runs a pharmaceutical quality system that investigates deviations, finds the root cause and takes corrective and preventive action. Those are QA's decisions. The assistant helps the investigator find and organise evidence; it never classifies, approves or closes a deviation or a CAPA.
Each batch is certified by a Qualified Person, who must be satisfied that deviations affecting it have been investigated. The assistant has no connection to certification, and nothing in the release path waits for, or depends on, its output.
Q9(R1) asks for risk assessments that manage subjectivity. Suggestions from past cases can anchor investigators on old answers, so the assistant shows evidence for and against, and the investigator records their own reasoning. Q10 expects CAPA effectiveness to be checked and reviewed by management; the recurrence watch feeds that review, it doesn't replace it.
Records must be attributable, legible, contemporaneous, original and accurate (ALCOA+). The investigation report is the investigator's record, signed in the eQMS. The assistant's suggestions are logged with their sources and model version, and the tool is validated for its intended use, using a risk-based approach such as ISPE's GAMP 5 (second edition) and its GAMP guide on AI (July 2025) as industry guidance.
Consulted on from July to October 2025 and still in draft in November 2026. The draft Annex 22 covers static, deterministic models in critical GMP uses and says generative AI and large language models shouldn't be used in critical GMP applications; in non-critical uses, trained people are responsible for the output. It applies directly to sites supplying the EU and is a strong signal for everyone else, so this design keeps the language model in a non-critical, advisory role.
Deviation records name operators and investigators. The trend model looks at processes, equipment and materials, not individual people's performance, and it isn't used for disciplinary decisions. That needs a DPIA, a clear purpose and a retention period, and staff should be told how the tool is used.
Showing AWSAzuresovereign / on-prem services. Switch with the toggle; every diagram and table on this page follows it.
01Sources
02Intake
03Intelligence
04Orchestration
05Systems of record
06People
| Layer | AWS | Azure | Sovereign / on-prem |
|---|---|---|---|
| Intake: events and extractsRead-only. Nothing writes back to MES or LIMS. | API Gateway, AWS Glue, S3 | API Management, Azure Data Factory, Blob Storage | Kong or your existing API gateway; Apache Airflow; Ceph or IONOS S3 Object Storage |
| Similar-deviation search (retrieval)Index closed, approved investigations only, with their CAPAs and outcomes, so the assistant learns from conclusions QA signed off. | Bedrock Knowledge Bases | Foundry IQ, built on Azure AI Search | OpenSearch, or PostgreSQL with pgvector |
| Root-cause suggestions and draft outlineBoth clouds offer a choice of models, including Claude. Every suggestion links to the past cases and data behind it. | Amazon Bedrock | Microsoft Foundry | Open-weight models served with vLLM on your own GPUs, or IONOS AI Model Hub |
| Recurrence and trend modelA fixed, versioned model retrained only under change control. Open-source anomaly libraries (e.g. PyOD) suit the trend flags; SageMaker Clarify and Model Monitor are closed to new customers, so monitor drift with your own checks. | SageMaker AI | Azure Machine Learning | MLflow and Kubeflow on Kubernetes |
| Agent runtimeThe original Bedrock Agents closed to new customers on 30 July 2026; new builds use AgentCore. | Amazon Bedrock AgentCore | Foundry Agent Service | An open-source agent framework (e.g. LangGraph) on Kubernetes |
| Workflow | AWS Step Functions | Logic Apps or Durable Functions | Temporal, or n8n |
| Middleware and events | Amazon EventBridge, SQS | Event Grid, Service Bus | Apache Kafka or RabbitMQ |
| Link to the eQMSAgree in discovery what the supplier allows. Suggestions usually appear as a linked, clearly labelled attachment, not as text in the record. | Through the eQMS supplier's published API | Through the eQMS supplier's published API | Through the eQMS supplier's published API |
| Human reviewInvestigators and QA work where they already work. | In the existing eQMS | In the existing eQMS | In the existing eQMS |
| GuardrailsBlocks the assistant from proposing a classification, a batch decision or a conclusion. | Bedrock Guardrails | Foundry guardrails (Azure AI Content Safety) | Open-source guardrails (e.g. NeMo Guardrails, Llama Guard) |
| Identity, keys, data protection | IAM Identity Center, KMS, Macie | Entra ID, Key Vault, Purview | Keycloak or your existing Active Directory; OpenBao or HashiCorp Vault; an HSM |
| Monitoring and auditLog every suggestion with its sources, model version and index version, and what the investigator did with it. | CloudWatch, CloudTrail | Azure Monitor, Log Analytics | Prometheus, Grafana, OpenTelemetry |
| UK data residencyIONOS AI Model Hub runs in German data centres: EU, not UK, residency. | eu-west-2 (London) | UK South / UK West | Your own UK data centre, or a UK or EU provider |
On a phone, the table shows the platform you pick. Sovereign / on-prem means open, portable components you can run in your own data centre or with a UK or European provider; IONOS is shown as one example, and others exist. What sovereign cloud means →
Many organisations keep core systems and sensitive data on their own servers. This is how the same design works across both.
Stays on-prem
MES, electronic batch records, LIMS and the plant's OT network stay exactly where they are, and so does the eQMS if it's hosted on site. Nothing in this design touches equipment or the release path.
Uses cloud AI
The similar-deviation index, the drafting assistant and the trend model can run in a UK cloud region, or on your own GPUs with open-weight models if GMP data must not leave the site. They work on read-only extracts of closed investigations and the data for the open one.
How they connect
Read-only extracts leave through the site's DMZ, never directly from the OT network, over a private link such as AWS Direct Connect or Azure ExpressRoute. Suggestions come back to the eQMS through its API as labelled attachments.
If the link drops
Investigations carry on exactly as they did before, with keyword search in the eQMS. No batch, deviation or CAPA waits for the AI, and the trend report simply runs when the link returns.
What each agent may do through its tools, what it may not, and where a person signs off. The limits are enforced by the platform, not the prompt.
Investigation assistant
Where a person signs offThe investigator writes and signs the analysis. QA approves classification, root cause and CAPA, and decides batch disposition. The Qualified Person certifies. The agent's permissions are enforced by the platform's identity and policy controls, not by instructions in a prompt.
Trend and recurrence watch
Where a person signs offQA reviews every flag at the quality review meeting and decides whether to act. Decisions are recorded in the eQMS as now.
The eQMS stays the record. The assistant uses the supplier's published API with an identity that can read deviations and CAPAs and add a labelled attachment, and nothing else. If your eQMS supplier offers its own AI features, compare them in discovery; the controls in this design apply either way.
MES, batch records and LIMS are read through scheduled, read-only extracts from a reporting copy, never from the live systems on the OT network. That keeps the AI out of the manufacturing control path and out of the scope of the systems' own validation.
Events keep the AI decoupled. A new or updated deviation becomes a message on a queue. If the AI is slow or down, the investigation simply starts without suggestions, and nothing is lost or created twice.
Map today's deviation process, measure the baseline, check the quality of past investigation data, agree the eQMS route with its supplier, and agree the intended use and risk level with QA.
Gate · must be true to passBaseline agreed, intended use written down, validation approach agreed with QA, DPIA started.
One production area in shadow mode: suggestions are produced, investigators work as normal, and QA compares the two.
Gate · must be true to passSuggestion relevance within agreed limits, no influence on classification or disposition, validation evidence complete, head of QA sign-off.
Suggestions go live for the pilot area, with monitoring, support and a rollback plan. The trend report joins the quality review meeting.
Gate · must be true to passMonitoring, support model, rollback plan and investigator training in place.
Add areas and QC laboratories one at a time, then reuse the pattern for complaints and change control.
Gate · must be true to passEach new area passes the same pilot gate.
| Activity | Head of QA | Product owner | Solutions architectI can fill this | Technical PMI can fill this | EngineersI can fill this | Validation & CSV | DPO | SecurityI can fill this |
|---|---|---|---|---|---|---|---|---|
| Business case and benefits | Accountable | Responsible | Consulted | Consulted | Informed | Consulted | Informed | Informed |
| Target architecture and eQMS integration | Consulted | Consulted | Accountable and Responsible | Consulted | Consulted | Consulted | Consulted | Consulted |
| Intended use, risk assessment and validation | Accountable | Consulted | Consulted | Consulted | Responsible | Responsible | Informed | Consulted |
| DPIA and staff communication | Consulted | Consulted | Consulted | Informed | Informed | Informed | Accountable and Responsible | Consulted |
| Build and integration | Informed | Consulted | Accountable | Responsible | Responsible | Consulted | Informed | Consulted |
| Testing on past investigations | Accountable | Responsible | Responsible | Consulted | Responsible | Responsible | Informed | Informed |
| Go-live decision | Accountable | Responsible | Consulted | Responsible | Informed | Consulted | Consulted | Consulted |
| Run, monitor and improve | Accountable | Responsible | Consulted | Consulted | Responsible | Consulted | Consulted | Consulted |
R ResponsibleA AccountableC ConsultedI Informed· not involved
Option A
If there's no architect on the programme, I'd own the design end to end: the read-only data flows from MES and LIMS, the eQMS integration, the retrieval and trend models, and the gates. I'd work closely with your head of QA and validation lead, and report to your programme board.
Option B
If your partner, your eQMS supplier or your own team already has an architect, I'd take on the retrieval, the trend model and the integration under their lead, and give them a second senior opinion on OT boundaries, security and the validation evidence.
Goes wrong
Investigators copy the suggested root cause because it matched last time.
How the design avoids it
Evidence for and against each suggestion, the investigator's own reasoning recorded, and QA checking how often suggestions were adopted unchanged.
Goes wrong
The index is full of old 'human error' conclusions, so the assistant suggests more of them.
How the design avoids it
Index only QA-approved investigations, weight recent ones, and review the root-cause categories before go-live.
Goes wrong
The tool drifts into the release decision because a QP starts relying on it.
How the design avoids it
No link to certification, guardrails against disposition language, and the intended use written down and trained.
Goes wrong
Someone connects the AI straight to MES on the OT network.
How the design avoids it
Read-only extracts from a reporting copy, through the DMZ, agreed with OT security in discovery.
Goes wrong
Validation is left until the end, or skipped because 'it's only advisory'.
How the design avoids it
Agree the intended use and risk level in discovery and validate proportionately from the start.
Changes already announced or under way that affect this design. More in the UK horizon scan.
Design to the draft now: language models advisory only, static and versioned models where it matters, and the intended use written down. Review against the final text when it's published.
Keep the validation pack, the decision logs and the intended use current, so you can show how the AI is controlled when asked.
Watch it for any expectations on AI in manufacturing and quality, and map them to what you already do under the draft Annex 22.
GMP records are kept for years. Record which encryption the new data flows use, and keep it easy to change.
Good answers are specific. Vague answers to any of these are worth following up.
Whether you need someone to lead the design or to support the architect you already have, let's talk it through.