  Understanding the spin-relaxation mechanism of single adatoms is an essential
step towards creating atomic magnetic memory bits or even qubits. Here we
present an essentially parameter-free theory by combining \textit{ab-initio}
electronic and vibrational properties with the many-body nature of atomic
states. Our calculations account for the millisecond spin lifetime measured
recently on Fe adatoms on MgO/Ag(100) and reproduce the dependence on the
number of decoupling layers and the external magnetic field. We show how the
atomic interaction with the environment should be tuned in order to enhance the
magnetic stability, and propose a clear fingerprint for experimentally
detecting a localized spin-phonon excitation.
