Electronic Health Records (EHRs) have revolutionized modern healthcare by providing comprehensive digital repositories for patient data. The use of deep learning and the emerging foundation models has further enhanced the potential of EHRs, enabling high-precision tasks in digital medicine. However, modeling EHR data to effectively support clinical decision-making is susceptible to both adversarial attacks and privacy breaches. The project’s novelties are its focus on addressing adversarial robustness and privacy concerns in modern EHR systems by tackling two key challenges: (1) the complex correlations in EHR data, including cross-feature, temporal, and cross-modality correlations, and (2) the security and privacy vulnerabilities introduced by the increasing use of pre-trained models in healthcare. The project's broader significance and importance are in safeguarding patient data and enhancing the overall security and privacy of medical infrastructures. The project’s intellectual contributions include a comprehensive framework of attack strategies to assess system vulnerabilities and defense mechanisms to enhance robustness and privacy. Specifically, it explores: (1) robustness with adversarial attacks and defenses that leverage EHR data correlations, as well as backdoor attacks exploiting pre-trained models and defenses utilizing test-time model fine-tuning; (2) privacy with partial knowledge attacks that exploit data correlations and countermeasures for both partial