Vacuum-annealed semiconducting single walled nanotubes are n-type, but become p-type when exposed to ambient air. Here we present evidence that this effect arises from pinning of the Fermi energy by the four-electron oxygen redox couple in an adsorbed water film, a type of surface transfer doping. The pronounced electrical sensitivity to O 2 , O 3 , NO 2 , SO 2 , NH 3 and HNO 3 vapors results from electron exchange between the redox couple and the nanotube. This effect must be considered when using nanotubes for any application in humid air. We also suggest that changes in the electrical properties of graphene and multi-walled nanotubes can be explained by this phenomenon.