Quality and regulatory leaders in life sciences face a difficult question: how do we use Generative AI in GxP work without compromising patient safety, product quality or data integrity? The technology is non-deterministic, evolves quickly and can be confidently wrong, which seems at odds with validated, controlled systems.

The answer is not to avoid GenAI in regulated processes. It is to apply the same principles that have always governed computerized systems (intended use, risk-based assurance, data integrity and change control), adapted to the specific characteristics of AI. This article presents a practical framework and applies it to a concrete example: an AI assistant for GMP deviation investigations.

The use case: a deviation investigation assistant

When a deviation occurs in manufacturing, quality teams must investigate the root cause, assess product impact, and define corrective and preventive actions (CAPAs), often under time pressure. Investigators spend much of their time:

  • searching for similar past deviations and their outcomes
  • locating relevant SOPs, batch records and equipment history
  • drafting investigation reports in a consistent format

A GenAI assistant can retrieve relevant history, summarize evidence and draft report sections, with the investigator making every decision. That intended use, decision support with human accountability, is the starting point for governance.

Pillar 1: an AI governance framework

AI in regulated work needs an organizational framework, not just technical controls. Leading organizations align with emerging standards and guidance:

  • NIST AI Risk Management Framework for structuring how AI risks are identified, measured and managed
  • ISO/IEC 42001 for an AI management system
  • the EU AI Act for risk-based obligations where it applies
  • health authority perspectives on AI in drug development and manufacturing, alongside existing GxP regulations

In practice, this means an AI inventory, clear ownership for every AI use case, defined approval processes, and policies for acceptable use, data, and human oversight.

Pillar 2: risk tiering based on intended use

Not every AI use needs the same rigor. A risk-based approach, consistent with computer software assurance (CSA) and GAMP guidance, classifies each use case by:

  • impact: could an error affect patient safety, product quality or data integrity?
  • autonomy: does AI make decisions, or support people who do?
  • detectability: would an error be caught by downstream review?

The deviation assistant, as decision support with mandatory human review, sits in a moderate tier. An AI system that automatically dispositions batches would sit far higher, and might not be appropriate at all.

Pillar 3: layered guardrails

Guardrails are engineered into the architecture:

  1. Input guardrails: restrict the assistant to its intended use, detect prompt injection, and prevent unnecessary personal data from entering the system.
  2. Retrieval guardrails: ground every answer only in approved, effective documents (current SOP versions, released batch records, closed investigations), enforced through metadata filters and access controls.
  3. Generation guardrails: require citations for factual statements, prohibit conclusions about root cause or product disposition, and use structured output templates.
  4. Output guardrails: automated checks verify that citations exist and support the statements, flag low-confidence content, and route outputs for human review.
  5. Human-in-the-loop: the investigator reviews, edits and approves all content. The final report is the investigator's record, not the AI's.

Pillar 4: evaluation harnesses

Traditional validation tests deterministic behavior with fixed scripts. GenAI requires an evaluation harness:

  • a golden dataset of representative questions and historical investigations with expert-approved reference answers
  • automated metrics for groundedness, citation accuracy, completeness and policy compliance
  • LLM-as-judge scoring, calibrated against human expert ratings, to scale evaluation
  • adversarial and red-team tests for prompt injection, out-of-scope requests and misleading inputs
  • documented acceptance criteria that must be met before release and after every change

These results form the core of the validation evidence.

Pillar 5: change control for prompts, models and data

In a GenAI system, the things that change are not only code. Prompts, model versions, retrieval configuration, embedding models and knowledge-base content all affect behavior. Effective change control:

  • versions every component, including prompt templates and model identifiers
  • pins model versions rather than silently accepting provider updates
  • re-runs the evaluation harness on every change, with risk-based acceptance
  • defines when re-validation is required versus routine updates

Pillar 6: data integrity and Part 11 audit trails

The system must uphold ALCOA+ principles and 21 CFR Part 11 / EU Annex 11 expectations:

  • secure, time-stamped audit trails of every query, retrieved source, generated output and human edit
  • attribution of all actions to authenticated users
  • retention and retrievability of records for inspection
  • clear distinction between AI-generated drafts and approved records

Pillar 7: monitoring in operation

Validation is not a one-time event. In production, organizations monitor:

  • quality signals such as user corrections, rejected suggestions and citation failures
  • drift in the types of questions asked and the knowledge base
  • periodic review of performance against acceptance criteria, feeding continuous improvement

Bringing it together

With this framework, the deviation assistant can be deployed with confidence. Its intended use is documented. Its risk is assessed. Guardrails constrain its behavior. An evaluation harness proves it meets acceptance criteria. Change control governs its evolution. Audit trails make every interaction inspectable. And investigators remain fully accountable for every decision.

The questions to answer first

Every organization's path is different, and early decisions shape everything that follows:

  • How should GenAI fit into your existing quality management system and CSV/CSA procedures?
  • What evidence will your quality unit and inspectors expect to see?
  • Which use cases are appropriate now, and which should wait?
  • How do you build AI literacy across quality, IT and the business?

These are the conversations we have with quality and digital leaders every day. Learn more about our Quality & Compliance capabilities and Manufacturing solutions, or talk with our architects about governing GenAI in your regulated processes.