Back to Articles

Dyana: Sandboxed Runtime Profiling for Untrusted Machine Learning Models and Executables

[ View on GitHub ]

Dyana: Sandboxed Runtime Profiling for Untrusted Machine Learning Models and Executables

Hook

Loading a machine learning model from the internet is functionally equivalent to executing arbitrary code—except most developers treat it like downloading a data file. Dyana was built to make the implicit dangers explicit.

Context

The proliferation of pre-trained models on platforms like Hugging Face has accelerated ML development, but introduced a critical security blindspot. When you load a PyTorch model or unpickle a scikit-learn artifact, you’re executing arbitrary Python code embedded in the serialization format. The same applies to ONNX models with custom operators, JavaScript bundles, or any executable format. Security researchers have demonstrated pickle exploits, model backdoors, and supply chain attacks that weaponize this trust assumption.

Traditional sandboxing tools fall into two camps: heavyweight malware analysis platforms designed for Windows executables (Cuckoo, ANY.RUN) or lightweight Linux containers without behavioral monitoring (Firejail, basic Docker). Neither addresses the specific workflow of validating ML artifacts, where you need to actually execute the model loading process, monitor for malicious behavior, profile resource usage, and capture detailed telemetry—all without risking your host system. Dyana fills this gap by combining Docker’s process isolation with Aqua Security’s Tracee eBPF runtime security tool, creating a specialized sandbox for the model validation and executable analysis use case.

Technical Insight

Sandbox Environment

Submits untrusted file

Selects loader type

Spins up container

Injects file

Executes artifact

Hooks syscalls & events

Captures telemetry

Reports resource usage

Returns analysis

User / Analyst

Dyana Control Layer

Format-Specific Loader

Docker Container

Tracee eBPF Monitor

File Executor

Security Profile

System architecture — auto-generated

Dyana’s architecture is straightforward: it orchestrates Docker containers as disposable execution environments while injecting Tracee to capture low-level system behavior through eBPF (extended Berkeley Packet Filter) hooks. This design choice is significant because eBPF operates at the kernel level without requiring kernel modules or system call interposition overhead, providing visibility into file operations, network sockets, process creation, and security-relevant events with minimal performance impact.

The framework supports multiple “loaders” for different file formats—each loader is essentially a Python module that knows how to safely execute a specific artifact type within the container. The README confirms support for machine learning models, ELF executables, Pickle files, and JavaScript, with the full documentation at docs.dreadnode.io providing the complete loader catalog.

The README provides limited implementation details, but the architecture appears to follow a standard pattern: you provide Dyana with an untrusted file, specify the appropriate loader, and the tool spins up a fresh container, copies the file inside, executes it through the loader, captures Tracee output, and returns a profile. The specific API and workflow details are documented externally rather than in the repository README.

The integration with Tracee is where Dyana becomes particularly powerful for security analysis. Tracee uses eBPF to hook into kernel-level events and can detect suspicious patterns like privilege escalation attempts, unexpected syscalls, container escape techniques, or crypto-mining behavior. While the README mentions “security related events,” the specific telemetry details and event correlation capabilities are documented separately.

The Docker boundary provides process, filesystem, and network namespace isolation. The ephemeral nature of containers means each analysis starts from a clean state—critical when dealing with malware that might persist across executions or detect virtualization through artifacts left by previous runs.

One architectural detail worth noting: Dyana is installed as a standard Python package (pip install dyana), but the actual execution happens inside Docker containers that include the necessary dependencies for each loader type. This means your host system only needs Docker and the Dyana Python client—you don’t need PyTorch, TensorFlow, Node.js, or other runtime dependencies installed locally.

For profiling, the README indicates Dyana tracks “GPU memory usage, filesystem interactions, network requests, and security related events,” though the specific implementation details and data structures are not documented in the repository itself. This behavioral monitoring appears designed for MLOps scenarios where you’re validating models from external sources before deploying them to production.

Gotcha

Dyana’s Linux-only architecture is its most significant limitation. The dependency on eBPF and Docker means you need a Linux host and appropriate permissions to run the containerized analysis. If your development environment is macOS or Windows, you’re running Docker Desktop with a Linux VM anyway, but the performance overhead and complexity increase. This makes Dyana potentially awkward for local development workflows compared to CI/CD integration where Linux runners are standard.

Container escape vulnerabilities represent a real risk when analyzing sophisticated malware. While Docker provides strong isolation for most threats, determined attackers have exploited kernel vulnerabilities, misconfigured runtimes, or eBPF bugs to break out of containers. If you’re analyzing nation-state malware or targeted exploits, Dyana’s container-based isolation might not suffice—you’d want bare-metal air-gapped systems or hardware virtualization with snapshot rollback capabilities. The README doesn’t claim to provide VM-level isolation, but developers evaluating sandboxing solutions should understand this tradeoff.

The documentation situation is also worth noting. The README is minimal, directing users to external documentation at docs.dreadnode.io for critical information like the full loader catalog, configuration options, and API reference. The README provides only basic installation commands and a link to usage documentation. This means you can’t quickly assess capabilities, API design, or configuration options from the GitHub repository alone—you must consult the separate documentation to understand what the tool actually does and how to use it.

Performance overhead from eBPF tracing is generally low, but can become significant for I/O-intensive workloads or applications that make millions of syscalls. Model loading processes that iterate over large datasets or perform intensive filesystem scanning might see noticeable slowdowns compared to native execution.

Verdict

Use Dyana if you’re building MLOps pipelines that ingest models from untrusted sources (third-party repositories, user uploads, partner integrations), conducting security research on serialization exploits, or need to validate executable artifacts in CI/CD workflows with detailed behavioral telemetry. Based on the repository description, it appears particularly valuable when you need both security event detection and resource profiling in a single tool, and you’re already operating in Linux-based infrastructure. The Docker-based approach likely makes it straightforward to integrate into containerized deployment workflows without heavyweight VM orchestration. Skip Dyana if you’re on Windows/macOS without Linux CI infrastructure, need bare-metal performance for production model serving, work in environments where Docker isn’t available or permitted, or you’re analyzing extremely sophisticated threats where container escape is a realistic attack vector. For those scenarios, consider full VM isolation with tools like Cuckoo for malware analysis, or bare-metal profiling with manual instrumentation for performance-critical ML workflows. Note that evaluating Dyana requires consulting the external documentation, as the README provides minimal usage examples or API details.

// ADD TO YOUR README
[![Featured on Starlog](https://starlog.is/api/badge/ai-dev-tools/dreadnode-dyana.svg)](https://starlog.is/api/badge-click/ai-dev-tools/dreadnode-dyana)