(To a Golarion native, this might seem almost negligent in how limited the magical defences are. Where are the permanent Forbiddances, the Guards and Wards? There are a few reasons for this:
First, the threat model: Korvosa is a city-state, one that controls some valuable trade routes, but it is also remote, loosely affiliated with Cheliax and with no rival powers that could launch a land war against it. From the founding of the settlement, the main dangers have been raids by the Shoanti, internal strife, conflict with Cheliax, and a dragon attack. Otyughs and reefclaws have probably killed more citizens than any would-be conquerors. Layering magical defences on top of the mundane fortifications would hinder few of the potential attackers except Cheliax, and so for most of the city's history investing in such protection would only have invited more trouble by signalling an intent to break away from the empire.
Second, the spellcasters: The Acadamae has the expertise to provide those kinds of wards, as exemplified by the Breaching Festival, but its relationship with the crown is one of cordial distance. To call on the wizards to ward the structure would both put the crown in their debt and at the same time provide them with privileged access to the whole building. For all that the headmasters have had little interest in ruling beyond the Acadamae walls, it would be hard for them to resist that kind of opening to install a backdoor in the defences through which to depose any monarch acting against their interests afterwards.
Third, the decision-makers: The kings and queens of Korvosa are not known for their long lives, the legendary Curse of the Crimson Throne that ensures none of them die of natural causes or sire an heir remaining unbroken. Under such circumstances, when one's demise seems an inevitability, why spend a fortune on spells that may never be needed in one's lifetime when that same fortune could be spent on living lavishly? Not only that, but the city charter grants complete control over the pyramid and any structures built atop it to the seneschal, not the monarch, adding an extra layer of political friction to the efforts of any far-sighted royals.)