"Not inside a trusted directory" error when with "--yolo" flag

Resolved 💬 0 comments Opened Dec 3, 2025 by mathymess Closed Jan 23, 2026

What version of Codex is running?

v0.63.0

What subscription do you have?

API Token passed to stdin of codex login (doesn't matter for this ticket)

Which model were you using?

Doesn't matter

What platform is your computer?

Linux 6.14.0-36-generic x86_64 x86_64

What issue are you seeing?

I'm running codex exec in an externally sandboxed environment (docker image) with --dangerously-bypass-approvals-and-sandbox flag (alias --yolo).

I get

[cmd] > Not inside a trusted directory and --skip-git-repo-check was not specified.

and codex exits with code 1.

What steps can reproduce the bug?

Run with --dangerously-bypass-approvals-and-sandbox

What is the expected behavior?

Just runs, skips all checks as documented

Additional information

Adding --skip-git-repo-check works but it shouldn't be necessary since --yolo is documented to Skip all confirmation prompts and execute commands without sandboxing. EXTREMELY DANGEROUS. Intended solely for running in environments that are externally sandboxed

Fixing the doc is also a possible solution

Thank you

View original on GitHub ↗