a gas separation and detection tool for performing in situ analysis of borehole fluid is described . the tool comprises a sampling chamber for a downhole fluid . the sample chamber comprises a detector cell with an opening . the tool also comprises a gas separation module for taking a gas from the downhole fluid . the gas separation module comprises a membrane located in the opening , a support for holding the membrane , and a sealant applied between the housing and the membrane or support . moreover , the tool comprises a gas detector for sensing the gas .