One of the magic things about bitcoin is that the transaction doesn’t incorporate security mechanisms itself. The security is in the proof of work provided by the miners, and the digital signature on the transaction is put there by end users with keys that they store.