If your vehicle is showing key can be removed from the ignition while the engine is still running, here are the most likely causes and the parts you'll need to fix each one.
Years of use, often exacerbated by heavy keychains, wears down the brass tumblers inside the lock cylinder and the cuts on the key itself. This removes the mechanical interference that normally traps the key in the 'Run' position.
A retaining spring, wafer, or pin inside the lock cylinder has snapped or failed. Without this internal component functioning properly, the cylinder cannot secure the key while the engine is running.
If the lock cylinder was recently replaced and re-keyed to match an old, worn-out original key, the installer may have filed the new tumblers down too far, inadvertently removing the key retention feature.