There are 2 ways of magically gathering information:
Information spells (type: I) that do not require RR's, so there is basically no way to withhold that information from being gathered.
Passive (type P spells) and Utility (Type U) that, if the GM wants it, Could require a RR. The RR here is to determine only if the target of the spell is aware of the information gathering, which is just as bad, or perhaps even worse, as being allowed to resist the spell.
The above speaks about RR's that completely negate the spell effect from taking place; which is not applicable, it seems, to informational spells, so they ALWAYS take place (barring spell failure)
Then there is the Information spell note in the back of the book, spell law, of essence, p98, 15.13:
"The basic attack roll for spells that impart information to
a character should be rolled by the GM. Because a failure
may impart false information to the PC, the player should
not know whether the roll was successful or not. As a rule of
thumb, a mild failure should result in vague or slightly incorrect
information, when any information is received at all. A
severe failure should give misleading or even dangerously
wrong information to the PC."
I like to interprete this as follows: the spell WILL trigger a RR, but a hidden one. This determines how well the spell succeeded. No success (the target succeeds the RR) will impart false information (for example, cast a detect evil and a detect undead at a random skeleton found next to a vase: the Lich is not evil at all, neither undead). Mild success will yield some information: (the Lich is evil, but the degree is not known. Also it might be an undead) I take this to be: the Target failed the RR by 1-25) then every 25 above that the caster will glean more information (Lich is evil to the extreme and is a type 6 undead). So in my opinion, simply following the RAW, there IS a way to avoid detection. Note however that I twist the wording from, mild failure by the caster, to mild success by the target, which I hold to be interchangeable. (And also Mild success by the caster = Mild failure by the target).
Bonuses to this RR would be standard RR bonus vs the realm of the caster. The Basic Attack Roll (BAR) would indicate how powerfully the spell is cast.
I usually bunch together the RR's for detecting the spell and resisting the information extraction, so that gathering false information also alerts the target to information being gathered, and success at gather information will not alert the target, but they could be separate rolls, as indicated by the RAW.