Background: Pseudomonas aeruginosa (PA) and Burkholderia cepacia complex (Bcc), commonly found in the lungs of cystic fibrosis (CF) patients, often produce cyanide (CN), which inhibits cellular respiration. CN in sputa is a potential biomarker for lung infection by CF pathogens. However, its actual concentration in the infected lungs is unknown. Methods and Findings: This work reports observation of CN in the lungs of mice infected with cyanogenic PA or Bcc strains using a CN fluorescent chemosensor (4′,5′-fluorescein dicarboxaldehyde) with a whole animal imaging system. When the CN chemosensor was injected into the lungs of mice intratracheally infected with either PA or B. cepacia strains embedded in agar beads, CN was detected in the millimolar range (1.8 to 4 mM) in the infected lungs. CN concentration in PA-infected lungs rapidly increased within 24 hours but gradually decreased over the following days, while CN concentration in B. cepacia-infected lungs slowly increased, reaching a maximum at 5 days. CN concentrations correlated with the bacterial loads in the lungs. In vivo efficacy of antimicrobial treatments was tested in live mice by monitoring bacteriogenic CN in the lungs. Conclusions: The in vivo imaging method was also found suitable for minimally invasive testing the efficacy of antibiotic compounds as well as for aiding the understanding of bacterial cyanogenesis in CF lungs.