Most respiratory masks are made of fabrics, which only capture the infectious virus carriers into the matrix. However, these contagious viruses stay active for a long duration (~7 days) within the fabric matrix possibly inducing post-contact transmissions. Moreover, conventional masks are vulnerable to bacterial growth with prolonged exposure to exhaled breaths. Herein, we combined violacein, a naturally-occurring antimicrobial agent, with porous nanofiber membranes to develop a series of functional filters that autonomously sterilizes viruses and bacteria. The violacein-embedded membrane inactivates viruses within 4 h (99.532 % reduction for influenza and 99.999 % for human coronavirus) and bacteria within 2 h (75.5 % reduction). Besides, its nanofiber structure physically filters out the nanoscale (<0.8 mu m) and micron-scale (0.8 mu m -3 mu m) particulates, providing high filtration efficiencies (99.7 % and 100 % for PM 1.0 and PM 10, respectively) with long-term stability (for 25 days). In addition, violacein provides additional UV-resistant property, which protects the skin from sunlight. The violacein-embedded membrane not only proved the sterile efficacy of microbe extracted pigments for biomedical products but also provided insights to advance the personal protective equipment (PPE) to fight against contagious pathogens.