This is a ready-to-use SOP for the sanctioned, contained use of generative AI as a drafting and summarizing aid in deviation, CAPA, and investigation work. Replace every <<FILL: ...>> placeholder with your own specifics, set your document numbers and dates, and route it through your normal document control. The controlling rule the procedure enforces is simple: the model drafts and summarizes, a named human reviews and owns every regulated record, and no quality decision is made by the tool. A worked filled specimen follows the template. Verify each cited regulation against the current source before you rely on it. This content is educational and general; adapt it to your systems and verify it before use.
Document control header
| Field | Entry |
|---|---|
| Document title | Use of Generative AI in Deviation, CAPA, and Investigation Workflows |
| Document number | <<FILL: SOP-ID, e.g. SOP-QA-051>> |
| Version | <<FILL: version, e.g. 1.0>> |
| Effective date | <<FILL: effective date>> |
| Supersedes | <<FILL: prior version or "New">> |
| Document owner | <<FILL: role, e.g. Head of Quality Assurance>> |
| Applies to | <<FILL: sites / departments in scope>> |
1. Purpose
This procedure defines how <<FILL: COMPANY NAME>> uses a sanctioned generative AI assistant to help draft and summarize content within deviation, corrective and preventive action (CAPA), and investigation workflows, while keeping every quality decision with an accountable human. The objective is to gain the drafting productivity of the tool without letting a fluent but potentially wrong output reach a regulated record unreviewed.
2. Scope
This procedure applies to the use of the approved, contained generative AI assistant named in the system inventory (<<FILL: assistant name / ID>>) when it is used to draft or summarize content that will enter a GxP deviation, CAPA, or investigation record at the sites listed in the header. It covers deviation descriptions, root cause narrative drafting, CAPA plan drafting, and complaint and trend summarization.
It does NOT cover: any use of the model to make, approve, classify as final, or close a quality decision, which is prohibited under section 5.1; use of public or unsanctioned AI tools for GxP content, which is prohibited under section 5.7; and predictive or classification models, which are governed by <<FILL: SOP-ID for AI/ML system validation>>.
3. Responsibilities
| Role | Responsibility |
|---|---|
| Initiator / investigator | Supplies verified facts to the assistant, reviews and corrects the draft, and submits the record under their own name. |
| Investigation lead / SME | Owns the root cause determination and the adequacy of the CAPA; uses the assistant only to structure and write up, never to conclude. |
| Quality Assurance | Approves the intended-use statement and this procedure, confirms disclosure and human review occurred, and owns the meaningful-review standard. |
| System owner | Maintains the assistant configuration, guardrails, and version record; raises a vendor model change as a change-control event. |
| IT / security | Maintains access controls and the contained environment; confirms GxP content cannot leave the sanctioned tool. |
4. Definitions
- Generative AI assistant: a large-language-model tool that produces text (drafting, summarizing, rewriting, extracting) from an input you supply. Distinct from a classifier that outputs a scored label.
- Grounding: constraining the model to work only from supplied verified facts or retrieved controlled documents, not from its own training knowledge, so it cannot fill gaps with invented content.
- Confabulation: a fluent, confident, factually wrong output. The signature failure mode of a generative model and the reason human verification is mandatory.
- AI-assisted content: any text in a regulated record that a generative model drafted or materially shaped, whether or not a human later edited it.
- Meaningful review: a human reading the draft against the source facts, correcting errors, and taking ownership, as distinct from approving a polished draft without engaging with it.
5. Procedure
5.1 The permitted-use boundary
The assistant may be used to DRAFT and SUMMARIZE only. It may:
- Draft a deviation description from facts the initiator supplied.
- Structure an investigation timeline and propose candidate cause categories to broaden thinking.
- Draft a root cause narrative from the team’s own conclusions.
- Draft candidate CAPA actions and an effectiveness-check design for the team to evaluate.
- Summarize complaints, deviation histories, or trend data for human verification.
The assistant must NOT: determine a root cause, decide whether a CAPA is adequate, classify a deviation criticality as final, approve or close any record, or make any other quality decision. Every one of those remains a documented human judgment.
5.2 Grounding the task
For every use, constrain the model to the supplied facts. Provide the verified inputs and instruct the model to draft only from them and to flag anything the inputs do not support. Do not ask an open question such as “write a root cause for this deviation” that invites the model to draw on its training data. Where the platform supports retrieval that pins output to controlled documents, use it for higher-risk drafting.
5.3 Drafting a deviation description
- Capture the raw facts in the structured intake fields: free-text “what happened,” plus date, time, batch or lot, equipment or system, process step, expected condition, observed condition.
- The assistant drafts the description in the house template, in neutral factual language, without speculating on cause.
- The initiator reviews the draft against what actually happened, corrects any detail, adds anything the model could not know, and confirms no fact was invented.
- The initiator submits under their own name. The record is flagged as AI-assisted per section 5.8.
5.4 Assisting root cause analysis
- The team supplies verified facts; the assistant builds a chronological timeline, which the team checks against source records.
- The assistant proposes candidate cause categories (for example man, machine, method, material, measurement, environment) as a checklist to broaden the search, not as an answer.
- The team performs the analysis, weighing evidence for and against each candidate, and reaches the conclusion. This step is human reasoning over evidence and is never delegated.
- The assistant drafts the root cause narrative from the team’s conclusion; the team corrects and owns it.
- Any historical deviation the assistant cites for comparison is confirmed to exist and to be relevant before it is used.
5.5 Drafting a CAPA
- The team provides the confirmed root cause and affected process.
- The assistant drafts candidate corrective and preventive actions, distinguishing the two, plus a draft effectiveness-check design.
- The team evaluates each action for adequacy: does it trace to the confirmed root cause, is it feasible, is it proportionate to risk. Generic reflex actions unconnected to the cause (for example blanket retraining where no training gap exists) are rejected.
- The team assigns real owners and realistic dates and approves the CAPA under their names. The draft is a starting point, never the plan of record.
5.6 Summarizing complaints and trends
- Provide the assistant the relevant records from the validated source system.
- Request a structured summary with each claim tied back to its source records.
- The reviewer verifies every quantitative claim (counts, percentages, trend direction) against the source or by a deterministic query, because language models miscount. Where an exact count matters, compute it deterministically and have the model narrate the verified number.
- The reviewer confirms nothing material was silently dropped for exceeding a context window, then uses the verified summary to support, not replace, the trend and signal judgment.
5.7 Prohibited tools and data handling
GxP content must only be entered into the sanctioned, contained assistant named in section 2. Entering deviation facts, complaint text, batch data, or any GxP or confidential content into a public or consumer AI tool is prohibited and is treated as a data-integrity and confidentiality event under <<FILL: SOP-ID for data integrity events>>. The input you supply is GxP data and must come from a validated source with its own integrity intact.
5.8 Disclosure, verification, and ownership
- Every regulated record produced with AI assistance is flagged as AI-assisted in the audit trail, with the reviewer identity and the edits captured.
- The named human is recorded as the author and owner; the tool is never the author.
- Every fact and every number the model produced is verified against the source before the record is finalized.
- Where feasible, the model version and the prompt or template version used are recorded on the AI-assistance disclosure and review log (
<<FILL: log ID>>), so the conditions of generation are reconstructable.
5.9 Change control for the assistant
A change to the model version, the prompts, the templates, or the guardrails is a change-control event under <<FILL: SOP-ID for change control>>. Treat a vendor-driven model update as a change even when you took no action, because output behavior can shift without a version bump on your side, and re-confirm the guardrails hold before the changed assistant is used for GxP content.
6. Acceptance criteria
A use of the assistant is acceptable when all of the following are true:
- The use stayed within the permitted drafting and summarizing boundary; no quality decision was made by the tool.
- The task was grounded in supplied verified facts, and no fact or number in the final record is unverified.
- A named human reviewed, corrected where needed, and is recorded as the author and owner of the record.
- The record is flagged as AI-assisted, with reviewer identity and edits captured.
- GxP content was entered only into the sanctioned contained tool.
7. Records generated
- The regulated deviation, CAPA, or investigation record, flagged AI-assisted.
- The AI-assistance disclosure and human-review log entry (
<<FILL: log ID>>). - Change-control records for any assistant, prompt, template, or model-version change.
8. References
21 CFR Part 11 (electronic records and signatures; attributability of records to a responsible person). EU GMP Annex 11 (computerised systems). ICH Q10, Pharmaceutical Quality System (management accountability for quality outcomes). ICH Q9(R1), Quality Risk Management (risk-based assurance). FDA guidance, Data Integrity and Compliance With Drug CGMP: Questions and Answers (2018). GAMP 5 (Second Edition) and the FDA Computer Software Assurance approach, for sizing assurance to intended use and risk (reference by title; do not reproduce their text).
Confirm the current version of each reference before issue.
9. Revision history
| Version | Date | Author | Summary of change |
|---|---|---|---|
<<FILL: 1.0>> | <<FILL: date>> | <<FILL: author>> | Initial issue. |
10. Approvals
| Role | Name | Signature | Date |
|---|---|---|---|
| Author | <<FILL>> | ||
| Reviewer (QA) | <<FILL>> | ||
| Approver (Quality Head) | <<FILL>> |
Filled specimen
The following shows how the disclosure fields read for one completed use, so you can see the level of detail expected. Company, system, and numbers are illustrative; replace them with your own.
| Field | Entry |
|---|---|
| Workflow | Deviation description drafting |
| Record ID | DEV-2026-0417 |
| Assistant / version | Contained quality assistant, model build 2026-06 (pinned) |
| Grounding | Drafted only from the initiator’s intake facts; open-web knowledge disabled |
| What the model produced | Draft deviation description of a tablet-press stop |
| Human review and edits | Initiator corrected stop duration from 20 to 22 minutes against the equipment log; confirmed segregation occurred; no invented facts |
| Facts / numbers verified | Yes, against equipment log and batch record |
| Recorded author / owner | A. Patel, initiator, signed 2026-06-08 |
| AI-assistance flag in record | Yes |
In this example the model drafted a clean description in the house format from the operator’s hurried notes, the initiator caught one wrong number and confirmed the physical facts, and the submitted record is attributed to the initiator with the AI assistance disclosed. The model saved writing time; the human owned every fact.
Common inspection findings this SOP prevents
- Generative AI in use in quality workflows that was never assessed, disclosed, or covered by procedure, discovered by the investigator rather than declared.
- A root cause or CAPA effectively produced by the model and approved without human evidence-weighing.
- An AI-generated count or percentage placed in a trend report without verification against the source.
- Staff pasting confidential deviation or complaint content into a public chatbot.
- No record of which model version or prompt produced a given draft, so the basis cannot be reconstructed.
How to adapt this SOP
- Set your document number, owner, and effective date in the header, and name your specific sanctioned assistant in section 2.
- Point the cross-references in sections 5.7 and 5.9 to your real data-integrity-event and change-control procedures.
- If you use retrieval-augmented generation, name the controlled corpus and its version control in section 5.2.
- Align the disclosure fields in section 5.8 with what your audit trail can actually capture, and reference your AI-assistance log.
- Confirm every regulation in section 8 against the current published version before issue.