This is EXACTLY why I never use an agent outside of https://github.com/kstenerud/yoloai
I appreciate that you're trying to make Claude Code safer, but the agent really needs to be a lot more restricted in its reach rather than its actions.
The agent should NOT have ANY access to:
- Your ENV
- Your homedir
- The network at large
- ANY other directory on your system
- No, not even your workdir.
The only safe way to use an agent is COMPLETELY isolated by a container or VM, using git semantics to extract its output.
That's the only safe way to use any software that you haven't thoroughly reviewed. But that's not how I use any software.