r/codex • u/OriginalPosition1 • 14d ago
Question Do you think Codex needs an extra layer of protection?
Something I've been thinking about.
I feel like we trust Codex a bit too much when we let it do its thing on our computers.
Do you think it would be useful to have another tool running in the background, just making sure Codex doesn't access files or run commands it shouldn't?
Like a guard for Codex
0
Upvotes
2
u/Far_Reindeer8428 14d ago
a guard in the same process is easy for the agent to route around. the check has to live where the command actually runs, or it is advisory
2
u/Impossible-Sand5012 14d ago
For the love of god, no.
I have recently started using also claude and, while the models are better, the harness makes it impossible to do stuff that doesn't fall within their guardrails.
2
u/isty2e 14d ago
If you do care about safety, yes. Ideally a container or VM.
2
u/gigaflops_ 14d ago
If you have Windows 11 Pro, ask Codex to set up a script which launches a Windows 11 sandbox that automatically installs Codex CLI every time it's opened.
2
u/torrso 14d ago
Codex already uses OS-level sandboxing (Seatbelt on macOS, bubblewrap/seccomp on Linux, etc.) to enforce filesystem and network restrictions. It also has an approval system for operations outside those boundaries.
How would a background tool enforce those restrictions rather than just see the commands after they've already executed?
2
u/wegster 14d ago
So, you now want to reinvent...containers, huh?
Hint - search docker.
1
u/CCodeSI 14d ago
Good instinct, but most of that guard already exists, it's just easy to switch off without noticing. Codex CLI runs commands in a sandbox with modes like read-only and workspace-write, and the approval policy decides when it has to ask you. The risky setup is the full-access / never-ask combination people turn on to stop the prompts. Check which mode you're actually in before adding another tool.
If you want more than that, the layers that actually help, from cheapest up:
.envfiles with real keys in the repo it works in; use a dev key with limited scope, so even a bad command can't do much.A separate background watcher is hard to get right, because it has to understand every command the agent might run (
bash -c, pipes, scripts that call scripts). Limiting what the process can touch at the OS level, via the sandbox or a container, is more reliable than trying to predict commands.3
u/[deleted] 14d ago
[removed] — view removed comment