Is there a way to affair-proof your relationship? I would say the honest answer is no because people cheat for so many different reasons; however, certain things do help in maintaining a healthy relationship and insulate your relationship from the possibility of an affair. One of them is, of course, good communication strategies and the other one is what I call the three A's: attention, affection, appreciation.
If you express regular attention to your partner, lots of appreciation for all the little things he or she does for you and lots of affection, hand-holding, hugs, there's little reason why your partner would want to cheat on you. Of course, there are people who have personality disorders such as narcissistic personality disorder or have other issues with attachment, intimacy or security that may cheat for their own individual reasons so I never want to tell people that the cheating was their problem or something they caused by their behavior.
I don't want anybody to personalize the affair because there's so many different reasons why someone would seek emotional or sexual intimacy outside of the relationship.