Frontier AI Security: Attack Surfaces · 3 of 5
Malicious Datasets and Loaders
A dataset can become active content when its loader runs code or its values are injected into templates that execute.
A dataset looks harmless because it appears to be only information: rows, labels, documents, images, or numbers. The security mistake is to stop the analysis there. A dataset becomes risky at the moment software interprets it. If the loading path can run dataset-supplied code, or if dataset values can alter a template that later executes, then opening the dataset is no longer just reading data. It is running an untrusted program with whatever permissions the loader process has.
The file is not the whole story
Most people picture loading a dataset as a quiet copy operation: read bytes from storage, place them in memory, and hand them to a training or evaluation job. Some datasets really are used that way. Many are not.
Real loaders often parse archives, decode formats, normalize fields, split examples, fetch companion files, generate derived labels, or apply custom preparation logic. Each of those steps is computation. Computation has privileges, dependencies, network access, file access, and bugs. That is where a dataset stops being merely a file and becomes part of a software supply chain.
The same lesson appears in unsafe model deserialization: the dangerous point is the boundary between passive-looking content and an active process. With datasets, that boundary is the loader and everything it calls.
Remote code loaders
A remote code loader is dataset-provided loading logic that runs when the dataset is used. The word remote does not have to mean that the code is executed directly from the internet. It means the logic comes from outside the trust boundary of the system using it.
Custom loaders can be useful. Complex datasets may need special decoding, unusual metadata handling, or multi-file assembly. The problem is that a loader is a program. If a platform or evaluation harness automatically trusts that program, then loading the dataset grants the dataset author a path to code execution.
The result can be the same kind of failure as a booby-trapped model file: remote code execution, meaning an attacker-controlled instruction runs on the machine doing the loading. The route is different, but the security outcome is familiar.
Template injection
Template injection is quieter. Many machine learning and evaluation systems use templates: fixed patterns with blanks that are filled with dataset values. A template might format a prompt, construct an instruction, generate a command line, build a query, or assemble configuration text.
The safe version is simple: untrusted values remain values. They are inserted in a way that cannot change the structure or meaning of the surrounding template. The unsafe version lets the value cross a boundary. A field that should have been treated as plain text is interpreted as template syntax, a command, or code.
That is the essence of template injection: data controls part of something that will be executed. The dataset does not need to carry a loader at all. It only needs a field placed into the wrong kind of template without proper separation.
Why this matters in frontier AI evaluations
Frontier artificial intelligence evaluations often ingest artifacts from many places: benchmark datasets, task definitions, scoring scripts, prompt templates, harness configuration, dependency lists, and generated outputs. The evaluation environment is therefore not just a lab bench. It is a software supply chain assembled for measurement.
That matters because evaluation machines may have valuable access. They may reach model application programming interfaces, internal test systems, credential stores, result databases, or package registries. If an untrusted dataset can run code during loading, the attacker is no longer attacking the model alone. They are attacking the evaluation environment.
This is why dataset security is not a niche data-engineering concern. It is part of the safety case for any system that evaluates powerful models or autonomous agents.
What an attacker wants after loading
The first goal is usually code execution. That is only the doorway. Once code runs, the next question is what the loader process can see and do.
A poorly contained loader may read local files, discover credentials, make outbound network connections, modify cached artifacts, poison results, or install persistence for later jobs. Even if the model under test is perfectly isolated, the dataset loader may become the easier route into the surrounding system.
Good security design therefore assumes that one layer may fail. The loader might run something it should not. The template engine might interpret something it should not. The operating environment still needs to make the consequences small.
Controls that make dataset loading boring
The best control is a boring loading path: deterministic, restricted, inspectable, and unable to surprise the operator. That means choosing formats and workflows where the dataset is data, not code, whenever possible.
When custom loading logic is unavoidable, treat it as untrusted software. Review it, pin its dependencies, run it in a sandbox, remove credentials, deny unnecessary outbound network access, and record exactly what artifact and code version produced the prepared data.
For templates, the rule is equally direct: keep data and executable structure separate. Use template systems in modes that escape or quote untrusted values correctly, and never let dataset fields choose the template syntax, command structure, or program text that will be executed.
- Disable dataset-supplied loading code by default, and require an explicit approval path when it is needed.
- Prefer simple, non-executable dataset formats for routine ingestion.
- Run loaders in a sandbox with minimal file permissions and no ambient secrets.
- Use default-deny network egress, meaning outbound connections are blocked unless specifically allowed.
- Treat templates as code-adjacent surfaces and escape untrusted values before rendering.
- Log the dataset identity, loader version, dependencies, and outputs so results can be traced and reproduced.
The leadership decision is a trust decision
Practitioners face a practical tradeoff. Allowing arbitrary dataset loaders makes experimentation easier and supports unusual benchmarks. Blocking them by default reduces surprise and forces teams to decide when code execution is truly necessary. That is not a purely technical preference; it is a risk policy.
A useful policy asks four questions before any untrusted dataset is loaded. Who supplied it? Does it require executable loading logic? What will the loading process be able to access? How will the organization prove later what code and data produced the result?
Leaders should not need to choose between useful evaluations and safe operations. The mature pattern is to create a fast path for ordinary passive datasets and a controlled path for datasets that require code. The controlled path can still be efficient, but it should be explicit, isolated, logged, and reversible.
Key takeaways
- A dataset becomes risky when the software loading it can interpret or execute attacker-influenced content.
- Remote code loaders turn dataset ingestion into execution of dataset-supplied programs.
- Template injection happens when untrusted dataset values alter something that later runs.
- The right default is to treat unknown datasets as untrusted programs, not passive files.
- Sandboxing, credential hygiene, default-deny network egress, and provenance records limit damage if loading goes wrong.
- Organizations should create an explicit approval path for any dataset that requires executable loading logic.
Glossary
- Active content
- Data that can cause code to run or change execution behavior when it is processed.
- Remote code loader
- Dataset-supplied loading logic from outside the trust boundary that runs when the dataset is used.
- Remote code execution
- A security failure in which attacker-controlled instructions run on a target system.
- Template injection
- A flaw where untrusted input changes the syntax or behavior of a template that is later interpreted or executed.
- Sandbox
- An isolated environment that limits what a process can read, write, execute, or contact.
- Default-deny network egress
- A network rule in which outbound connections are blocked unless a specific destination or purpose is allowed.
- Credential hygiene
- The practice of keeping secrets such as tokens, passwords, and keys out of places where untrusted code can access them.
- Provenance
- Recorded evidence of where an artifact came from, how it was produced, and which versions of data and code were involved.