Metallic glasses are excellent materials for micromechanical systems, where miniature components involving mechanical contact require control of friction at the microscopic scale. We report on an in-situ study of the structure of oxide films formed upon electrochemical polarization and their role in nanoscale friction on a metallic glass in aqueous environment using atomic force microscopy. The oxide film has a bilayer structure, as revealed by repeated scanning with the tip of an atomic force microscope. The dependence of friction on electrochemical potential reveals the growth mechanism and highlights the role of the oxide films for the frictional response of metallic glasses. The chemical sensitivity of nanotribology studies under electrochemical control contributes to the understanding of corrosion mechanisms on metallic glasses.