Clarify the interaction between `allow_login_shell` and `shell_environment_policy` in documentation
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- shell
- Domain
- documentation
Research direction
Start with the shell_environment_policy section at developers.openai.com/codex/config-advanced#shell-environment-policy and read the nearby allow_login_shell documentation. Add a concise note explaining the initial environment, login-shell profile loading, and possible reintroduction of filtered variables; verify the rendered page makes this interaction clear.
Written by the indexing model from the issue text.
Description
What is the type of issue?
Documentation is confusing
What is the issue?
Description
While configuring shell_environment_policy, I noticed a potentially confusing interaction with allow_login_shell.
shell_environment_policy is documented as controlling the environment variables passed to subprocesses (for example through inherit, exclude, include_only, and set). However, when allow_login_shell = true — which appears to be the default — commands may be executed through a login shell
In that case, the shell will load user profile files such as:
~/.bash_profile~/.profile~/.zprofile~/.zshrc
These files often contain export statements that modify or introduce additional environment variables. As a result, environment variables that were intentionally filtered out by shell_environment_policy can be reintroduced by the shell profile after the process starts.
For example, even with a restrictive configuration like:
[shell_environment_policy]
inherit = "core"
include_only = [xxx]
users may still observe many additional variables inside the executed shell environment because they are added by the login shell initialization scripts.
Since allow_login_shell = true is the default, this behavior may cause users to believe that shell_environment_policy is not working as expected.
Suggested documentation improvement
It would be helpful if the documentation explicitly described that:
shell_environment_policycontrols the initial environment passed to the subprocess.- When
allow_login_shell = true, the login shell may modify the environment by loading profile scripts. - Therefore, some environment restrictions configured in
shell_environment_policymay appear ineffective if the login shell reintroduces variables. - The above information could be documented to make this behavior clearer to users on https://developers.openai.com/codex/config-advanced#shell-environment-policy
A short note explaining this interaction would help users better understand and correctly configure environment isolation.
Where did you find it?
No response
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100