Hamas doesn’t need to do anything. All they have to do is say nobody’s getting out, which means the IDF can assume anyone running towards the exit is a terrorist making an attack. I think any foreign nationals that would ever travel to Gaza know better than to approach Israeli forces for help.
If there’s anyone that doesn’t want the outside world to know what’s up, ask the folks who recently cut off internet access to Gaza. Who was it? It wasn’t Hamas.