What breaks is the trust boundary between data and code. If dataset loaders, configuration files, or embedded scripts can run during ingestion, an attacker can turn passive content into remote code execution. That can expose cloud credentials, cluster tokens, and internal systems. Teams should treat model hub artifacts as untrusted executables, disable risky loaders by default, and sandbox ingestion workflows.
Why This Matters for Security Teams
When ingestion pipelines are allowed to execute code, the security boundary moves from “data processing” to “runtime execution.” That matters because model hubs, dataset repositories, and config bundles are often treated as content stores, when in practice they can behave like software supply chains. A single malicious loader, deserialization hook, or embedded script can convert a harmless import into credential theft, lateral movement, or hidden persistence. NHI Mgmt Group research shows that 96% of organisations store secrets outside secrets managers in vulnerable locations, and 79% have experienced secrets leaks, which makes ingestion-time execution especially dangerous when pipelines can reach cloud tokens or service accounts, as noted in the Ultimate Guide to NHIs — Key Research and Survey Results. The practical issue is not just malware in a file, but trusted automation interpreting untrusted content with high privileges. That is why NIST SP 800-53 Rev. 5 Security and Privacy Controls matters here: input validation, least privilege, and execution boundary controls all need to apply before ingestion completes. In practice, many security teams discover the real risk only after a model artifact has already been imported into a build, notebook, or training job with production-adjacent access.
How It Works in Practice
The safest pattern is to treat every untrusted dataset or model artifact as inert until it has passed validation in a tightly constrained environment. That means separating parsing from execution, disabling auto-run features, and sandboxing any component that might interpret code during load. For model and dataset workflows, the riskiest paths usually include Python pickles, custom deserializers, notebook metadata, archive extraction hooks, templated configs, and training scripts bundled with the artifact. If a loader can execute arbitrary functions while reading a file, that loader becomes the attack surface.
A practical control set usually includes:
- Use allowlisted formats only, and reject formats that require code execution to deserialize.
- Run ingestion in an isolated sandbox with no ambient cloud metadata access and no long-lived secrets.
- Mount data read-only and block outbound network access unless a specific workflow explicitly needs it.
- Scan artifacts before import, but do not rely on scanning alone because execution can occur before detection.
- Apply checksum, signature, and provenance checks so the pipeline can verify origin before any parsing logic runs.
This is where NHI governance becomes operational, not theoretical. If ingestion jobs use service accounts or API keys, those NHIs must be ephemeral and narrowly scoped, because a malicious artifact can exfiltrate whatever the runtime can reach. The same warning appears in the Ultimate Guide to NHIs — Key Research and Survey Results, where poor secret hygiene and excessive privilege are common patterns. Current guidance suggests pairing this with NIST SP 800-53 Rev. 5 Security and Privacy Controls for least privilege and NIST SP 800-53 Rev. 5 Security and Privacy Controls for system integrity and boundary protection, even though there is no universal standard for model-ingestion sandboxing yet. These controls tend to break down when teams import third-party artifacts directly into notebook environments that already have broad workspace credentials, because the execution path and the trust path become the same thing.
Common Variations and Edge Cases
Tighter ingestion controls often increase friction for data science and ML teams, so organisations must balance safety against speed and reproducibility. The hardest edge case is when a workflow truly needs executable logic, such as custom feature transforms, evaluation hooks, or format-specific preprocessing. In those cases, best practice is evolving toward a separated build-and-run model: the artifact is first validated in a disposable environment, then repackaged into a signed, immutable runtime artifact that cannot change its own dependencies during load.
Another common exception is “trusted internal” content. Internal source does not automatically mean safe source, especially when upstream pipelines ingest vendor data, partner models, or community datasets. Guidance from NHI Mgmt Group suggests that trust should follow provenance and policy, not repository location alone, as reinforced by the research summary in the Ultimate Guide to NHIs — Key Research and Survey Results. For security teams, the operational question is whether any ingestion step can reach secrets, network resources, or administrative APIs before verification completes. If the answer is yes, the pipeline is already too permissive, even when the artifact later proves benign.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Untrusted artifacts can steal or abuse NHI credentials during ingestion. |
| OWASP Agentic AI Top 10 | A-04 | Execution-on-ingestion mirrors agentic code execution from untrusted inputs. |
| CSA MAESTRO | GOVERN-03 | Artifact ingestion needs governance, isolation, and provenance checks. |
| NIST AI RMF | AI RMF addresses secure, accountable handling of model inputs and artifacts. | |
| NIST CSF 2.0 | PR.DS-6 | Protecting data at rest and in transit supports safer ingestion boundaries. |
Classify ingestion jobs as NHI-bearing workloads and lock their secrets behind least privilege and short TTLs.
Related resources from NHI Mgmt Group
- What breaks when a workflow engine can execute untrusted code inside the same environment that stores secrets?
- What breaks when model outputs are allowed to execute without review?
- What breaks when users are allowed to execute PowerShell from untrusted prompts?
- What breaks when npm package installs are allowed to execute code before inspection?