Since there are different part numbers mentioned, I will go with some generic guidelines.
A good starting point would be the HSMI (Handling, Soldering & Mounting Instructions) manual of the product you are interested in (e.g. see BME280's HSMI manual here, you can find it from the product's page or Downloads page on our website).
Our environmental sensors are protected by a metallic lid, but features an opening hole to the environment. Water, dust, vapor phase soldering, cleaning agents, etc. shall not enter this hole and get on the sensor elements. If needed, the hole of the device could be protected against contamination during such processes by some silicone-free protective layer (e.g. kapton tape).
Using a protective vent/membrane in the field is common practice (often achieved at the casing/housing level) and should not significantly impact the measurements. Please avoid total or partial covering of the sensor by any protective material.
For the best performance, integration is key and it is therefore important to consider the HSMI's guidelines (position of the sensor, thermal (de)coupling, dead volume, air flow, etc.).