Hydroxyapatite nanoparticles (HAP NPs) are blended with TiO2 NPs to prepare mixed mesoporous scaffolds which are used to prepare high efficiency perovskite solar cells (PSCs) with a best power conversion efficiency (PCE) of 20.98%. HAP not only increases the PCE but also limits the concentration of Pb released in water from intentionally broken PSCs by ion sequestration thereby potentially offering a promising in-device fail-safe system.