A number of cards have effects that make you immune to your opponent's Attacks. While there exist other ways of mitigating the impacts of certain attacks, such as trashing incoming junk using Watchtower, cards providing attack immunity completely nullify all types of attack. Such cards are often just called "Moats", in reference to Moat from the base set.
Attack immunity only works against Attack cards if it is in force as the attack is played. In the case of Duration attacks such as Swamp Hag, if your opponent plays their attack before you put attack immunity into effect, you will still suffer the effects of the attack.
Attack immunity only prevents effects of played cards with the Attack type, so it doesn't work on similar effects that are on-gain effects or effects from cards without the Attack type (for example Haunted Castle).
On the other hand, some Attack cards have beneficial effects in addition to their harmful ones, such as Soothsayer, or effects that are usually harmful that might be beneficial in a specific case (e.g., a discard allowing you to discard a Tunnel). Attack immunity blocks all effects of an opponent's Attack card, even if you want to be affected by them. Moat and Shield allow you to choose whether or not to activate them against any given Attack; but the others must be put into effect before you know which if any Attacks are coming, and they protect you from all Attacks while they are in effect whether you want them to or not.
Attack immunity does not prevent you from using Reaction cards that trigger when an opponent plays an Attack card, such as Diplomat or Horse Traders. That is because these cards are not conditional on you being affected by the attack, merely that an Attack card was played.
 List of cards
 Effects that are unaffected by attack immunity
The following cards and card-shaped things resemble attacks or have effects that are usually associated with attacks but do not count as attacks for attack immunity and hence cannot be prevented with attack immunity. This is usually the case because the effects do not have the Attack type, and/or the relevant effect does not occur upon the card being played (rather on the card being gained for example).
Cards in italics have been removed.
- Ill-Gotten Gains
- Noble Brigand (attack immunity works normally when the Noble Brigand is played but not when it is bought)
- Haunted Castle
- Circle of Witches