The Palace of the Sun was like a fortress. Although there weren't many large-scale and visible fortifications surrounding its structure, it was a fact that no one unauthorised could enter or exit the Palace with their lives intact. Through the use of a myriad of ritual formations, artefacts, and a handful of veritable mage powerhouses, the Palace of the Sun was an impenetrable monument that acted both ways.
If it were so easy to escape from the Palace, Shuri would have done so years ago. There are always eyes and ears guarding and observing the goings on in the Inner Palace. The only safe place is within a courtyard which is further guarded by privacy ritual formations that ward off snoopers. Of course, observers can't keep track of everything all the time. In certain instances, there are lapses in surveillance that one can take advantage of. But these gaps are tight and require intimate knowledge of the inner workings of the palace security to exploit thoroughly.