How can I be sure that bitcoin mining software is not compromised?
cgminer / bfgminer are both open source, get it from the official repository and you can be fairly sure that some geek will have noticed if there's something suspicious! If you're talking about mining some altcoin with a custom hashing algorithm then you have a valid concern.