We build an asymptotically compatible energy of the variable-step L2- \(1_{\sigma }\) scheme for the time-fractional Allen–Cahn model with the Caputo’s fractional derivative of order \(\alpha \in (0,1)\) , under a weak step-ratio constraint \(\tau _k/\tau _{k-1}\ge r_{\star }(\alpha )\) for \(k\ge 2\) , where \(\tau _k\) is the k-th time-step size and \(r_{\star }(\alpha )\in (0.3865,0.4037)\) for \(\alpha \in (0,1)\) . It provides a positive answer to the open problem in Liao et al. (J Comput Phys 414:109473, 2020), and, to the best of our knowledge, it is the first second-order nonuniform time-stepping scheme to preserve both the maximum bound principle and the energy dissipation law of time-fractional Allen–Cahn model. The compatible discrete energy is constructed via a novel discrete gradient structure of the second-order L2- \(1_{\sigma }\) formula by a local-nonlocal splitting technique. It splits the discrete fractional derivative into two parts: one is a local term analogue to the trapezoid rule of the first derivative and the other is a nonlocal summation analogue to the L1 formula of Caputo derivative. Numerical examples with an adaptive time-stepping strategy are provided to show the effectiveness of our scheme and the asymptotic properties of the associated modified energy.