Antimicrobial drug resistance is a major problem in the prevention and treatment of infectious diseases. For patients on antimicrobial prophylaxis during cancer treatment and organ transplantation, breakthrough infections represent a significant and often unexplained cause of morbidity. Here, in high-risk patients on micafungin prophylaxis, we reveal that heteroresistance, the presence of a phenotypically unstable, low frequency subpopulation of resistant cells (~1 in 10,000), causes breakthrough bloodstream infections by Candida parapsilosis strains that were misclassified as susceptible by standard antimicrobial susceptibility testing. Genome-matched micafungin heteroresistant strains were isolated from the intestinal reservoir prior to invasive disease. To identify heteroresistance, we harnessed whole genome sequence analysis of 118 clinical C. parapsilosis strains and extracted six genetic features into a predictive machine learning model that distinguished heteroresistant strains with high accuracy. These data directly implicate heteroresistance in unexplained prophylaxis failure and highlight a proof-of-principle approach to detect this phenomenon and inform clinical decisions.