This paper introduces a leakage-safe evaluation framework for intrusion detection systems (IDS) tailored to Internet of Things (IoT) environments, coupled with a feature selection mechanism driven by the White Shark Optimizer (WSO). Conventional IDS evaluation methodologies frequently suffer from data leakage—arising from improper temporal mixing or cross-device information sharing—which yields unrealistically optimistic performance metrics. The proposed framework enforces rigorous temporal partitioning and device-specific isolation to eliminate leakage risks during model training and assessment. Feature subsets are optimized using the WSO, a bio-inspired metaheuristic that effectively balances global exploration and local exploitation through simulated shark hunting behaviors. Experiments conducted on benchmark IoT intrusion detection datasets such as CIC IoT DIAD 2024 reveal that the approach achieves higher detection accuracy, lower false positive rates, and stronger privacy guarantees compared to standard optimizers and leakage-vulnerable baselines. Ultimately, this method strengthens the trustworthiness and practical deployment potential of IoT security solutions while preserving evaluation integrity.