If only we had a decent capability based OS. Then all processes would have the property you're after. If you want it to be able to write to a disk, dependency inject a disk writing capability. Need to talk to a remote host, provide a handle for just that host.
Don't want these capabilities? Do nothing, that's the default state.
Not associated with the project but have been following the development, https://5bsd.org/ could be a good answer. Kory’s been adding capability enforcement for the Linux APIs on top of BSD kernel (among other cool features).
Fuchsia is an “option”, although it doesn’t support much hardware without writing your own drivers.
Unfortunately, capabilities based OSes, or written in mostly safe systems programming languages aren't by lack of trying.
However outside mainframes and micro-computers, or niche deployments, adoption has been a challenge.