There are a number of utilities for this. I use jai: https://jai.scs.stanford.edu/ but also have seen nono: https://github.com/always-further/nono smolvm: https://github.com/smol-machines/smolvm zerobox https://github.com/afshinm/zerobox and matchlock https://github.com/jingkaihe/matchlock
They all have pros and cons. Pick the one that suits you best. Then you're also agent harness flexible (I use opencode).
I would like a solution that was itself not largely written by an AI
As a jai and linux user, myself, looking at nono's os-sandbox (from here [1]) it seems nice too. Thanks for the recommend I was looking for something that might be nice on Mac and nono seems good to recommend to coworkers and the like.
[1]: https://nono.sh/os-sandbox