There will always be ways to thwart the process, but if thyey are tken care of right away you can fix them. Like maybe keep all first floor windows closed. or some other solution (check window sills at end of day)
Even if you nailed all the windows shut, that wouldn’t help. Students would just open one of the many fire exit doors.
In our school, all the fire exit doors have an alarm that goes off when it is opened. And a camera is trained on each door.
None of that really matters. A kid will open a door, and let someone - or something - in. He’s caught on camera, and the alarm goes off. The kid is called to the office, or is grabbed up by security.
He plays innocent. “I just heard a knock on the door and opened it.” The most the school can do is suspend the kid for a few days. That’s like giving him a short vacation.
And if he smuggled something in, you can be sure it was quickly passed on to somebody else.
The best solution, IMHO, is what I posted at #54.