Unpredictable mechanical deformation in soft actuators leads to device failure and poor precision. Engineering the phase-separated structure of hydrogel-MXene composites enables deterministic control over ion transport and light-to-thermal energy conversion.