Your Retrieval Index and Your Pretraining Corpus Are Both Unsigned Inputs
Poisoning a live RAG store and inheriting your own eval sets in a fine-tune are one failure wearing two masks: an ingest path with no integrity check and no usable audit trail.
The escalation path matters more than the wrong answer. Unvalidated metadata arriving at the model as authoritative context runs RAG output manipulation → indirect prompt injection → remote code execution in tool-enabled agents. The permission that opens it is ordinary. A single s3vectors:PutVectorBucketPolicy call from a compromised principal grants a foreign AWS account full cross-account read, write and delete on the data plane, while the control plane stays owner-only. Forensics closes the trap: data events are off by default, and even when enabled they strip the vector key, the embedding and the metadata. Responders learn that an index was touched, and nothing about what was written into it.
Retrieval evaluation does not measure this bottleneck at all. recall@k and nDCG score a fabricated chunk perfectly when its citation points at a real, unmodified document. No standard retrieval metric is defined over provenance. The thing recall@k does not tell you is whether the chunk it ranked first was ever written by a human at the cited source. Two closures, both cheap:
- Sign at ingest. Store the SHA-256 of the source chunk plus a canonical document ID in metadata, and verify at retrieval time. Records that fail to reconcile against the document store get quarantined, not served.
- Test the failure directly. Plant N adversarial vectors in a staging index: forged text, spoofed citation, contradictory dosage or policy claims. Then track attack success rate and citation-mismatch rate as blocking gates on retriever and ingest changes.
The same gap, one layer up in the stack
The Stack v3 is the best open code corpus available and the most efficient way to invalidate an internal benchmark. Its filtered training split is 15.9 TB and roughly 4.9T tokens across 713 languages and 173M repositories, crawled from GitHub directly this time rather than from Software Heritage, with a knowledge cutoff of August 7, 2025. An unfiltered snapshot of that scale and that date plausibly contains the repositories behind the agentic and SWE-style evals teams quote. Fine-tune on it without decontamination and the result looks better than it is, in a direction nobody can later distinguish from a genuine gain.
Two further risks belong to different owners. Licensing: ScanCode labels are error-prone, and files with no detected license are retained in the training split, which grants no public reuse rights. That is a legal review, not a data-engineering judgment call. Recursion: a 2025 crawl contains substantial AI-written code with no authorship labels, so tomorrow's code models learn partly from today's model outputs, at a fraction nobody can currently measure. Treat AI authorship as an unmeasured confound in any data-quality ablation run on this corpus.
And where the artifacts actually live
Wiz's survey of GPU neocloud object storage resets a baseline most ML teams inherit by assumption: across Nebius, Crusoe, Vultr, Lambda Labs, Cloudflare R2 and DigitalOcean, none match S3 Block Public Access, only two offer data-plane logs, and fine-grained IAM exists on three. Vultr and Lambda Labs access keys have no distinguishing pattern, so GitHub secret scanning cannot see a key leaked in a notebook commit. S3-compatible API does not mean S3-equivalent controls, and separate global namespaces make bucket-squatting dataset names viable.
The retrieval index is an unsigned, unaudited write surface, and the cloud audit trail will not tell you what happened inside it.
One pattern ties the layers together: integrity belongs at the write, not the read. Hash at ingest, decontaminate before training, and log the writer identity in a pipeline you own, because every downstream metric reported here is defined over data whose provenance nothing else in the stack currently guarantees.
What to do
Add ingest-time content-hash reconciliation to your vector pipeline this week: store the SHA-256 of each source chunk plus a canonical document ID, verify at retrieval, and quarantine records that fail to reconcile.
Stand up a retrieval-poisoning regression suite before your next retriever or ingest change, gating on attack success rate and citation-mismatch rate.
Decontaminate The Stack v3 against every eval set you rely on before any fine-tune this quarter, using content-hash plus MinHash at 70% or lower overlap, and route retained no-license files to legal.