Skip to content

Only load config from trusted folders#9533

Merged
gt-oai merged 1 commit intomainfrom
gt/only-load-trusted-config
Jan 20, 2026
Merged

Only load config from trusted folders#9533
gt-oai merged 1 commit intomainfrom
gt/only-load-trusted-config

Conversation

@gt-oai
Copy link
Contributor

@gt-oai gt-oai commented Jan 20, 2026

Config includes multiple code execution entrypoints.

Now, we load the config from predetermined locations first (~/.codex/config.toml etc), use those to learn which folders are 'trusted', and only load additional config from the CWD if it is trusted.

@gt-oai gt-oai marked this pull request as ready for review January 20, 2026 13:22
@gt-oai gt-oai force-pushed the gt/only-load-trusted-config branch from 9a05169 to b69256b Compare January 20, 2026 14:41
Copy link
Collaborator

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this to the doc website as well

let project_root = find_project_root(&cwd, &project_root_markers).await?;
let project_layers = load_project_layers(&cwd, &project_root).await?;
layers.extend(project_layers);
if let Some(project_root) =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should send a warning to the user instead of silently ignoring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will print a warning iff you have CWD / git repo codex config AND the folder is untrusted (will do in a follow up)

@gt-oai gt-oai merged commit 7351c12 into main Jan 20, 2026
32 checks passed
@gt-oai gt-oai deleted the gt/only-load-trusted-config branch January 20, 2026 15:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2026
@xl-openai
Copy link
Collaborator

FYI this PR has some side effect for skill discovery.

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.

3 participants