From raw material qualification to patient delivery: cryptographic phase gates for a pharmaceutical batch. Seven phases, two namespaces, one Merkle root that the manufacturer, the Qualified Person, and the FDA inspector all verify independently.
Who this is for: Pharmaceutical manufacturers using AI in quality control, process analytical technology (PAT), or predictive maintenance; Quality Assurance and Quality Control teams; Qualified Persons (EU) responsible for batch certification; FDA investigators conducting GMP inspections; regulatory affairs teams preparing for PAI (Pre-Approval Inspection); supply chain and cold chain logistics teams; and serialization/track-and-trace compliance officers.
SWT3 is an industry-agnostic cryptographic witness protocol. The evidence described in this guide is identical regardless of dosage form, therapeutic area, or manufacturing scale. This guide maps that universal evidence to FDA, EU GMP, and ICH requirements so manufacturers and inspectors can verify compliance using independently verifiable cryptographic proof.
What SWT3 does and does not do. SWT3 witnesses evidence that the manufacturer produces. It records that an in-process control test was conducted, what results were measured, and when. It does not evaluate whether the batch meets release specifications. It does not determine whether a deviation is critical or minor. It does not replace the Qualified Person's professional judgment, the QA reviewer's assessment, or the FDA inspector's observations. The manufacturer generates the evidence. The assessor interprets it. SWT3 provides the cryptographic chain that connects them. The witness is not the judge.
A pharmaceutical batch moves through dozens of manufacturing steps, each with its own quality controls, environmental monitoring requirements, and documentation obligations. A single batch of injectable biologics may generate 500+ individual test results across raw material qualification, in-process controls, environmental monitoring, fill-finish operations, visual inspection, stability testing, and final release testing. Every result must be recorded, reviewed, and approved before the batch can be released to patients.
The stakes are not abstract. A contaminated batch of injectable medication can cause sepsis, organ failure, and death. The 2012 New England Compounding Center (NECC) meningitis outbreak killed 76 people and sickened 753, traced to fungal contamination in compounded steroid injections. The 2008 heparin contamination event killed 81 people in the US alone, traced to a deliberately adulterated raw material in the Chinese supply chain. In both cases, the forensic investigation revealed gaps in the evidence chain: tests that were recorded but not actually performed, environmental monitoring data that was fabricated, and batch records that were reconstructed after the fact.
Today, pharmaceutical manufacturing evidence is migrating from paper batch records to electronic batch records (EBR), but the fundamental integrity problem remains. An electronic record in a manufacturing execution system (MES) can be altered, backdated, or deleted. FDA 21 CFR Part 11 requires audit trails for electronic records, but audit trails record who changed a record, not whether the original measurement was genuine. When an FDA investigator asks "was this in-process pH measurement actually taken at the time recorded, or was it entered three hours later from a handwritten note?" the audit trail cannot answer that question. A cryptographic witness anchor can.
Pharmaceutical manufacturing has a unique evidence integrity requirement: the evidence must prove not just that a test passed, but that the test was actually performed at the recorded time with the recorded equipment on the recorded batch. A witness anchor that captures the measurement value, the equipment identifier, the batch number, and the timestamp at the moment of measurement creates evidence that cannot be fabricated after the fact. The Merkle tree links every measurement in the batch to every other measurement, so altering one record invalidates the entire batch evidence chain. This is the difference between an audit trail (who changed what) and a witness chain (what actually happened).
The product is a monoclonal antibody therapeutic manufactured at a contract development and manufacturing organization (CDMO). The drug substance is received from the sponsor's upstream facility, then formulated, sterile-filtered, filled into pre-filled syringes, inspected, labeled, packaged, and shipped under cold chain conditions (2-8C). Annual production: 200 batches. Each batch: 50,000 pre-filled syringes.
The CDMO uses AI in three places: (1) visual inspection of filled syringes using computer vision to detect particulates, cracks, and fill volume anomalies, (2) environmental monitoring trend analysis to predict excursions before they occur, and (3) predictive maintenance on the filling line to prevent unplanned stops during aseptic operations.
| Role | Party | Primary Interest |
|---|---|---|
| CDMO | Contract manufacturer | GMP compliance, batch yield, client satisfaction, inspection readiness |
| Sponsor | Pharma company (MAH) | Product quality, supply continuity, regulatory filings reference the CDMO's data |
| Qualified Person (EU) | QP at release site | Batch certification per EU GMP Annex 16; personal liability for released batches |
| QA Reviewer | CDMO quality assurance | Batch record review, deviation assessment, release recommendation |
| QC Lab | CDMO quality control | Analytical testing, stability studies, OOS investigation |
| FDA Inspector | FDA ORA investigator | GMP compliance during PAI or routine inspection, data integrity, 483 observations |
| EU Inspector | National competent authority | GMP compliance, Annex 11 computerized systems, Annex 1 sterile manufacturing |
| Cold Chain Logistics | Specialty pharma distributor | Temperature maintenance 2-8C from release through delivery |
Assessor Note
Biologics fill-finish is classified as aseptic manufacturing, which carries the highest GMP scrutiny. EU GMP Annex 1 (revised 2023, effective August 2023) significantly expanded requirements for contamination control strategy, environmental monitoring, and process simulation (media fills). FDA's guidance on aseptic processing (2004, with periodic updates) sets parallel requirements. The phase gate structure in this guide aligns with both regulatory frameworks. Verify which GMP standard applies based on the manufacturing site's jurisdiction and the target market for the finished product.
The batch lifecycle follows seven phases from raw material receipt to patient delivery. Each phase must gate-clear before the next begins. Raw materials cannot enter formulation before qualification is complete. The filling line cannot start before environmental monitoring confirms the cleanroom meets Grade A/B conditions. The batch cannot be released before all test results are reviewed and all deviations are closed. The cryptography enforces what the batch record promises.
| Phase | Duration | Key Activities | Gate Criteria |
|---|---|---|---|
| 1. Raw Material Qualification | 1-5 days | Incoming material identity test, CoA verification, supplier qualification, sampling | All raw materials pass identity test, CoA matches specification, supplier qualification current |
| 2. Formulation & Compounding | 1-2 days | Buffer preparation, drug substance thaw and pooling, excipient addition, pH adjustment, concentration adjustment | In-process controls within specification (pH, concentration, osmolality), equipment clean and qualified |
| 3. Sterile Filtration & Fill | 1-3 days | Pre-filtration bioburden test, pre-use filter integrity test, sterile filtration, aseptic filling, post-use filter integrity test, in-process weight checks | Bioburden within pre-filtration limits, filter integrity tests pass, fill weights within specification, environmental monitoring Grade A/B compliant, line interventions documented |
| 4. Visual Inspection & CCI | 2-5 days | 100% automated inspection (AI vision), manual inspection of rejects, AQL sampling, container closure integrity (CCI) testing of plunger/barrel seal | Reject rate within historical norms, AI classification accuracy verified against manual inspection subset, no critical defects in AQL sample, CCI test passed |
| 5. QC Testing & Stability | 5-30 days | Release testing (potency, purity, sterility, endotoxin, particulates), stability pull and test | All release tests within specification, sterility test negative (14-day incubation), stability on trend |
| 6. Batch Review & Release | 3-10 days | QA batch record review, deviation closure, OOS resolution, QP certification (EU), batch disposition | All deviations closed or risk-assessed, all OOS investigated and resolved, QP satisfied (EU), batch disposition: RELEASED |
| 7. Cold Chain Distribution | Ongoing | Temperature-controlled storage, shipment, last-mile delivery, temperature excursion management | Continuous temperature within 2-8C, no unresolved excursions, serialization data uploaded to DSCSA system |
Qualified Person Note
Under EU GMP Annex 16, the QP bears personal legal liability for every batch they certify. The QP must verify that the batch was manufactured and controlled in accordance with the marketing authorization, GMP, and any other relevant legal obligations. The phase gate structure gives the QP a structured evidence chain to review: each gate represents a GMP checkpoint, and the QP can verify that every gate opened with passing evidence before signing the batch certificate. A batch where Phase 3 (filling) proceeded before Phase 1 (raw material) gate-cleared is a GMP deviation that should be visible in the tree and must be assessed before certification.
A pharmaceutical batch touches two SWT3 namespaces. The HCF (Healthcare) namespace addresses clinical and patient safety requirements. The AI namespace covers model governance for the AI systems used in quality control, environmental monitoring, and predictive maintenance.
| Procedure | What It Witnesses | Pharma Application |
|---|---|---|
| AI-MDL.1 | Model weight integrity | Visual inspection AI model version matches validated version; predictive maintenance model hash verified |
| AI-MDL.2 | Model version tracking | Version lineage for inspection model: which version was active during each batch's inspection |
| AI-PERF.1 | Performance metrics | Visual inspection: sensitivity (defect detection rate), specificity (false reject rate), AQL correlation |
| AI-DRIFT.1 | Drift detection | Inspection model performance shift over time: increasing false reject rate may indicate camera degradation or model drift |
| AI-DRIFT.2 | Consequence-mapped thresholds | A missed crack (false negative) is a patient safety event; a false reject is a yield loss. Different thresholds for each direction |
| AI-DATA.1 | Data lineage | Training data for visual inspection model: which batches' images were used, labeling protocol, defect taxonomy |
| AI-DATA.2 | Data quality assurance | Image quality standards for training data, labeling inter-rater agreement, class balance across defect types |
| AI-HITL.1 | Human oversight records | Manual inspection rate on AI-flagged rejects; human review of AI "accept" subset (AQL sampling) |
| AI-HITL.3 | Decision override logging | When a human inspector overrides the AI classification (accepts a reject or rejects an accept) |
| AI-SAFE.1 | Safety guardrails | Fallback: if AI inspection system fails, 100% manual inspection activates; no syringes bypass inspection |
| AI-GOV.1 | Risk management scope | Computer system validation (CSV) scope for AI systems per GAMP 5 / EU GMP Annex 11 |
| AI-GOV.2 | Risk register | Identified risks: model misclassification, camera failure, lighting variation, syringe geometry changes |
| AI-AUDIT.1 | Assessment objective completion | Traceability of each GMP requirement to its evidence in the batch record |
| AI-INCIDENT.1 | Adverse event logging | Batch deviations, OOS results, field complaints linked to specific batch and model version |
| AI-REV.1 | Model revocation | Inspection model retirement: replaced by new version, old version deactivated, affected batch range documented |
| AI-CHAIN.1 | Lifecycle chain linking | Links raw material evidence to formulation to filling to inspection to release in one verifiable chain |
| AI-SBOM.1 | Software bill of materials | Third-party libraries in AI inspection system, MES integration components, LIMS interfaces |
| Procedure | What It Witnesses | Pharma Application |
|---|---|---|
| HCF-DX.1 | Diagnostic accountability | AI visual inspection: defect classification confidence vs. acceptance threshold per defect type |
| HCF-RX.1 | Prescription safety | Label verification: correct product, strength, lot, expiry on every syringe (serialization check) |
| HCF-PRIV.1 | PHI access audit | Patient-level data access controls for clinical trial material or named-patient supply |
| Procedure | What It Witnesses | Pharma Application |
|---|---|---|
| HBOM-THERM.1 | Thermal profile | Cleanroom temperature, cold room temperature, cold chain shipping temperature (2-8C continuous) |
| HBOM-INV.1 | Hardware inventory | Equipment qualification status: filling machine, lyophilizer, autoclave, HVAC, monitoring sensors |
| HBOM-LIFE.1 | Component lifecycle | Equipment calibration dates, preventive maintenance records, requalification schedules |
| Framework | Scope | Key Requirements | SWT3 Evidence |
|---|---|---|---|
| FDA 21 CFR 211 | US cGMP for finished pharmaceuticals | Batch records, in-process controls, testing, stability, annual review | All phase milestones, AI-AUDIT.1, HBOM-THERM.1 |
| FDA 21 CFR Part 11 | Electronic records, electronic signatures | Audit trails, access controls, record integrity | AI-ACC.1, AI-AUDIT.1, Merkle integrity (cryptographic audit trail) |
| EU GMP Annex 1 | Sterile manufacturing | Contamination control, environmental monitoring, media fills, process simulation | HBOM-THERM.1, HBOM-LIFE.1 (media fill), AI-INCIDENT.1 (excursions) |
| EU GMP Annex 11 | Computerized systems | System validation, data integrity, access control, change management | AI-MDL.1 (validation), AI-GOV.1 (CSV scope), AI-ACC.1 |
| EU GMP Annex 16 | QP batch certification | QP review, deviation closure, batch disposition | Phase 6 gate (QP review checklist), AI-INCIDENT.1 (deviation status) |
| ICH Q10 | Pharmaceutical quality system | Knowledge management, continual improvement, management review | AI-AUDIT.1 (traceability), AI-DRIFT.1 (trending), APR/PQR evidence |
| ICH Q1A | Stability testing | Study design, storage conditions, testing intervals | Phase 5 ongoing stability milestones, HBOM-THERM.1 (storage conditions) |
| DSCSA | US drug supply chain security | Serialization, verification, tracing | HCF-RX.1 (serialization event), AI-CHAIN.1 (batch linkage) |
| EU FMD | Falsified medicines | Unique identifier, anti-tampering | HCF-RX.1 (serialization), same evidence chain as DSCSA |
| EU/WHO GDP | Good distribution practice | Temperature control, traceability, transportation qualification | HBOM-THERM.1 (cold chain), Phase 7 milestones |
Every pharmaceutical batch is already a chain of dependent events: raw materials feed formulation, formulation feeds filling, filling feeds inspection, inspection feeds release. The Merkle tree makes this chain cryptographic. When the QP reviews the batch for release, they verify one root hash. That hash encodes every measurement, every test result, every deviation, and every approval in the batch. If any single data point was altered after recording, the root hash changes and the tampering is detectable. This is the evidence integrity that 21 CFR Part 11 audit trails aspire to but cannot cryptographically guarantee.
The batch Merkle tree has three tiers: batch root, phase roots, and milestone leaves. Each quality test, environmental reading, or manufacturing event becomes a leaf. The batch root hash is the single value that the QP verifies at release.
Batch Root: "BATCH-MAB-2026-0847"
|
+-- Phase 1: Raw Material Qualification [GATE_OPEN]
| +-- MS: Drug Substance ID Test (AI-AUDIT.1 PASS, CoA verified)
| +-- MS: Excipient Release (AI-AUDIT.1 PASS, 4 excipients)
| +-- MS: Supplier Qualification (AI-AUDIT.1 PASS, annual review current)
|
+-- Phase 2: Formulation & Compounding [GATE_OPEN]
| +-- MS: Buffer Preparation (AI-AUDIT.1 PASS, pH 6.2)
| +-- MS: Drug Substance Pooling (AI-AUDIT.1 PASS, concentration 25mg/mL)
| +-- MS: Final Formulation (AI-AUDIT.1 PASS, osmolality 290 mOsm)
|
+-- Phase 3: Sterile Filtration & Fill [GATE_OPEN]
| +-- MS: Pre-Use Filter Integrity (AI-AUDIT.1 PASS, bubble point 52 psi)
| +-- MS: Environmental Monitoring (HBOM-THERM.1 PASS, Grade A < 1 CFU)
| +-- MS: Fill Weight Check (AI-AUDIT.1 PASS, 1.02 mL +/- 0.03)
| +-- MS: Post-Use Filter Integrity (AI-AUDIT.1 PASS, bubble point 51 psi)
|
+-- Phase 4: Visual Inspection [GATE_BLOCKED]
| +-- MS: AI Inspection Complete (HCF-DX.1 PASS, 49,847 accept, 153 reject)
| +-- MS: Manual Review of Rejects (AI-HITL.1 ... in progress)
| +-- MS: AQL Sampling (pending)
|
+-- Phase 5: QC Testing & Stability [locked]
+-- Phase 6: Batch Review & Release [locked]
+-- Phase 7: Cold Chain Distribution [locked]
Batch MAB-2026-0847 mid-manufacturing: Fill complete, visual inspection in progress. Manual reject review blocking the gate.
Assessor Note: Filter Integrity as a Critical Gate
Sterile filtration is the last step that removes bioburden before the product enters the aseptic filling environment. Both pre-use and post-use filter integrity tests are critical: a pre-use failure means the filter was damaged during installation, and a post-use failure means the filter may have failed during the filtration itself. Under EU GMP Annex 1, a post-use filter integrity test failure is a critical deviation that requires investigation and may require batch rejection. In the Merkle tree, verify that both pre-use and post-use filter integrity milestones exist and both show PASS. A batch where the post-use test is missing or shows FAIL requires immediate attention.
Before any product batch is filled on an aseptic line, the line must be validated through process simulation using growth media (a "media fill"). EU GMP Annex 1 (Section 9.33) and FDA aseptic processing guidance require media fills to demonstrate that the aseptic process can consistently produce sterile product. A media fill failure means the aseptic process is not validated, and no product batch should be released from that line until the process is revalidated.
Media fill evidence is not a per-batch milestone; it is a line qualification that applies to all batches filled on that line within the validation period (typically semi-annual). SWT3 witnesses media fill results as HBOM-LIFE.1 milestones linked to the filling equipment. Each production batch in Phase 3 references the most recent media fill for the line it was filled on. If the media fill is overdue or failed, the Phase 3 gate for any batch on that line should not open.
Assessor Note: Media Fill Is the First Thing FDA Checks
During a Pre-Approval Inspection (PAI) for a sterile product, the FDA investigator will typically review media fill results before examining any production batch records. If the most recent media fill failed, or if media fills are overdue, the investigator may issue a 483 observation before even looking at the product. When reviewing the Merkle tree, verify that the HBOM-LIFE.1 media fill milestone for the filling line is current (within the declared validation interval) and shows PASS. A production batch tree that references an expired or failed media fill is a critical finding.
Between batches (and between products on shared equipment), the manufacturing line must be cleaned per a validated cleaning procedure. Cleaning validation demonstrates that residual product, cleaning agents, and bioburden are reduced to acceptable levels. Inadequate cleaning can cause cross-contamination between batches, which is a GMP failure with patient safety implications.
SWT3 witnesses cleaning events as HBOM-LIFE.1 milestones. The cleaning milestone captures: the equipment identifier, the cleaning procedure used, the verification method (rinse sample, swab test, TOC), and the result. This milestone is a prerequisite for the Phase 2 (Formulation) or Phase 3 (Fill) gate: the equipment must show a clean status before the next batch begins.
The visual inspection of filled syringes is the most common application of AI in pharmaceutical manufacturing today. At 300+ syringes per minute on a modern filling line, manual 100% inspection is impractical. AI vision systems classify each syringe as accept or reject based on particulate detection, fill volume verification, stopper position, crack detection, and cosmetic defect identification.
Unlike a traditional AI deployment where the model can be updated continuously, a pharmaceutical AI system must be validated under a computer system validation (CSV) framework before use in GMP manufacturing. EU GMP Annex 11 requires that computerized systems used in GMP operations be validated to demonstrate that they are fit for purpose. GAMP 5 (Good Automated Manufacturing Practice) provides the risk-based framework for this validation.
SWT3 witnesses the AI validation as a prerequisite to the visual inspection phase. The model cannot be used in production inspection until the validation evidence is anchored:
# Validate AI inspection model before production use
from swt3_ai import Witness
witness = Witness(
endpoint="https://sovereign.tenova.io",
api_key="axm_live_...",
tenant_id="BATCH-MAB-2026-0847"
)
# Witness model validation (CSV/GAMP 5)
witness.witness_milestone(
structure_id="BATCH-MAB-2026-0847",
phase="visual-inspection",
milestone="ai-model-validation",
procedure="AI-MDL.1",
factor_a="inspection_model_v3.2.1",
factor_b="hash_a7f3c2e1", # model weight hash
factor_c="CSV_IQ_OQ_PQ_complete" # validation status
)
# Witness inspection results
witness.witness_milestone(
structure_id="BATCH-MAB-2026-0847",
phase="visual-inspection",
milestone="ai-inspection-complete",
procedure="HCF-DX.1",
factor_a="visual_inspection_batch_0847",
factor_b="49847_accept_153_reject", # classification results
factor_c="reject_rate_0.31pct" # within historical norm 0.2-0.5%
)
QA Note: Reject Rate Trending
The AI inspection reject rate is a critical process indicator. A sudden increase in reject rate may indicate: (1) a genuine quality problem in the filling process (stopper misplacement, particulate contamination), (2) model drift causing increased false positives (camera degradation, lighting change), or (3) a change in syringe supplier that introduced cosmetic variations the model was not trained on. AI-DRIFT.1 witnesses the reject rate trend over time. When the reject rate exceeds historical norms, the Phase 4 gate should block until the root cause is investigated. The Merkle tree makes the investigation traceable: the reject rate spike is linked to the specific batch, the specific model version, and the specific filling run.
Regulatory expectation for AI visual inspection includes a human verification component. AI-flagged rejects must be manually reviewed by trained inspectors to confirm the classification. Additionally, an AQL (Acceptable Quality Level) sample from the AI-accepted population must be manually inspected to verify that the AI is not missing defects.
AI-HITL.1 witnesses the human review rate and AI-HITL.3 captures overrides. A healthy pattern shows the manual inspector confirming most AI rejections (true positive rate > 85%) and finding very few defects in the AQL sample from AI-accepted syringes (false negative rate < 0.1%).
Assessor Note: AI as GMP Equipment
Under current GMP interpretation, an AI visual inspection system is treated as automated inspection equipment, not as a decision-making system. The AI classifies; the QA team dispositions the batch. This distinction matters for validation scope: the AI system requires IQ/OQ/PQ (installation, operational, performance qualification) like any other piece of GMP equipment, plus ongoing performance monitoring. If the manufacturer claims the AI is making release decisions autonomously (no human review of accepts), that is a different regulatory profile that requires additional justification and may trigger questions during FDA inspection. Verify the human oversight design before assessing the evidence chain.
Deviations are a normal part of pharmaceutical manufacturing. A temperature excursion during compounding, an unexpected particulate count during environmental monitoring, a fill weight that drifts toward the specification limit: these are events that require investigation, risk assessment, and corrective action. The question is not whether deviations occur, but whether they are detected, documented, investigated, and resolved before the batch is released.
SWT3 witnesses deviations as AI-INCIDENT.1 leaves within the phase where they occurred. The deviation leaf captures: the event description, the classification (critical, major, minor), the affected phase and milestone, and the investigation status. This creates a permanent record that the deviation existed and was acknowledged at the time it occurred, not documented retrospectively.
# Deviation: Environmental monitoring excursion during fill
witness.witness_milestone(
structure_id="BATCH-MAB-2026-0847",
phase="sterile-fill",
milestone="deviation-em-excursion-grade-b",
procedure="AI-INCIDENT.1",
factor_a="em_excursion_settle_plate_b7",
factor_b="3_cfu_grade_b_limit_5_cfu", # within limit but elevated
factor_c="classification_minor_investigation_open"
)
# CAPA: Root cause identified, corrective action taken
witness.witness_milestone(
structure_id="BATCH-MAB-2026-0847",
phase="sterile-fill",
milestone="capa-em-excursion-resolved",
procedure="AI-INCIDENT.1",
factor_a="root_cause_gown_breach_operator_12",
factor_b="corrective_regowning_retraining",
factor_c="classification_minor_resolved_no_batch_impact"
)
Qualified Person Note: Deviation Closure Before Release
EU GMP Annex 16 requires that all deviations affecting a batch are investigated and their impact assessed before QP certification. The Merkle tree makes this verification mechanical: query Phase 6 (Batch Review) for all AI-INCIDENT.1 leaves across Phases 1-5. Every deviation should have a corresponding resolution leaf. If any deviation remains in "investigation_open" status when the QP reviews the batch, that is a hold point. The QP cannot certify a batch with unresolved deviations unless a documented risk assessment justifies release. That risk assessment, if performed, should itself be a witnessed milestone in Phase 6.
An OOS result during release testing (Phase 5) triggers a mandatory investigation per FDA guidance (2006, updated 2022). The investigation must determine whether the OOS is due to laboratory error, process error, or a genuine product quality problem. SWT3 witnesses the OOS event, the investigation phases (Phase I laboratory investigation, Phase II manufacturing investigation), and the final determination.
Assessor Note: OOS Investigation Integrity
During an FDA inspection, OOS investigation integrity is one of the most scrutinized areas. The investigator will verify that the original OOS result was recorded (not discarded), that the investigation followed the firm's SOP, and that any retest or resample was justified. The Merkle tree provides this evidence chain: the original OOS (AI-INCIDENT.1 leaf in Phase 5), the investigation milestones (Phase I/II leaves), and the final determination. If the original OOS leaf is missing from the tree but a passing retest result exists, that is a data integrity finding. The cryptographic chain makes "testing into compliance" (repeating the test until it passes, then discarding the failures) detectable.
The stability data point at release (Phase 5) is just the beginning. ICH Q1A requires ongoing stability studies at predetermined intervals (typically 3, 6, 9, 12, 18, 24, and 36 months). Each stability pull generates new analytical data that may reveal degradation trends not visible at release. If a stability result falls out of specification after the batch was already released and distributed, the manufacturer must evaluate whether a field action (recall or market withdrawal) is necessary.
SWT3 witnesses ongoing stability results as Phase 5 milestones that continue to accumulate after Phase 6 (release). The batch tree is not frozen at release; it continues to grow as stability data accrues. If a 12-month stability result shows out-of-trend degradation, the AI-INCIDENT.1 leaf in Phase 5 is linked to the same batch root that the QP certified at release. This creates an unbroken evidence chain from the original release decision through the stability signal that may require the release decision to be revisited.
Qualified Person Note: Post-Release Stability Signals
A QP who certified a batch at release may need to reassess that decision if subsequent stability data reveals a problem. The Merkle tree makes this reassessment traceable: the original release certification (Phase 6) is linked to the stability results that prompted the reassessment, and any field action decision is recorded as a new Phase 6 milestone. The QP's original certification is not invalidated; it remains in the tree as evidence of what was known at the time. The subsequent action is a new leaf that reflects updated knowledge.
Biologics require continuous temperature control from manufacturing through patient administration. The 2-8C cold chain is not a suggestion; it is a specification. A temperature excursion above 8C or below 2C triggers an investigation and may render the product unusable. For some biologics, even a brief freeze excursion causes irreversible protein aggregation that makes the product unsafe.
HBOM-THERM.1 witnesses temperature continuously throughout Phase 7 (Distribution). Each temperature reading becomes a leaf in the Merkle tree, creating a continuous, tamper-evident thermal record from release through delivery.
| Stage | Duration | Temperature Requirement | SWT3 Evidence |
|---|---|---|---|
| Warehouse storage | Days to months | 2-8C, monitored at 15-min intervals | HBOM-THERM.1 (continuous), HBOM-INV.1 (storage location) |
| Shipping | 24-72 hours | 2-8C, qualified shipper validated for duration | HBOM-THERM.1 (in-transit logger), AI-CHAIN.1 (links to batch) |
| Last-mile delivery | 2-8 hours | 2-8C, cold chain handoff documented | HBOM-THERM.1 (delivery confirmation), HCF-RX.1 (product identity at receipt) |
Traditional cold chain monitoring produces a temperature log. The log is downloaded from the data logger at delivery and reviewed retrospectively. If an excursion occurred during transit, the product may have already been administered to patients before the log is reviewed. With SWT3, the temperature evidence is witnessed in real time. An excursion triggers an AI-INCIDENT.1 leaf immediately, and the Phase 7 gate blocks until the excursion is investigated and dispositioned. The product does not advance to patient use until the cold chain evidence is complete and clean. The logger is no longer a retrospective record; it is a real-time gate.
Assessor Note: GDP and Serialization Linkage
EU GDP (Good Distribution Practice) and WHO GDP guidelines require documented temperature control throughout distribution. The Merkle tree links the cold chain evidence (Phase 7) to the batch release evidence (Phase 6) to the manufacturing evidence (Phases 1-5). An inspector can trace a temperature excursion report all the way back to the specific filling run, the specific raw material lot, and the specific environmental monitoring data from the manufacturing date. This end-to-end traceability is what GDP aspires to but rarely achieves with paper-based or siloed electronic systems.
In the EU, the Qualified Person (QP) is the named individual who certifies that each batch was manufactured and controlled in accordance with the marketing authorization, GMP, and applicable legal requirements. The QP bears personal legal liability. This is not a rubber stamp; it is a professional certification with criminal liability in most EU member states.
For a QP reviewing SWT3 evidence for batch certification, verify these seven items:
Qualified Person Note: Remote QP Release
EU GMP Annex 16 permits QP certification at a site different from the manufacturing site, provided the QP has access to all relevant batch documentation. The Merkle tree enables this: the QP at the release site verifies the same root hash that the manufacturing site produced. The evidence is not a copy of the batch record shipped between sites; it is a cryptographic proof that the QP can verify independently. This strengthens the remote release model by eliminating the risk of documentation being altered or incomplete during transfer between CDMO and release site.
FDA requires Annual Product Reviews (21 CFR 211.180(e)) and EU GMP requires Product Quality Reviews (PQR). These aggregate batch-level data across all batches manufactured in a review period: yield trends, deviation frequency, OOS rates, complaint patterns, and stability results. The PQR is a cross-batch governance layer that sits above individual batch trees.
SWT3 provides the per-batch evidence that feeds into the APR/PQR. Each batch tree contributes its data to the annual review. The APR/PQR itself is not a phase within a single batch tree; it is a separate governance event that references multiple batch trees. This distinction matters: the APR/PQR may identify trends (increasing reject rates across 20 batches, rising deviation frequency) that are not visible in any single batch tree. The aggregate analysis is the manufacturer's responsibility; SWT3 provides the cryptographic integrity of the per-batch inputs.
Assessor Note: APR/PQR Data Integrity
When an FDA investigator reviews the APR, they may trace specific data points back to their source batch records. If the APR claims an average yield of 97% across 200 batches, the investigator may select 5 batches at random and verify the yield from the batch records. The Merkle tree makes this spot-check mechanical: each batch tree contains the yield data as a witnessed milestone. If the APR's aggregate differs from the sum of the individual batch trees, that discrepancy is a data integrity finding.
When a batch is manufactured outside the EU (e.g., at a US CDMO) and imported for EU distribution, the QP at the EU import site must verify that the manufacturing site has been inspected by an EU authority or by a Mutual Recognition Agreement (MRA) partner's authority. The QP must also verify that the manufacturing complied with EU GMP standards, which may differ from the manufacturing country's GMP requirements in specific areas.
For remote QP release of imported batches, the Merkle tree provides the manufacturing evidence chain produced at the CDMO. The QP can verify the phase gate evidence independently, but must also confirm the regulatory prerequisites (site GMP certificate, MRA status) that are outside the scope of the batch tree. The batch tree proves what happened during manufacturing; the QP must separately verify that the site was authorized to manufacture for the EU market.
The Drug Supply Chain Security Act (DSCSA, fully effective November 2023 with ongoing enforcement milestones) requires pharmaceutical manufacturers to serialize each saleable unit with a unique product identifier (NDC, serial number, lot, expiry) and to participate in an interoperable electronic system for verification and tracing.
HCF-RX.1 witnesses the serialization event: each syringe receives its unique identifier during labeling (Phase 4/5 boundary), and the serialization data is uploaded to the manufacturer's serialization repository. The Merkle tree links the serialization event to the specific batch, the specific filling run, and the full manufacturing evidence chain.
The EU Falsified Medicines Directive (FMD, 2011/62/EU) requires a unique identifier and anti-tampering device on every prescription medicine package. The European Medicines Verification System (EMVS) provides the verification infrastructure. The same SWT3 evidence chain that supports DSCSA tracing also supports FMD verification: one batch, one tree, two regulatory systems.
Assessor Note: Serialization Data Integrity
DSCSA requires that serialization data be "accurate, complete, and maintained." The Merkle tree provides a cryptographic guarantee that the serialization data recorded at the time of labeling has not been modified. If an FDA investigator asks "was this serial number assigned to this lot at the time of manufacturing, or was it reassigned later?" the witness chain answers definitively. The serialization leaf is linked to the batch root; altering the serial number assignment would invalidate the batch evidence chain.
Define the batch structure at the start of manufacturing. The structure persists for the entire batch lifecycle, from raw material receipt through patient delivery.
from swt3_ai import Witness
witness = Witness(
endpoint="https://sovereign.tenova.io",
api_key="axm_live_...",
tenant_id="BATCH-MAB-2026-0847"
)
# Define the 7-phase batch structure
witness.create_milestone_structure(
structure_id="BATCH-MAB-2026-0847",
phases=[
{"id": "raw-material", "seq": 0, "name": "Raw Material Qualification"},
{"id": "formulation", "seq": 1, "name": "Formulation & Compounding"},
{"id": "sterile-fill", "seq": 2, "name": "Sterile Filtration & Fill"},
{"id": "visual-inspection", "seq": 3, "name": "Visual Inspection"},
{"id": "qc-testing", "seq": 4, "name": "QC Testing & Stability"},
{"id": "batch-release", "seq": 5, "name": "Batch Review & Release"},
{"id": "cold-chain", "seq": 6, "name": "Cold Chain Distribution"},
]
)
# Phase 1: Witness raw material identity test
witness.witness_milestone(
structure_id="BATCH-MAB-2026-0847",
phase="raw-material",
milestone="drug-substance-identity",
procedure="AI-AUDIT.1",
factor_a="ds_identity_nir_spectroscopy",
factor_b="PASS_match_reference_spectrum",
factor_c="coa_lot_DS20260312_verified"
)
# Phase 3: Witness environmental monitoring during fill
witness.witness_hardware(
procedure="HBOM-THERM.1",
factor_a="grade_a_filling_zone_em",
factor_b="0_cfu_settle_plate_4hr", # Grade A limit: < 1 CFU
factor_c="PASS_annex1_compliant"
)
# Check the Phase 1 gate
gate = witness.check_gate(
structure_id="BATCH-MAB-2026-0847",
phase="raw-material"
)
print(gate)
# {"status": "GATE_OPEN", "phase": "raw-material",
# "milestones_passed": 3, "milestones_total": 3,
# "root_hash": "e4b1...d723", "timestamp": 1795012345}
The TypeScript SDK follows the same pattern. See npm install @tenova/swt3-ai and the SDK documentation for the full API reference.