How to prevent actors from spawning in inaccessible areas?

Thanks, can you share the Environment Query graph?