There are a number of affirmative defenses to a foreclosure claim. One example is lack of standing. That is, if the bank who’s suing you or the company that’s suing you was not a holder of the note … actually holder of the note … at the time they brought the lawsuit, they don’t have standing to bring the claim. There are federal regulations that require truth in lending and if some of those regulations have been violated, you may have a defense.
There’s also a defense based upon equity, that is fairness. Because they’re coming into court trying to take your home, they have to show that their hands are clean, and if they’ve done something that is unfair that induced you to be in that situation, then you have a defense called unclean hands.