Trusted Yet Flexible: High-Level Runtimes for Secure ML Inference in TEEs
Open Access
- 27 January 2026
- journal article
- research article
- Published by MDPI AG in Journal of Cybersecurity and Privacy
- Vol. 6 (1) , 23
Abstract
Machine learning inference is increasingly deployed on shared and cloud infrastructures, where both user inputs and model parameters are highly sensitive. Confidential computing promises to protect these assets using Trusted Execution Environments (TEEs), yet existing TEE-based inference systems remain fundamentally constrained: they rely almost exclusively on low-level, memory-unsafe languages to enforce confinement, sacrificing developer productivity, portability, and access to modern ML ecosystems. At the same time, mainstream high-level runtimes, such as Python, are widely considered incompatible with enclave execution due to their large memory footprints and unsafe model-loading mechanisms that permit arbitrary code execution. To bridge this gap, we present the first Python-based ML inference system that executes entirely inside Intel SGX enclaves while safely supporting untrusted third-party models. Our design enforces standardized, declarative model representations (ONNX), eliminating deserialization-time code execution and confining model behavior through interpreter-mediated execution. The entire inference pipeline (including model loading, execution, and I/O) remains enclave-resident, with cryptographic protection and integrity verification throughout. Our experimental results show that Python incurs modest overheads for small models (≈) and outperforms a low-level baseline on larger workloads (97% vs. 265% overhead), demonstrating that enclave-resident high-level runtimes can achieve competitive performances. Overall, our findings indicate that Python-based TEE inference is practical and secure, enabling the deployment of untrusted models with strong confidentiality and integrity guarantees while maintaining developer productivity and ecosystem advantages.
Keywords
Funding Information
- European Commission (101120726)
This publication has 17 references indexed in Scilit:
- Secure Multi-Party Computation for Machine Learning: A SurveyIEEE Access, 2024
- ONNXExplainer: an ONNX Based Generic Framework to Explain Neural Networks Using Shapley ValuesarXiv, 2023
- The Risks of Machine Learning SystemsarXiv, 2022
- Extending On-chain Trust to Off-chain -- Trustworthy Blockchain Data Collection using Trusted Execution Environment (TEE)IEEE Transactions on Computers, 2022
- When Machine Learning Meets PrivacyACM Computing Surveys, 2021
- A survey of Intel SGX and its applicationsFrontiers of Computer Science, 2020
- The Top 10 Risks of Machine Learning SecurityComputer, 2020
- Machine Learning Stock Market Prediction Studies: Review and Research DirectionsJournal of International Technology and Information Management, 2020
- A Survey on Homomorphic Encryption SchemesACM Computing Surveys, 2018
- RyoanACM Transactions on Computer Systems, 2017