When you stake, your XRD is safe.
When you stake your XRD tokens to a validator node, you send your XRD to the stake() method on a validator component, which is a special type of system component with logic guaranteed by the Radix Protocol itself, not built by any smart contract developer.
The behavior of the validator component which receives the XRD is defined within the Radix Protocol, and its logic can not be modified by node-runners or other users.
The validator component puts those tokens inside its staked pool, and then mints an appropriate quantity of Liquid Stake Units (similar to an LP token, for those familiar with the concept from Uniswap and other DeFi applications). These LSU tokens are sent to you, the staker, and they represent your share of the staked pool. The Radix Wallet recognizes these tokens and shows their current redemption value in XRD.
Additionally, validator components exist in a separate address space which is easily recognizable to both humans and tools, and it’s impossible to put user-created components into this same address space to try to masquerade as a real validator component.