Network Intrusion Detection Systems (NIDS) are essential for protecting cloud, fog, and edge computing from cyberattacks. With the rapid proliferation of edge devices in the Internet of Things (IoT) ecosystem and their important role in data processing and computing, these devices have become a major target for cyberattacks. Although most of anomaly-based NIDS built with machine learning have shown promise in detecting malicious network traffic, deploying these NIDS models on edge devices remains challenging, mainly because of the limited computational and memory resources of edge devices, their susceptibility to tampering of model parameters, related scalability issues of large NIDS models, and high false-positive rates. To address these challenges, we propose lightweight NIDS that is protected in a multi-enclave Trusted Execution Environment (TEE) architecture. We use neural network unstructured pruning techniques to reduce NIDS model size, and leverage the Keystone Enclave’s multi-enclave TEE architecture to enhance the security and scalability of NIDS. We evaluate the proposed NIDS using the CICIDS 2018 and NSL-KDD datasets and report a 75% reduction for our model’s memory usage without significant impact on detection accuracy.