An energy paradigm shift has rapidly occurred around the globe. One change has been an increase in the penetration of sustainable energy. However, this can affect the reliability of power systems by increasing variability and uncertainty from the use of renewable resources. To improve the reliability of an energy supply, a power system must have a sufficient amount of flexible resources to prevent a flexibility deficit. This paper proposes a countermeasure for protecting nonnegative flexibility under high-level penetration of renewable energy with robust optimization. The proposed method is divided into three steps: (i) constructing an uncertainty set with the capacity factor of renewable energy, (ii) searching for the initial point of a flexibility deficit, and (iii) calculating the capacity of the energy storage system to avoid such a deficit. In this study, robust optimization is applied to consider the uncertainty of renewable energy, and the results are compared between deterministic and robust approaches. The proposed method is demonstrated on a power system in the Republic of Korea.