Strategically placed near every door, window, sewer pipe, and vent the DM put an Antimagic Field device.
I especially like to imagine a druid coming in through the sewer as a rat and having his robes get soaked in poo when he gets popped out of wild shape.
A permanent channel of a spell of that high level I would hope would only be available to the most powerful of people.
Also those things would be so expensive they would be worth stealing!
I personally have two mages at entrances that are taking turns ritual casting detect magic. I guess similar impact, but it’s not on all entrances.
Antimagic field is an eighth level spell with one hour concentration duration; an item that has it on 24 hours a day would easily be a legendary item. People underestimate how powerful a spell it is and suggest spamming it everywhere. Having it on every door, window, sewer pipe, and vent would be massive overkill just to spite wildshape.
And if I were a king in Faerun I would spend my money like that. Fuck them druids.
Hiring monodrones is usually cheaper. They are the simplest Modrons, and they would be perfectly willing to work for a Lawful king (the evil-good axis doesn’t come into play) because it increases the amount of order in the multiverse. But every modron has Truesight.
Hell, maybe hire a whole team of modrons. Monodrones to stand watch at all ingresses, with orders of “raise an alarm if you see any disguised shapeshifter enter through that window / door / arrowslit / whatever”, and duodrones with orders of “patrol the castle and raise an alarm if you see any disguised shapeshifter”.
Thats brilliant.