codex - 💡(How to fix) Fix Env var allowlist (include) for Codex IDE (VS Code) + Codex app (+ CLI) when inheriting “core” or “none” [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#22023Fetched 2026-05-11 03:20:48
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Code Example

[shell_environment_policy]
inherit = "core"
include = ["MYAPP_*", "CI_*"]          # prefix/glob
# or:
include_regex = ["^MYAPP_", "^CI_"]    # regex

---

[shell_environment_policy]
inherit = "none"
include = ["MYAPP_*", "CI_*"]
# (or include_regex = [...])
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

App, IDE Extension

What feature would you like to see?

Currently, the allowed keys for [shell_environment_policy] do not allow including an env variable that was not included with, say, inherit="core"

Please add a new include / allowlist capability to shell_environment_policy so Codex can inherit only a minimal base environment plus explicitly permitted variables. Variable names are custom and will vary, so this must support prefix/glob and/or regex patterns.

Examples:

[shell_environment_policy]
inherit = "core"
include = ["MYAPP_*", "CI_*"]          # prefix/glob
# or:
include_regex = ["^MYAPP_", "^CI_"]    # regex

Also helpful:

[shell_environment_policy]
inherit = "none"
include = ["MYAPP_*", "CI_*"]
# (or include_regex = [...])

Meaning: with inherit="none", only the allow listed vars are passed.

Additional information

Acceptance criteria:

Only base (core or none) + matched vars are visible to Codex and spawned tools (VS Code extension + Codex app, and ideally CLI for consistency).

Deterministic and auditable; supports empty include (pure core-only / none-only).

Clear precedence if an exclude option is also present.

Business impact: Without this, users must choose between “too locked down to work” and “full inherit that risks leaking unrelated secrets,” which blocks compliant environments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Env var allowlist (include) for Codex IDE (VS Code) + Codex app (+ CLI) when inheriting “core” or “none” [1 participants]