How to build defenses against discrimination