The spread of many infectious diseases relies on aerosol transmission to the respiratory tract. Here we design an intranasal mask comprising a positively-charged thermosensitive hydrogel and cell-derived micro-sized vesicles with a specific viral receptor. We show that the positively charged hydrogel intercepts negatively charged viral aerosols, while the viral receptor on vesicles mediates the entrapment of viruses for inactivation. We demonstrate that when displaying matched viral receptors, the intranasal masks protect the nasal cavity and lung of mice from either severe acute respiratory syndrome coronavirus 2 or influenza A virus. With computerized tomography images of human nasal cavity, we further conduct computational fluid dynamics simulation and three-dimensional printing of an anatomically accurate human nasal cavity, which is connected to human lung organoids to generate a human respiratory tract model. Both simulative and experimental results support the suitability of intranasal masks in humans, as the likelihood of viral respiratory infections induced by different variant strains is dramatically reduced.