As the proportion of new energy continues to increase, the safety and stability of the new power system are challenged, urgently requiring the allocation of new flexible resources. This paper proposes a two-stage robust capacity optimization model considering flexibility demand constraints. Firstly, the uncertain characteristics of new energy are described, and a model of flexible resource adjustment capacity is established. Then, uncertain parameters are introduced to construct a robust capacity optimization model considering supply-demand balance, solved by column constraint generation algorithm and KKT theorem. Finally, a power system in a certain region of China is selected as the simulation object for empirical analysis to verify the effectiveness of the constructed model. The results show that the two-stage robust configuration optimization model constructed in this paper can address the uncertainty of power system and the flexibility demand brought by new energy, and the planning results can achieve a balance between the safety and economy of the new power system.