In situ Fourier transform infrared (FTIR) reflection-absorption spectroscopy investigations of etching of thin polyimide and poly(methyl methacrylate) films (200-1500Å) in downstream microwave NF3/O2/Ar plasmas are reported. Etch rates and surface chemistry are monitored as a function of gas phase composition, plasma treatment conditions and time. NF3/Ar plasma treatment leads to significant surface fluorination characterized by the formation of aliphatic fluorine compounds (CFx), acyl fluorides, benzoyl fluoride, and polyfluorinated benzene. Addition of oxygen to the etching gas reduces the degree of surface fluorination and modifies the chemical structure. The absorption bands due to CFx structures decrease gradually while polyfluorinated benzene rings and benzoyl fluoride are absent for NF3/O2 mixtures with more than 20% oxygen. The effect of humidity on the plasma-modified polymers is studied by comparing infrared spectra collected in situ with those after air exposure. For NF3/O2 plasma-treated polyimides significant changes are observed while samples fluorinated in NF3 show no changes after exposure to air overnight. The FTIR data are supplemented by XPS analysis.