The escalating sophistication of cyber threats necessitates innovative detection mechanisms to safeguard digital infrastructures. Dynamic Enclave Partitioning (DEP) emerges as a novel approach, offering real-time isolation and monitoring of suspicious code activities within virtualized environments. DEP's adaptive segmentation enables continuous adjustment of enclave boundaries based on observed behavioral patterns, effectively distinguishing between benign and malicious processes. This methodology enhances detection accuracy by minimizing false positives and provides a robust defense against evolving ransomware tactics. The modular design of DEP facilitates seamless integration with existing security frameworks, extending its applicability beyond ransomware to a broader spectrum of malware threats. Comprehensive evaluation demonstrates DEP's efficacy in identifying and isolating novel ransomware behaviors, showing its potential as a significant component in contemporary cybersecurity strategies.