Detection of potentially hazardous samples