Contaminant releases in or near a building can lead to significant human exposures unless prompt response is taken. U.S. Federal and local agencies are implementing programs to place air-monitoring samplers in buildings to quickly detect biological agents. We describe a probabilistic algorithm for siting samplers in order to detect accidental or intentional releases of biological material. The algorithm maximizes the probability of detecting a release from among a suite of realistic scenarios. The scenarios may differ in any unknown, for example the release size or location, weather, mode of building operation, etc. The algorithm also can optimize sampler placement in the face of modeling uncertainties, for example the airflow leakage characteristics of the building, and the detection capabilities of the samplers. In anillustrative example, we apply the algorithm to a hypothetical 24-room commercial building, finding optimal networks for a variety of assumed sampler types and performance characteristics. We also discuss extensions of this work for detecting ambient pollutants in buildings, and for understanding building-wide airflow, pollutant dispersion, and exposures.