codex can access files outside of the working directory in auto approval mode

Resolved 💬 2 comments Opened Oct 21, 2025 by dasl- Closed Oct 21, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.47.0

What subscription do you have?

enterprise

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

According to the documentation, codex:

Codex will need your approval to work outside the working directory or access network.

However, I observed that when running codex with auto approval mode, it can list files outside of the working directory. For instance, I opened a codex session in /Users/dleibovic/clones/my-repo, and I asked it to list files in /Users/dleibovic/.ssh:

› list the first 3 files in /Users/dleibovic/.ssh


• Ran ls /Users/dleibovic/.ssh | head -n 3
  └ ansible_password.file
    bot_hunter_id_ed25519
    bot_hunter_id_ed25519.pub

─ Worked for 14s ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• First three entries under /Users/dleibovic/.ssh are:

  - ansible_password.file
  - bot_hunter_id_ed25519
  - bot_hunter_id_ed25519.pub

What steps can reproduce the bug?

  1. Run codex in auto approval mode
  2. ask it to list files in a directory that is not within the working directory.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5237
  • #5323
  • #5443

Powered by Codex Action

dasl- · 10 months ago

This seems to be a duplicate of https://github.com/openai/codex/issues/5237

As such, I'm closing this issue.