Drugs can have serious side effects especially on the heart. Current paradigms for drug safety evaluation are costly, lengthy, and conservative, and hinder efficient drug development. We have established an easy-to-use diagram to quickly and reliable stratify the risk of new and existing drugs. We capitalize on recent developments in machine learning and integrate information across ten orders of magnitude in space and time to provide a holistic picture of the effects of drugs, either individually or in combination with other drugs. Our approach identifies a pair of agonist-antagonist ionic currents that dominate arrhythmogenic events. Using Gaussian process classification, we create a single classifier that stratifies safe and arrhythmic regimes for any combinations of these two currents. Our new risk assessment diagram explains under which conditions blocking specific currents can delay or even entirely suppress arrhythmogenic events. We validate our method against single cell experiments and Langendorff perfused hearts subjected to drugs at various concentrations and show that our classifier correctly identifies the risk categories of 23 common drugs. Using machine learning in drug safety evaluation can provide a more accurate and comprehensive mechanistic assessment of the pro-arrhythmic potential of a new drug. Our study shapes the way towards establishing science-based criteria to accelerate drug development, design safer drugs, and reduce heart rhythm disorders.