AI System DesignData and Feature InfrastructureModule 12 — Advanced data architecture
Designing AI Dataset Quarantine and Remediation for Untrustworthy Upstream Sources
Question 45 of 47 · Updated
On this page
- 1. Start with a realistic incident
- 2. Architecture and trust boundaries
- 3. Detect source trust failures
- 4. Determine the blast radius with lineage
- 5. Contain according to actual consumer risk
- 6. Repair without rewriting history
- 7. Practical restoration gates
- 8. Operate and test the workflow
- Interview-ready answer
Quarantine the untrustworthy source scope and every potentially contaminated derivative, not just the rows that fail validation. Keep protected evidence, block unsafe consumption through a versioned trust registry, discover affected datasets and models using lineage, rebuild from independently verified inputs, and restore eligibility only after an approved validation gate. A repaired upstream feed is not proof that its historical descendants are safe.
How would you build an AI dataset quarantine and remediation workflow when an upstream source becomes untrustworthy?
*ASD-096 · Module 12 — Advanced data architecture · Learning order 32.*
1. Start with a realistic incident#
A retailer trains a stockout prediction model on orders, inventory and supplier delivery history. A supplier feed changes its quantity definition from individual units to cartons without updating its contract. Every row is positive and schema-valid, but the values are wrong for the model. A week of training data, cached features and evaluation artifacts may already depend on the affected feed.
The usual invalid-row quarantine catches malformed values. It does not catch a whole source that has lost semantic trust. The existing MLOps invalid-record quarantine lesson explains rejected rows and controlled replay; the ML measurement-incident lesson addresses unknown model-quality reports. ASD-011 covers isolated historical backfills and ASD-013 immutable dataset construction. Here the focus is revoking and restoring trust across an already-published dependency graph.
2. Architecture and trust boundaries#
The trust registry identifies exact source versions, partitions, time ranges, purposes and dependent artifacts. Store a status, incident ID, policy epoch, reason, evidence references and accountable owner. Keep immutable dataset manifests separate from mutable eligibility: an artifact can retain its original identity while being prohibited for current use.
Enforce trust at dataset publication, training admission, model promotion, feature serving and benchmark reporting. A catalog warning alone is insufficient. Existing readers and in-flight jobs need cancellation, a bounded validity lease or a protected recheck before publishing results. Do not allow a stale worker to publish an artifact after its dependencies were quarantined.
Raw capture may continue into restricted storage if it remains authorized and safe. If the source or ingestion credentials are compromised, disconnect it or isolate acquisition more strongly. Quarantine must never mean copying sensitive data into an unrestricted debugging bucket.
3. Detect source trust failures#
Use independent evidence rather than trusting a producer's success status.
| Failure signal | Example | First response |
|---|---|---|
| Contract or semantic change | Cartons reported as units | Hold affected producer versions |
| Reconciliation failure | Inventory totals disagree with physical ledger | Hold affected periods and dependencies |
| Provenance failure | Signature, identity or source revision cannot be verified | Block unverified scope |
| Coverage failure | Missing region or transaction partition | Assess affected cohorts and downstream requirements |
| Suspected compromise | Unauthorized modification of training records | Contain access and involve security owners |
Distribution drift is a signal for investigation, not proof of corruption. Seasonal demand or a genuine change in customer behavior may be valid. A checksum verifies bytes against a trusted reference, not business correctness. Combine contract checks, independent source reconciliation, representative audits and known domain invariants.
Record the earliest plausible affected boundary, not merely the detection timestamp. If a source changed on Monday and was detected Friday, holding only Friday's batch is inadequate. When the boundary is uncertain, temporarily widen it and narrow only with evidence.
4. Determine the blast radius with lineage#
Maintain dependency edges at useful granularity: source batch or snapshot → transformed partition → dataset release → training or evaluation run → model or report → deployment. Include caches, embeddings, fitted preprocessing, rolling aggregates, exported copies and derived labels when applicable.
Suppose the bad feed affects 50,000 of 1,000,000 eligible training examples. Removing those rows does not necessarily remove contamination. A normalization parameter fitted on the full dataset may affect every transformed example. A 30-day rolling feature may remain affected for 29 subsequent days after a bad daily input, under that window definition. A model already trained on the bad data does not become clean when the source table is fixed.
A small lineage traversal illustrates the containment rule:
PYTHONfrom collections import deque def impacted(children, suspect): """Known descendants, including the quarantined roots.""" found = set(suspect) queue = deque(found) while queue: for child in children.get(queue.popleft(), ()): if child not in found: found.add(child) queue.append(child) return found edges = { 'batch-7': ['feature-v3', 'test-v2'], 'feature-v3': ['train-v4', 'cache-v3'], 'train-v4': ['model-v5'], 'model-v5': ['deployment-v8'], 'test-v2': ['release-report-v5'], } held = impacted(edges, ['batch-7']) assert len(held) == 8 assert 'deployment-v8' in held assert 'release-report-v5' in held assert 'cache-v3' in held assert 'train-v2' not in held assert impacted(edges, ['batch-7', 'feature-v3']) == held assert impacted(edges, []) == set() assert impacted({'a': ['b'], 'b': ['a']}, ['a']) == {'a', 'b'} print('8 checks passed')
Executed locally on Python 3.13.5: 8 checks passed. The function finds known descendants of suspect roots in O(V + E) time over the reachable subgraph, using a visited set to avoid repeated traversal. It also handles duplicate roots and cycles. The exact code hash (MD5, excluding terminal newline) is 0429a760f933fe770ee8b4287abb77e6.
This is impact discovery only. It assumes a trusted, complete graph of immutable artifact IDs and does not implement authorization, persistent quarantine or concurrent publication. Missing lineage means unknown impact, not a clean artifact. Hold consumers with uncertain ancestry until scope is established. Production implementations need reverse dependency indexes and must handle newly registered descendants during an incident.
5. Contain according to actual consumer risk#
| Affected consumer | Appropriate containment |
|---|---|
| New training job | Reject quarantined or unverifiable dependencies |
| Running training job | Cancel or isolate output; prevent registration as eligible |
| Evaluation benchmark | Withdraw affected results and mark unsupported quality claims unknown |
| Online feature cache | Invalidate affected keys/generation; use approved compatible fallback |
| Deployed model | Assess training contamination and active input risk; restore an eligible model or restrict use |
| Historical prediction | Retain original evidence and assess affected decisions separately |
Do not stop every model indiscriminately when verified unaffected scope can continue. Conversely, do not assume an older model is safe simply because it predates detection: its training data may have the same ancestor, or its online features may still depend on the broken source.
For the retailer, an independently validated orders-only fallback may support low-impact forecasts while supplier features are unavailable. If no compatible, eligible model remains, abstain. A stock replenishment action has its own authorization and operational safety checks.
Use scoped trust epochs and durable invalidation events. A model registry should independently reject promotion when a candidate depends on a held dataset, even if the training scheduler was unaware of the incident. Reconcile actual consumer acknowledgments and stop issuance of new leases for quarantined artifacts. Across distributed systems, event delivery is not instantaneous; define and monitor the maximum exposure window, and use fail-closed admission where stricter guarantees are required.
6. Repair without rewriting history#
This state machine describes the incident scope and its usable successor, not rewriting the original corrupted artifact to trusted.
- Investigate: Confirm the defect, source version and affected scope using independent evidence. Preserve original bytes or protected evidence references where retention permits.
- Repair: Obtain authoritative replacements or apply a verified correction. In the carton example, conversion requires the correct product pack sizes for the relevant dates; multiplying every quantity by one guessed constant is unsafe.
- Rebuild: Generate new immutable source and downstream versions, including affected feature windows, fitted transformations and datasets. Keep them isolated from live state. Suppress historical business side effects.
- Validate: Reconcile against independent records, measure coverage and critical slices, test actual downstream compatibility and verify the exact replacement manifest.
- Restore: Approve the successor under the current trust epoch. Atomically change the applicable release pointer where supported, then verify each consuming system has switched to eligible dependencies.
For trained models, retraining from an eligible dataset may be required. A clean replacement training dataset is not sufficient evidence to reauthorize an old trained model. Evaluate and approve the actual replacement model separately. If the issue involved poisoned data, additional security and robustness testing may be needed.
If trustworthy historical source data cannot be recovered, publish an explicitly narrower dataset with approved coverage and limitations, or hold the release. Do not manufacture plausible replacements just to restore the original row count.
7. Practical restoration gates#
Assume a fictional incident affects five daily source partitions. The team recovers four and obtains verified replacements for the fifth only in two regions. The repaired dataset contains 980,000 eligible rows; the original cohort had 1,000,000. Coverage is 98%, but a small critical region has only 70% coverage. If its agreed minimum is 95%, the full release remains held even though the global coverage looks good.
| Gate | Required evidence |
|---|---|
| Source trust | Verified correction and independently reconciled affected scope |
| Dependency closure | Replacement artifacts use eligible, pinned ancestors |
| Data integrity | Schema, semantic checks, unique IDs and exact cohort accounting |
| Model validity | Actual model and feature compatibility; independent quality and critical-slice checks |
| Operational readiness | Current policy epoch, consumer acknowledgments, safe recovery plan |
Review approval must bind the exact manifest and current incident revision. A new source defect discovered during validation invalidates stale approval. Publish a new release, not a silent overwrite of the historical dataset. Retain the former release as restricted audit evidence only where authorized. A corrected evaluation report should identify the report it supersedes and the scope of changed conclusions.
Rollback is also gated: return only to an independently eligible and compatible release. If no such release exists, hold rather than restore a contaminated predecessor.
8. Operate and test the workflow#
Start with a relational artifact registry, dependency edges, a quarantine state table, object-storage permissions and protected admission checks. At larger scale, use partition-level lineage, incremental impact computation and a durable incident event stream. Rebuild only affected dependency closures when equivalence to a full rebuild is established. Global fitted statistics may make the closure much larger than the original bad partitions.
Monitor time from detection to effective containment, held artifact count and unknown-lineage count, unsafe admission attempts, consumer acknowledgment lag, remediation backlog, independently reconciled coverage and restoration failures. Prioritize actual exposure to untrustworthy inputs over how many tickets are closed. Group repeated alerts by source incident and protect sensitive evidence.
Test a source producing plausible but wrong units, a contaminated model with an otherwise clean evaluation set, a missing lineage edge, quarantine during a running job, stale restoration approval, a delayed invalidation event and a correction that invalidates rolling features. Verify the actual publication gate rejects unsafe artifacts, not just that an alert fires. Test recovery using isolated synthetic data and independent expected outcomes.
Interview-ready answer#
I would maintain a versioned trust registry and immutable lineage for source batches, dataset releases, features, model runs and deployments. Independent quality and provenance checks would identify suspicious scope, and a quarantine controller would propagate holds to known and potentially affected consumers. I would block unsafe training, evaluation and serving, while allowing verified unaffected paths to continue. Remediation would reconstruct replacement artifacts in isolation from trustworthy evidence, independently validate coverage and downstream behavior, then conditionally restore an exact approved successor. I would preserve original evidence, track consumer acknowledgments and never interpret a recovered source heartbeat as proof that its descendants are clean.
References
- 1.OpenLineage — Specificationopenlineage.io
- 2.W3C — PROV Data Modelw3.org
- 3.Apache Iceberg — Table Specificationiceberg.apache.org
- 4.
- 5.Google SRE — Managing Incidentssre.google
- 6.Google — Rules of Machine Learningdevelopers.google.com
Related questions
Explore other topics:Forward Deployed EngineeringMachine LearningMLOpsPython