I use sandbox-here for this reason, it's a wrapper around bubblewrap, which works quite well.
Copy the code and adjust it to your liking:
https://github.com/lionkor/sbh
I have a shell alias for it, and use it like
sbh --net pi
for example or sbh --net codex
and maybe add --docker if I expect it to do docker things.This kind of wrapper is much easier to handle and maintain than a completely separate tool for sandboxing agents.