In This Article
- Executive Summary
- Two Teams, Two Vocabularies, One Set of Data
- Build Time and Run Time Gates Are Different Controls
- Designing Build Time Gates That Produce Validation Evidence
- Designing Run Time Gates That Survive Production Data
- When a Run Time Gate Fails: Build Failure, Deviation, or Neither
- Change Control on the Rules Themselves
- Evidence Retention: What the Pipeline Has to Emit
- Keeping It Proportionate Without Losing the Record
- A Rollout Sequence That Does Not Stall the Data Team
- Conclusion
- For Further Reading
- References & Sources
Executive Summary
Data engineering teams inside pharma and biotech now run pipelines the way software teams run applications: version control, pull requests, automated tests, continuous deployment. The quality organization, meanwhile, still expects validation evidence that looks like a signed test script with a pass or fail column. Both groups are doing careful work. They are producing and consuming completely different artifacts, and the gap gets discovered during an inspection rather than during design.
The resolution is not to make data engineers write manual test scripts, and it is not to ask QA to accept a build log as a validation record. It is to place data quality gates deliberately, decide in advance what each gate means when it fails, and configure the pipeline to emit the specific evidence a reviewer needs. The most important design decision is the line between a build time gate, which tests code before release, and a run time gate, which tests production data on every load. Those two things look similar in a pipeline definition and carry entirely different obligations under the quality system.
This article covers how to separate those two gate types, which artifacts become controlled records and which stay engineering tooling, how to write a procedure so that a failed run time gate has a predetermined disposition rather than an argument, how to apply change control to threshold values without turning every tuning adjustment into a validation event, and what the pipeline has to retain so that a reviewer three years later can reconstruct which version of which rule passed which load.
Two Teams, Two Vocabularies, One Set of Data
Walk into a data platform team in a mid-sized biotech and you will find something that would have been unusual in a regulated environment ten years ago. Transformation logic lives in a Git repository. Every change goes through a pull request with a required reviewer. A continuous integration job runs on every commit, executing hundreds of assertions against a test dataset. Deployment to production is automated. Nobody prints anything.
Walk into the quality organization in the same company and ask what evidence exists that the reporting dataset feeding the annual product quality review is trustworthy. You will be handed a validation package built around a different model: a validation plan, a requirements traceability matrix, executed test scripts with initialed and dated results, a summary report, and a signature page. The package was assembled once, at go-live, and refreshed when a formal change was raised.
Neither group is wrong. The engineering group is testing far more thoroughly and far more often than the validation package suggests. The quality group is asking for something the engineering group already has, expressed in a form the engineering group does not naturally produce. What is missing is a deliberate mapping between the two.
The mismatch is about form, not rigor
The interesting part is that regulators have already moved toward the engineering side of this argument. FDA’s guidance on computer software assurance for production and quality management system software, currently in a version issued February 3, 2026 that supersedes the September 24, 2025 final,12 explicitly recommends using digital records rather than paper artifacts. The guidance recommends incorporating the use of digital records, such as system logs, audit trails, and other data generated and maintained by the software, instead of paper documentation, screenshots, or duplicating results already retained digitally by the software.1
That single sentence resolves most of the argument, if teams read it. A continuous integration job log is exactly the kind of digital record the guidance describes. The problem is that a raw job log is not yet a validation record, because it does not answer the questions a reviewer asks. It usually does not state the intended use of what was tested. It rarely records the risk basis for why those particular checks were selected. It often does not contain a conclusion about acceptability, and it may not identify who reviewed it or whether anyone did.
The same guidance sets out what the record should contain: the intended use of the software feature, function, or operation; the outcome of the risk-based assessment; documentation of the assurance activities including a description of the testing performed, issues found such as deviations, defects, or failures, and a conclusion statement declaring acceptability of the software for its intended use; a record of who performed the testing and the date; and established review and approval where appropriate.1
Read that list against a typical pipeline run and the gap is narrow. Most of it is metadata the pipeline could emit if someone asked it to. The engineering team never asked because nobody told them what the record needed to contain.
A note on scope. The CSA guidance is written for device production and quality management system software under CDRH and CBER. It is not a drug GMP guidance. Pharma and biotech teams borrow its risk framework because the reasoning is sound and because FDA has signaled a direction, but the binding requirements for a drug manufacturer sit in 21 CFR Parts 210, 211, and 11, in EU GMP Annex 11, and in the data integrity expectations published by MHRA and PIC/S. Cite CSA as reasoning, not as authority, and anchor the procedure in the regulations that actually apply to your products.
Why this matters more now than it did
Three things changed at once. Pipelines got faster, so the number of releases per year went from a handful to hundreds. Data volumes grew enough that manual review of loaded data stopped being possible. And the outputs of these pipelines started feeding decisions that regulators care about: batch release support, stability trending, deviation trending, comparability assessments, and increasingly, models that inform process control.
The draft revision of Annex 11 published for comment on 7 July 2025 runs to roughly nineteen pages against the four or five of the version it replaces, with substantially expanded treatment of audit trails, periodic review, supplier and service management, and security.6 Whatever the final text says, the direction is more specific expectations about computerised systems, not fewer. A data platform that cannot explain how it controls its own data quality checks is going to be a harder conversation in 2027 than it was in 2022.
Build Time and Run Time Gates Are Different Controls
If you take one structural idea from this article, take this one. A data quality gate that runs before code is released and a data quality gate that runs on production data during a load are not variations of the same control. They test different things, they fail for different reasons, and they carry different obligations.
Teams conflate them because in a modern stack they are written in the same language, live in the same repository, and run through the same orchestrator. A dbt test looks identical whether it runs in a pull request check or in the nightly production job. Great Expectations checkpoints run the same way in both places.14 That surface similarity is exactly what causes the trouble.
What each one is actually testing
A build time gate tests the code. It asks whether the transformation logic, the schema definition, and the join keys behave as specified when run against known inputs. The subject under test is the software. If a build time gate fails, the code is not correct and should not be released. Nothing has happened to production data, because nothing has been released.
A run time gate tests the data. It asks whether the records that arrived in this particular load look like the records the process is supposed to produce. The subject under test is the data itself, and often, indirectly, the upstream process that generated it. If a run time gate fails, the code may be perfectly correct. Something happened in the world: an instrument was recalibrated, a site changed a coding practice, a source system was upgraded, a batch genuinely ran differently.
| Dimension | Build time gate | Run time gate |
|---|---|---|
| Subject under test | Transformation code, schema contract, join logic | Production records in a specific load |
| Input data | Fixed test fixtures or seeded sample data | Live production data, different every run |
| When it runs | On every commit and before promotion | On every load, after promotion |
| Determinism | Deterministic. Same input, same result | Non-deterministic by design |
| Meaning of failure | The software is wrong | The data or the upstream process changed |
| Primary regulatory hook | Software assurance and change control | Data integrity, record accuracy, deviation handling |
| Evidence produced | A release record that supports promotion | A per-load record that supports use of the data |
| Who reviews a failure | Engineering, with QA approving the release record | Data steward or process owner, with quality involvement based on risk |
The consequence for your validation approach
Build time gates belong inside your software assurance approach. They are testing activities. Their evidence supports a release decision, and the release decision is a change control event that already has a home in your quality system.
Run time gates are something else. They are ongoing process controls, closer in character to an in-process check on a manufacturing line than to a test script. Their evidence supports a statement about a specific dataset on a specific day. Treating them as validation tests produces two failure modes at once: engineering gets buried in paperwork for routine data variation, and quality gets flooded with records that carry no useful signal.
The pattern that causes the most damage. A team implements dozens of statistical checks, wires every one of them to fail the pipeline, and connects the pipeline failure to an automatic deviation record. Within a month the deviation backlog is unmanageable, the team quietly widens every threshold until nothing ever fires, and the controls become decorative. The gates still exist, still appear in the validation package, and no longer detect anything. That is worse than having no gates, because the package now overstates the level of control.
Designing Build Time Gates That Produce Validation Evidence
Build time gates are the easier half, because the software industry has already solved most of the mechanics. The work in a regulated setting is deciding which of them carry validation weight, and making sure those emit a record that can stand on its own.
The three build time gates that earn their place
Schema contract enforcement
Column names, data types, nullability, and allowed value sets are declared explicitly and checked against the source before any transformation runs. A source that adds a column is fine. A source that changes a type or drops a field fails the build. This is the single highest-value gate in most pipelines because it catches silent breakage that would otherwise surface as wrong numbers weeks later.
Referential and key integrity
Primary key uniqueness, foreign key resolution, and one-to-many cardinality between related entities. A batch record that joins to two lots, a sample result with no parent sample, a duplicated equipment identifier: these are structural defects, not statistical variation, and they should never reach a production table.
Unit tests on transformation logic
Fixed input fixtures with known expected output, exercising the business rules that matter. Yield calculation, unit conversion, timezone handling on timestamped records, deduplication precedence, effective dating on reference data. This is where you encode the requirements that a reviewer would otherwise have to take on trust.
Reproducible build provenance
Not a data quality check, but the thing that makes the other three defensible. Every promoted artifact carries a signed record of the commit it came from, the environment it was built in, and the dependency versions used. Software supply chain frameworks describe this as build provenance expressed as signed attestation.17 Without it, your test evidence is not tied to anything.
Schema contracts deserve more attention than they get
A schema contract is an explicit agreement between the team producing data and the teams consuming it, covering field names, types, nullability, and meaning. In distributed systems, that agreement is usually implicit: a table, a topic, an API response that everyone has quietly assumed will keep its shape. When the assumption drifts, pipelines break or, worse, keep running and produce wrong output.
In a GxP setting the schema contract is doing something beyond engineering hygiene. It is the concrete expression of what the data means, which is the same thing a reviewer needs to establish when asking whether a record is accurate and complete. MHRA’s data integrity guidance defines metadata as data that describe the attributes of other data and give them context and meaning, including structure, elements, and interrelationships.4 A versioned schema contract is metadata in exactly that sense, and it happens to be machine-checkable.
Practically, that means declaring the contract in the repository, versioning it alongside the code, and failing the build when a source violates it. It also means treating a change to the contract as a change to a specification, which is the point at which change control enters. More on that below.
What becomes a controlled record and what does not
This is the question that most often goes unanswered, and answering it explicitly removes a great deal of friction.
| Artifact | Status | Why |
|---|---|---|
| The rule definitions themselves (test files, expectation suites, schema contracts) | Controlled | They define the control. Changing them changes the level of assurance. Version controlled, reviewed, and approved. |
| The release record summarizing the gate results for a promoted version | Controlled | This is the objective evidence that the software was assessed and performs as intended. It carries the conclusion and the approval. |
| Per-load run time gate results for GxP datasets | Controlled | They support a statement about the accuracy and completeness of specific records that are used in regulated decisions. |
| Raw CI job console output | Engineering tooling | Useful for troubleshooting, retained by retention policy, but not the record. It is unstructured and not reviewed. |
| Local developer test runs and feature branch builds | Engineering tooling | Nothing was promoted. No decision rests on them. |
| Linting, formatting, and static code checks | Engineering tooling | Code style has no bearing on whether the data is accurate. |
| Performance and load test results | Risk dependent | Controlled if availability or throughput affects a regulated decision, such as real-time release support. Otherwise tooling. |
Writing this table down for your own environment, agreeing it with quality, and putting it in the procedure is perhaps the single highest-return hour of work in this whole topic. It ends the recurring argument about whether a given log needs to be retained, and it stops the quiet expansion of controlled records into everything the pipeline touches.
Designing Run Time Gates That Survive Production Data
Run time gates are harder, because production data is not obligated to behave. The design problem is picking checks that catch real problems without firing constantly on normal variation.
The three families that matter
Volume and completeness checks. Row count against an expected range, presence of all expected source partitions, freshness of the most recent record, and reconciliation of counts between the source and the loaded table. These catch the most common and most damaging failure in practice, which is a partial load that looks successful. A file that transferred half way, a site that did not submit, an API that paginated wrong: the pipeline reports green, the dataset is quietly incomplete, and the deficiency is invisible unless someone counts.
Field-level quality checks. Null rate against a threshold, values outside an allowed set, out-of-range numeric values, malformed identifiers, and dates that fall outside a plausible window. These catch upstream process changes and data entry problems. They are the checks most likely to be noisy, and the most likely to need a range rather than an absolute rule.
Distribution checks. Comparing the statistical shape of this load to a recent baseline: mean and spread of a continuous measure, the mix of categorical values, the proportion of records by site or by product. These are the checks that catch the subtle, slow problems, and they are also the checks most likely to be misinterpreted. A shift in distribution is information, not necessarily a defect.
Distribution drift is a signal, not a verdict
When the mean assay result for a product moves outside the baseline range, the pipeline has learned something. It has not learned that the data is wrong. It might be a real process shift that should go to the process owner, a change in the analytical method, a change in which sites contributed to this load, or a genuine data problem. Treating distribution drift as an automatic data defect is the fastest way to lose the trust of the people who understand the process.
Severity is a design decision, not a default
Most modern tooling already supports what is needed here. In dbt, a data test has a severity setting of either error or warning, and thresholds can be set with error_if and warn_if conditions so that a small number of failing records raises a warning while a larger number raises an error.1213 Great Expectations produces validation results for every checkpoint run and can trigger configured actions when those results come back.1415 Soda expresses checks in a declarative check language against defined datasets.16 Published work on multi-layer testing frameworks for cloud-native pipelines describes the same layered pattern of structural checks enforced strictly and statistical checks enforced with more tolerance.19
The tooling is not the constraint. The constraint is that somebody has to decide, for each rule, what happens when it trips, and that decision has to be written down before the rule goes live.
Three enforcement levels, defined up front
Blocking
The load stops. Data does not land in the consumable table, or lands in a quarantine area that downstream consumers cannot read. Reserved for structural defects: schema violations, duplicate primary keys, broken referential integrity, and completeness failures large enough that the dataset cannot be trusted at all. A blocking gate must be rare enough that when it fires, everyone takes it seriously.
Conditional release
The data loads, but it is flagged and cannot be used for its regulated purpose until a named role reviews and dispositions the flag. This is the level most teams under-use, and it is the one that matches how quality organizations already think. It mirrors the familiar pattern of material that is received, recorded, and held pending disposition.
Monitoring
The data loads and is usable. The result is recorded and trended. No individual occurrence requires action, but a defined pattern does: for example, the same check exceeding its threshold on three consecutive loads, or a trend that crosses a review limit. Most distribution checks belong here on day one, and some of them earn promotion to conditional release once the baseline is well understood.
Every rule gets exactly one of these three levels, and the level is recorded in the rule definition, in the repository, alongside the rule. That makes the level itself version controlled, reviewable, and reconstructable later, which matters when someone asks whether a check was blocking at the time a particular load ran.
When a Run Time Gate Fails: Build Failure, Deviation, or Neither
This is the argument teams actually have, usually at nine in the evening with a batch release waiting. A distribution check tripped on the overnight load. Engineering says the pipeline worked exactly as designed and detected something, so this is not a failure of the system. Quality says a control fired on GxP data, so this is a deviation. Both positions are defensible, which is why the argument never resolves cleanly in the moment.
The answer is that neither position should be argued in the moment. The disposition should already be written in the procedure, keyed to the enforcement level and the nature of the check, decided when the rule was designed and approved.
The disposition matrix
| What tripped | Classification | What happens |
|---|---|---|
| Build time gate in a pull request or pre-promotion check | Build failure. Not a deviation. | The change is not promoted. The developer fixes the code and the check reruns. No regulated record was affected because nothing was released. The failed run stays in engineering tooling. |
| Blocking run time gate on a structural defect | Data event. Deviation if the dataset was already in use. | The load is stopped or quarantined. If nothing downstream consumed the data, this is handled as a documented data event with an investigation and a corrective action, without a deviation record. If a regulated decision already relied on the affected data, it becomes a deviation with impact assessment. |
| Conditional release gate on a field-level check | Held pending disposition. Deviation only on release for use with a known defect. | A named role reviews the flag within a defined period, records a disposition with rationale, and either releases the data, corrects and reloads it, or escalates. Releasing data that fails its own acceptance criteria requires a deviation, because you are accepting a known nonconformity. |
| Monitoring gate exceeding a threshold once | Neither. A recorded observation. | The result is captured and trended. No action beyond the record. This is the category that prevents deviation inflation. |
| Monitoring gate breaching its defined trend rule | Investigation trigger. | The predefined pattern, for example three consecutive exceedances, opens an investigation. The outcome determines whether it becomes a deviation, a process change, or a threshold revision. |
| A gate that should have fired and did not | Deviation, without exception. | A control that failed to operate is a control failure. This includes a check that was silently disabled, a job that skipped its validation step, and a threshold that was widened without approval. Treat this category more seriously than any of the above. |
Writing the procedure so the decision is already made
The procedural language that makes this work is short. For each data quality rule applied to a GxP dataset, the rule definition records the enforcement level, the acceptance criteria, the named role responsible for disposition, the period within which disposition must occur, and the trend rule if one applies. The procedure then states that a rule operating within its defined enforcement level is the system working as intended and does not, by itself, constitute a deviation.
That last clause is the one that saves the most argument. It says out loud that detection is the purpose of the control, and that detecting something is not the same as failing.
The test of a well-written procedure. Hand it to someone who was not involved in writing it, describe a failed check at eleven at night, and ask what happens next. If they can answer in under a minute without calling anyone, the procedure is doing its job. If they say it depends, you have written a description rather than a procedure, and the decision will be made under pressure by whoever is available.
Where quality risk management thinking helps
ICH Q9(R1) makes the point that the level of effort, formality, and documentation of the quality risk management process should be commensurate with the level of risk.3 The revision specifically addressed formality in quality risk management and risk-based decision making as areas that needed clarification, because organizations were applying uniform heavy process regardless of what was at stake.
Applied here, that means a dataset that supports batch release warrants blocking gates, tight thresholds, and a short disposition window. A dataset that supports internal operational reporting warrants monitoring gates and a weekly review. The rules can be written in the same language, run in the same pipeline, and carry completely different consequences, and that difference should be traceable to a documented risk assessment rather than to who happened to configure the job.
Change Control on the Rules Themselves
Here is the point that surprises data teams. A data quality rule is a control. If it appears in a validation package or supports a statement about data used in regulated decisions, then changing it changes the level of assurance. Widening a null rate threshold from two percent to five percent is a change to a validated control, and it cannot be a pull request that one engineer approves on a Tuesday afternoon.
Equally, if every threshold tweak requires a formal change record with a quality signature, the team will stop tuning thresholds. Rules will stay badly calibrated, alerts will be ignored, and the control environment will degrade while looking fine on paper. Both extremes fail.
Tiering rule changes
The way out is to classify rule changes by what they do to the level of assurance, and to define the approval path for each tier in advance.
| Tier | What it covers | Approval path |
|---|---|---|
| Tier 1 Assurance reducing |
Loosening a threshold, lowering an enforcement level, disabling a rule, removing a rule, narrowing the scope of a rule to fewer columns or fewer records | Formal change control. Documented rationale, risk assessment, quality approval before the change takes effect. Never merged first and documented later. |
| Tier 2 Assurance increasing |
Tightening a threshold, raising an enforcement level, adding a new rule, extending an existing rule to more columns | Reviewed and approved by the data owner and a technical reviewer. Recorded in the change log and reported to quality in the periodic review. Faster path, because the change increases control. |
| Tier 3 Assurance neutral |
Renaming a rule, improving a failure message, refactoring how a rule is implemented with identical results, moving a rule between files | Standard code review. No separate change record. Must be demonstrably equivalent, and the burden of demonstrating equivalence sits with the engineer proposing it. |
Making the tier decision enforceable rather than aspirational
A tiering policy written in a procedure and ignored in the repository is not a control. Three mechanisms make it real.
Separate the rule definitions from the transformation code. If quality rules live in their own directory or their own repository, you can apply different review requirements to them. Most Git hosting platforms support path-based code owner rules, which means a change touching the rules directory can automatically require an additional named approver.
Make the automated check detect the direction of change. A comparison between the current and proposed rule configuration can determine whether a threshold moved up or down, whether an enforcement level dropped, and whether a rule was removed. That comparison can post its result on the pull request and block merging until the corresponding change record is referenced. This is not exotic engineering. It is a script that reads two configuration files.
Require the change record identifier in the commit. For Tier 1 changes, the merge is blocked until the commit message or pull request references an approved change record. That single link is what lets a reviewer later trace a threshold value back to the assessment that justified it.
The failure to watch for. A rule that was never formally disabled but stopped running. A job step that was commented out during an incident and never restored. A rule scoped to a table that was later renamed, so the check now silently matches nothing. A rule whose enforcement level was set to monitoring during a migration and never restored to blocking. Each of these leaves a validation package describing controls that are not operating. A periodic reconciliation between the approved rule inventory and what actually executed in the last period catches all four.
Periodic review of the rule set
Rules decay. Sources change, products retire, processes improve, and a check that was well calibrated two years ago now fires on every load or never fires at all. A periodic review, annually for most datasets and more often for high-risk ones, should look at each rule and ask three questions: has it fired in the review period, was every firing a true finding, and does the threshold still match the process. Rules that never fire may be redundant or may be scoped to nothing. Rules that always fire are not controls, they are noise. Both cases should result in a documented decision rather than quiet tolerance.
Evidence Retention: What the Pipeline Has to Emit
Now the practical test. Three years from now, an inspector points at a figure in a report and asks what data it came from and how you know that data was good. Somebody has to reconstruct the answer. Everything in this section exists to make that reconstruction possible.
The reconstruction test
Ask your team to answer this question about a load from eighteen months ago, using only what the systems retained. Which version of which rule ran against which data, what did it conclude, who reviewed the result, and what was decided?
Most teams cannot answer it on the first attempt. The job log was retained for ninety days. The rule definitions are in Git, but nothing recorded which commit was deployed at the time. The results were written to a monitoring dashboard that only keeps thirteen months. The review happened in a chat thread.
The minimum emission set
For every run of a run time gate against a GxP dataset, the pipeline should write a structured record containing the following. This is a short list, and every item on it exists because a reviewer will ask for it.
| Field | Why a reviewer needs it |
|---|---|
| Rule identifier and rule version | Ties the result to a specific, retrievable definition. A rule name alone is not enough, because names get reused. |
| Deployed code version or commit hash | Lets the reviewer retrieve the exact rule logic that ran, not the current version of it. |
| Enforcement level in effect at run time | Answers whether the check was blocking, conditional, or monitoring on that date. This changes over time and is frequently the crux of the question. |
| Threshold or acceptance criterion applied | The number that was in force, not the number in force today. |
| Dataset identifier, load identifier, and record scope | Establishes exactly which records were evaluated. A check that ran on a subset needs to say so. |
| Execution timestamp with timezone | Contemporaneous recording. Timezone matters more than teams expect on multi-site data. |
| Result, including the measured value | Pass or fail is not sufficient. The null rate was 1.8 percent against a threshold of 2 percent is a materially different record from pass. |
| Identity of the executing system or account | Attributable, in the ALCOA sense. Automated actions must still be attributable to their source. |
| Disposition, reviewer identity, and rationale where applicable | Closes the loop for conditional release gates. Without this, the record shows a flag and no resolution. |
This record is the validation evidence. It is machine-generated, structured, queryable, and it contains everything the CSA guidance describes as belonging in the record: what was tested, what the risk basis was, what was found, what was concluded, who performed it, and when.1 It is also far better evidence than a screenshot, because it can be aggregated, trended, and reconciled against the approved rule inventory.
Retention, immutability, and the audit trail question
Where these records live matters as much as what they contain. Three requirements apply.
Retention has to match the retention of the data it describes. If a dataset supports records that must be kept under 21 CFR 211.180, the quality evidence about that dataset has to be available for the same period.8 A ninety day log retention policy on the CI system is fine for the console output, and not fine for the structured gate results. Those two things need different homes and different retention rules, which is another reason the controlled record versus tooling distinction matters.
The records have to be protected from alteration. Part 11 requires secure, computer-generated, time-stamped audit trails that independently record the date and time of entries and actions that create, modify, or delete electronic records, and requires that audit trail documentation be retained for at least as long as the subject records.7 Gate results stored in a table that engineers can update are not going to satisfy that expectation. Append-only storage, or storage with an audit trail over it, is the design choice here.
The rule definitions have to be retrievable, not just versioned. Git history is a genuine advantage, and it is not automatically sufficient. Repositories get migrated, history gets rewritten, and organizations change hosting providers. If the retention period is longer than your confidence in the repository, periodically export the approved rule set as an immutable snapshot into the same document management system that holds your other controlled records.
What the ALCOA attributes look like for a pipeline gate
- Attributable. The executing service account or job identity is recorded, and human dispositions carry a named reviewer.
- Legible. The record is structured and readable without the tool that produced it. JSON in an accessible store, not a proprietary binary.
- Contemporaneous. Written at execution time, not reconstructed afterward from logs.
- Original. The structured result is the original record, not a transcription of what a dashboard displayed.
- Accurate. The measured value is captured, not only the pass or fail verdict.
- Complete, consistent, enduring, available. Every run is recorded including successful ones, using consistent identifiers, retained to policy, and retrievable without reinstating a decommissioned tool.45
Do not forget the passing runs
Teams frequently retain failures and discard successes, because failures are what generate work. That is backwards for validation purposes. The reviewer’s question is whether the control was operating, and the evidence that it was operating is the population of runs where it executed and passed. A record showing four failures in three years, with no evidence of the eleven hundred passing runs in between, tells a reviewer very little and invites the follow-up question you do not want.
Keeping It Proportionate Without Losing the Record
Everything described so far can be scaled up into a program that consumes more effort than the risk warrants. The discipline that prevents that is the same risk-based thinking that runs through current regulatory guidance, applied honestly rather than as a label.
Risk sits in the use of the data, not in the pipeline
The most common error in scoping is treating the pipeline as the unit of risk. Pipelines are usually mixed. The same platform often carries a dataset supporting batch disposition and a dataset supporting a departmental dashboard. Applying uniform controls to both means either over-controlling the dashboard or under-controlling the disposition data, and in practice it produces the first.
Scope by dataset and by use. For each dataset, record what regulated decisions depend on it, what happens if the data is wrong and nobody notices, and how quickly an error would be detected by another means. That assessment drives the enforcement levels, the thresholds, the disposition window, and the retention period. It is also the documented risk basis the record is supposed to contain.1
Three questions that right-size the effort
What decision depends on this data?
If the answer is a regulated decision such as release, reporting, or a submission, the gates are blocking or conditional and the evidence is controlled. If the answer is an internal operational decision that a person will sanity check anyway, monitoring gates and standard log retention are proportionate.
Would anything else catch this error?
Detection that already exists elsewhere reduces the assurance a gate has to provide. A figure that a qualified reviewer checks against the source system before signing does not need the same automated tightness as a figure that flows into a report unexamined.
How long would an undetected error persist?
An error that surfaces on the next daily reconciliation is a different risk from one that sits in a trending dataset for a year and shapes a periodic review conclusion. Latency of detection drives how strict the gate needs to be, and this factor is routinely left out.
Is the check meaningful or just available?
Tooling makes it trivial to generate hundreds of checks automatically. Most of them test nothing anyone cares about. Every rule you add is a rule you must maintain, review, change control, and defend. A smaller set of well-chosen rules is stronger evidence than an exhaustive set nobody understands.
What CSA thinking does and does not settle
Risk-based software assurance is the reason this approach is defensible rather than a shortcut. The guidance is clear that documentation of assurance activities need not include more evidence than necessary to show that the software performs as intended for the risk identified, and that digital records generated by the software are the preferred form of that evidence.1 GAMP 5 Second Edition moved in the same direction, adding explicit treatment of critical thinking and of iterative software development approaches.18 FDA’s long-standing position on Part 11 scope has similarly emphasized applying controls based on a justified assessment of risk to record integrity rather than uniformly.11
What none of that settles is the run time question. Software assurance guidance is about establishing confidence in the software. It says relatively little about what to do when correct software correctly reports that today’s production data looks different from yesterday’s. That gap is where your own procedure has to do the work, and it is why the disposition matrix described earlier is not something you can lift from a guidance document. It has to be written for your data, your processes, and your risk tolerance, and approved before you need it.
A Rollout Sequence That Does Not Stall the Data Team
The approach fails most often in adoption, not in design. Teams try to apply it to everything at once, the data group experiences it as bureaucracy landing on top of work that was going fine, and the effort stalls. A staged sequence works better, and the order matters.
Inventory the datasets and classify by use
Before writing a single rule, list the datasets the platform produces and record what depends on each. Most organizations find that a small fraction carries the regulated weight. That fraction is the scope. Everything else follows engineering good practice without validation obligations, and saying so explicitly is what buys goodwill for the rest of the program.
Agree the controlled record boundary with quality
Produce the table of what is a controlled record and what is engineering tooling, and get it approved. Do this second, before any rules are written, because it determines where results have to be written and how long they have to be kept. Retrofitting retention onto a running pipeline is far more work than designing it in.
Implement build time gates first
Schema contracts, key integrity, and unit tests on transformation logic. These are uncontroversial, they deliver immediate engineering value, and they establish the pattern of gate results feeding a structured record. They also carry no run time disposition question, so the team gets a working example before the harder conversation starts.
Add run time gates in monitoring mode only
Every new run time rule starts at monitoring for a defined observation period, typically one to three months depending on load frequency. Nothing blocks. The team learns what normal variation looks like on real data, and thresholds get calibrated against evidence instead of guesswork. This period is also when you discover which rules are noise.
Promote selected rules to conditional or blocking
At the end of the observation period, review each rule against its record: how often it fired, whether each firing was a true finding, and what the consequence of missing that condition would be. Promote the rules that earn it. Retire the rules that do not. Document both decisions, because the retirements are as informative as the promotions.
Write the disposition procedure and train against real cases
Only now write the procedure, because by this point you know what actually happens rather than what you imagined would. Train using failures that genuinely occurred during the observation period. A procedure written from real cases is dramatically better than one written from hypotheticals, and the team recognizes the scenarios.
Turn on tiered change control and the periodic reconciliation
Apply the three-tier rule change classification, wire the automated direction check into the pull request process, and schedule the periodic reconciliation between the approved rule inventory and what actually executed. This is the step that keeps the control environment from decaying quietly once attention moves elsewhere.
What good looks like after a year. The data team has not slowed down. Releases still happen weekly or faster. The quality organization can answer any question about a GxP dataset from a query rather than a search through chat history. Deviation volume from data quality is low and every one of them is a real finding. And when the rule inventory is reconciled against what executed last quarter, the two match.
Conclusion
The tension between modern data engineering and pharmaceutical validation is real, and it is not primarily a technology problem. Both groups are producing evidence. They are producing it in forms the other group does not recognize, and the reconciliation is being attempted after the fact instead of designed in. The fix is a set of decisions that take a few focused sessions to make and then hold for years: which gates run before release and which run on production data, which artifacts become controlled records, what each failure classification means, how a rule change gets approved, and what the pipeline must write down so that the record can be reconstructed later.
Two of those decisions carry most of the weight. The first is separating build time gates from run time gates, because that separation is what stops a normal data variation from being treated as a software failure and stops a software defect from being explained away as data noise. The second is deciding the disposition of a failed run time gate in advance, in writing, at the moment the rule is designed. Decisions made calmly during design are almost always better than decisions made at nine in the evening with a release waiting, and having them already made is what allows a data team to move quickly without the quality organization losing sleep.
Sakara Digital works with pharma and biotech organizations building validated data platforms and the quality processes that have to sit alongside them. If you are putting automated data quality gates into a regulated pipeline and want an independent perspective on where the controlled record boundary should sit, we are happy to have that conversation.
For Further Reading
For Further Reading
- FDA Computer Software Assurance (CSA): A Practical Guide to Risk-Based Validation
- How to Build an AI Change Control Process in Regulated Systems
- Data Integrity and ALCOA+ in the Digital Age: Modernizing Compliance for Cloud and AI Systems
- Data Quality Metrics That Matter: How Pharma Leaders Measure Integrity and Readiness for AI
- The Manufacturing Data Quality Scorecard: KPIs Beyond Regulatory Submissions
References & Sources
- U.S. Food and Drug Administration. “Computer Software Assurance for Production and Quality Management System Software: Guidance for Industry and Food and Drug Administration Staff.” Issued February 3, 2026. https://www.fda.gov/media/188844/download
- Federal Register. “Computer Software Assurance for Production and Quality System Software; Guidance for Industry and Food and Drug Administration Staff; Availability.” September 24, 2025. https://www.federalregister.gov/documents/2025/09/24/2025-18468/computer-software-assurance-for-production-and-quality-system-software-guidance-for-industry-and
- International Council for Harmonisation. “ICH Harmonised Guideline Q9(R1): Quality Risk Management.” Step 4 version, January 18, 2023. https://database.ich.org/sites/default/files/ICH_Q9(R1)_Guideline_Step4_2022_1219.pdf
- Medicines and Healthcare products Regulatory Agency. “‘GXP’ Data Integrity Guidance and Definitions, Revision 1.” March 2018. https://assets.publishing.service.gov.uk/media/5aa2b9ede5274a3e391e37f3/MHRA_GxP_data_integrity_guide_March_edited_Final.pdf
- Pharmaceutical Inspection Co-operation Scheme. “Good Practices for Data Management and Integrity in Regulated GMP/GDP Environments (PI 041-1).” In force July 1, 2021. https://picscheme.org/docview/4234
- ECA Academy. “Drafts of EU GMP Guideline Annex 11, Annex 22 and Chapter 4 Released for Comment.” July 2025. https://www.gmp-compliance.org/gmp-news/drafts-of-eu-gmp-guideline-annex-11-annex-22-and-chapter-4-released-for-comment
- Electronic Code of Federal Regulations. “21 CFR 11.10: Controls for Closed Systems.” https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-11/subpart-B/section-11.10
- Electronic Code of Federal Regulations. “21 CFR 211.180: Records and Reports, General Requirements.” https://www.ecfr.gov/current/title-21/chapter-I/subchapter-C/part-211/subpart-J/section-211.180
- U.S. Food and Drug Administration. “Data Integrity and Compliance With Drug CGMP: Questions and Answers, Guidance for Industry.” December 2018. https://www.fda.gov/regulatory-information/search-fda-guidance-documents/data-integrity-and-compliance-drug-cgmp-questions-and-answers
- Great Expectations. “Data Validation Workflow.” Great Expectations Documentation. https://docs.greatexpectations.io/docs/0.18/oss/guides/validation/validate_data_overview/
- U.S. Food and Drug Administration. “Part 11, Electronic Records; Electronic Signatures: Scope and Application, Guidance for Industry.” https://www.fda.gov/regulatory-information/search-fda-guidance-documents/part-11-electronic-records-electronic-signatures-scope-and-application
- dbt Labs. “severity, error_if, and warn_if.” dbt Developer Hub Reference. https://docs.getdbt.com/reference/resource-configs/severity
- dbt Labs. “Data Test Configurations.” dbt Developer Hub Reference. https://docs.getdbt.com/reference/data-test-configs
- Great Expectations. “Checkpoint.” Great Expectations Documentation. https://docs.greatexpectations.io/docs/0.18/reference/learn/terms/checkpoint/
- Great Expectations. “Validation Result.” Great Expectations Documentation. https://docs.greatexpectations.io/docs/0.18/reference/learn/terms/validation_result/
- Soda. “SodaCL Overview.” Soda Documentation. https://docs.soda.io/soda-cl/soda-cl-overview.html
- Open Source Security Foundation. “SLSA Provenance, Specification Version 1.0.” https://slsa.dev/spec/v1.0/provenance
- International Society for Pharmaceutical Engineering. “GAMP 5: A Risk-Based Approach to Compliant GxP Computerized Systems, Second Edition.” July 2022. https://www.ispe.org/publications/guidance-documents/gamp-5-guide-2nd-edition
- arXiv. “A Multi-Layer Testing Framework for Automated Data Quality Assurance in Cloud-Native ELT Pipelines.” https://arxiv.org/abs/2605.20500








Your perspective matters—join the conversation.