Using density functional theory (DFT) calculations, we investigated the adsorption of NH3, NO, CH4, CO2, H2, N2, H2O, and O2 molecules on the (hydrogenated) Si12Au20 cluster with the aim of finding a promising molecular sensor for NH3 and NO detection. The Si12Au20 cluster could be a disposable molecular sensor for NH3 and NO because of its long recovery time (over 3 h). To improve the recovery time, we considered the hydrogenation of Si atoms in the Si12Au20 cluster to reduce the strength of the adsorption of NH3 and NO. The vibrational frequency analysis, molecular dynamics simulations and electronic properties show that the H12Si12Au20 (HSA) structure is highly stable. NH3 and NO are chemisorbed on HSA with moderate adsorption energies and evident charge transfer , while the other molecules are all physiosorbed on HSA. Our results show that the electrical conductivities of HSA will change dramatically due to the adsorption of NH3 and NO molecules. The recovery time of HSA is predicted to be very short at 300 K. To have a comprehensive comparison with the above results, we also considered different coverages of NO or NH3 molecules adsorbed on HSA, and the adsorption of NO and NH3 on the Au32 and Si32 clusters. We found that Au32 and Si32 clusters are not suitable for NO and NH3 detection. We predict that HSA should be a promising gas sensor with high performance for NH3 and NO detection at low coverage for future experimental validation.