Researchers have developed novel membranes, whose selectivity can be switched dynamically with the help of light. For this purpose, azobenzene molecules were integrated into membranes made of metal-organic frameworks (MOFs). Depending on the irradiation wavelength, these azobenzene units in the MOFs adopt a stretched or angular form. In this way, it is possible to dynamically adjust the permeability of the membrane and the separation factor of gases or liquids.