Skip to content

Configuration for inherited environment variables #3064

@andreagrandi

Description

@andreagrandi

What feature would you like to see?

Today I was trying to use a CLI tool which expects an environment variable to be set, otherwise it cannot work.

I have set an env variable named SENTRY_API_TOKEN in my terminal, but running the tool from inside codex was failing.

I asked codex why this was happening and I got this response:

You're right - sorry for the frustration. 
The shell I run in is an isolated sandbox and does not inherit 
your terminal's environment variables, so I can't see your SENTRY_API_TOKEN 
even though your shell has it set. 
Escalation allows network, but doesn't pass env through.

This behaviour doesn't happen with other agents (like Claude Code, Open Code etc...).

In case you have made this choice for "security", you should at least allows the users to decide if codex should inherit the env variables or not, otherwise many tools won't work.

Are you interested in implementing this feature?

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

CLIIssues related to the Codex CLIenhancementNew feature or requestsandboxIssues related to permissions or sandboxing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions