Mind Blank

(Player's Handbook v.3.5, p. 253)

Level: Sorcerer 8, Wizard 8, Beguiler 8, Blighter 8, Wu Jen 8, Sha'ir 8, Death Master 8, Protection 8, Arborea 8, Fate 8, Liberation 8, Mentalism 8, Mind 8, Trade 8,
Components: V, S,
Casting Time: 1 standard action
Range: Close (25 ft. + 5 ft./2 levels)
Target: One creature
Duration: 24 hours
Saving Throw: Will negates (harmless)
Spell Resistance: Yes (harmless)

The subject is protected from all devices and spells that detect, influence, or read emotions or thoughts.
This spell protects against all mind-affecting spells and effects as well as information gathering by divination spells or effects.
Mind blank even foils limited wish, miracle, and wish spells when they are used in such a way as to affect the subject's mind or to gain information about it.
In the case of scrying that scans an area the creature is in, such as arcane eye, the spell works but the creature simply isn't detected.
Scrying attempts that are targeted specifically at the subject do not work at all.