I married Lydia and since she's also a follower, I occasionally give her weapons and armor for use when we're adventuring. Does the game keep track of the difference between things I sell her (I.e. "What have you got for sale?" Option) vs things I place in her inventory? ("I need to trade some items with you.") When I put items in her inventory, I noticed some showed up for sale in her store, but when I sold her items, they simply disappeared.
From the UESP Marriage article.
You don't need to worry about losing items by placing them in your spouse's inventory because they sold them to someone. Like all merchants in the game, they will actually only sell things to you, and not other people.
Well, since you are the only actor in the game capable of trading with a merchant, the best way to make sure she doesn't sell the items you want her to keep is to not buy them.