The foreign diplomats are trying to bribe your city, they can't bribe a few units, only the entire city. I believe that if you have a diplomat who has become an ambassador he will push the level of bribe needed way up meaning its unlikely the AI will be able to afford the bribe. It can also be a good idea to put a diplomat in a stack to make it more difficult to bribe armies.