Fortunately for Sunset, she soon realized that this system had a glaring
oversight: internal casting. It was fairly common knowledge among
scholars that it was possible for ponies to cast magic on themselves
without producing a magical aura—indeed, pegasi and earth ponies used
this method almost exclusively. However, it was uncommon among unicorns,
who generally preferred to cast magic on themselves externally, as the
process was identical to all of the other spells they cast on a regular
basis. As a result, magic inhibitors offered no obstacle to internal
magic, if only because nearly all forms of internal magic were useless
to a unicorn making an escape attempt. Or, to put it in simpler terms,
the Equestrian penal system had overlooked shapeshifting.
https://www.fimfiction.net/story/387132/2/manifesto/2-exploration