The spell card for Sanctuary on the Spell Compendium has a slight wording problem. Sanctuary is a 1st level abjuration spell found on the Cleric spell list. The Actual wording. You ward a creature within range against attack. Until the spell ends, any creature who targets the warded creature with an attack or a harmful spell must first make a Wisdom saving throw. On a failed save, the creature must choose a new target or lose the attack or spell. This spell doesn't protect the warded creature from area effects, such as the explosion of a fireball.
If the warded creature makes an attack, casts a spell that affects an enemy, or deals damage to another creature, this spell ends.
Roll20's You ward a creature within range against attack. Until the spell ends, any creature who targets the warded creature with an attack or a harmful spell must first make a Wisdom saving throw. On a failed save, the creature must choose a new target or lose the attack or spell. This spell doesn’t protect the warded creature from area effects, such as the explosion of a fireball. If the warded creature makes an attack or casts a spell that affects an enemy creature, this spell ends. It is the last sentence, it only needs the "or deals damage to another creature". This spell is also on the Artificer spell list, if you want to change the tag to include that as well.