Melamine on Cu(001) is mechanically unstable under the current of a scanning tunneling microscope tip and can switch among configurations. However, these are not equally accessible, and the switching critical current depends on the bias polarity. In order to explain such rich phenomenology, we have developed a scheme to evaluate the evolution of the reaction paths and activation barriers as a function of bias, which is rooted in the nonequilibrium Green's function method implemented within density functional theory. This, combined with the calculation of the inelastic electron tunneling spectroscopy signal, allows us to identify the vibrational modes promoting the observed molecular conformational changes. Finally, once our ab initio results are used within a resonance model, we are able to explain the details of the switching behavior, such as its dependence on the bias polarity, and the noninteger power relation between the reaction rate constants and both the bias voltage and the electric current. © 2013 American Physical Society.