Skip to content

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Sep 25, 2025

This is potentially breaking behavior, as we now actively remove OPENAI_API_KEY from the environment so that subprocesses cannot inherit this value. We make it available within the codebase as a &'static str, but on UNIX, we use mlock(2) to ensure this value remains resident in RAM and is never paged out to disk. (Admittedly, any logic that makes a local copy of this value could still be paged out to disk.)

Removing OPENAI_API_KEY from the environment entails an unsafe use of std::env::remove_var(), so we exercise this logic as part of arg0_dispatch_or_else() to ensure we use it before any threads are created.

Note we make this modification after the checks for codex_linux_sandbox::run_main() and codex_apply_patch::main() to ensure we do not modify the environment in those cases.


Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest
Copy link
Collaborator Author

Abandoning in favor of #4246.

@bolinfest bolinfest closed this Oct 19, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants