I think it's pretty well established that if you cast Sanctuary on yourself, then initiate a grapple, sanctuary is broken because initiating a grapple is a "special melee attack." However, a situation came up that is a little less clear.
If a character has the War Caster feat, a spell focus that is accessible, one open hand, and the ability to cast Sanctuary, can she initiate a grapple with her action, then cast Sanctuary on herself with her bonus action, and have the grappled creature be subject to the effect of the spell?
RAW, only the initiation of the grapple is an attack, after that, the grappled creature simply has the "grappled" condition, and may try and escape the grapple. The grappler in this case doesn't have to make additional special melee attacks to keep the target grappled.
In subsequent rounds, the grappler could do a number of actions (move, cast buffs or healing on the party, take the dodge action, etc) that wouldn't constitute an attack or spell that affects the enemy creature.
One aspect I'm not clear on is when the grappled creature tries to escape. The grappled creature has to succeed on a contested Acrobatics or Athletics against the grappler's Athletics. Would this satisfy the criteria of "mak(ing) an attack or cast(ing) a spell that affects an enemy creature"?
Does this work? Could the grappler maintain the grapple and the effect of Sanctuary in this scenario, as long as the grapple was initiated before the casting of Sanctuary?