If you execute other people's code, at some point you have to decide what it is allowed to reach. Mine should reach nothing: no package registry, no pastebin, no callback to a server that tells it the answer. It should see its own filesystem, its own loopback interface, and the end of the world in every other direction.
The usual answers are all heavy. Run your own Kubernetes with a deny-all NetworkPolicy and now you operate a cluster. Use Firecracker directly and now you operate a fleet. Both are correct and both cost you an ops function you may not want.
What I wanted was the managed thing, where you hand a container to a platform and get told when it exited, with the network removed. Here is how that works on Cloud Run, and the two details that are not in the docs.
The prefix
A Cloud Run Job runs whatever command you give it. So give it a command that drops the network first:






