The best way to protect LEDs is to either seal it completely or leave it exposed to the open air.
In the first case, we need to make sure that the material used to seal the LED is chemically compatible, even at high temperatures, in order to prevent the alteration process. Moreover, we need to pay attention to the encapsulant that will prevent air from penetrating inside, thus favouring the action of the aggressive agents present in the manufacturing process.
The opposite solution is to allow an exchange of air, but this can be done in a residential space or in the streets, allowing air circulation without completely encapsulating the optics. This will exploit the so called “expansion effect”, i.e. the heated LED increases the air pressure that comes out and sucks it in when it cools off. All this is not applicable in industrial spaces, where the expansion effect could suck in toxic substances.
In conclusion, spaces with a concentration of potentially toxic substances require specific LED products.