Recent attacks against cyber-physical systems (CPSes) show that traditional reliance on isolation for security is insufficient. This paper develops efficient assessment and mitigation of an attack’s impact as a system’s built-in mechanisms. We focus on a general class of attacks, which we call time delay attack, that delays the transmissions of control data packets in a linear CPS control system. Our attack impact assessment, which is based on a joint stability-safety criterion, consists of (i) a machine learning (ML) based safety classification, and (ii) a tandem stability-safety classification that exploits a basic relationship between stability and safety, namely that an unstable system must be unsafe whereas a stable system may not be safe. The ML addresses a state explosion problem in the safety classification, whereas the tandem structure reduces false negatives in detecting unsafety arising from imperfect ML. We apply our approach to assess the impact of the attack on power grid automatic generation control, and accordingly develop a two-tiered mitigation that tunes the control gain automatically to restore safety where necessary and shed load only if the tuning is insufficient. Extensive simulations based on a 37-bus system model are conducted to evaluate the effectiveness of our assessment and mitigation approaches.