fix: trust-gate project hooks and exec policies#14718
Merged
viyatb-oai merged 33 commits intomainfrom Apr 18, 2026
Merged
Conversation
bc1c282 to
3b7e933
Compare
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
# Conflicts: # codex-rs/core/src/tasks/review.rs
# Conflicts: # codex-rs/core/src/codex_tests.rs # codex-rs/core/src/config/mod.rs # codex-rs/core/src/config_loader/mod.rs
# Conflicts: # codex-rs/core/src/config/mod.rs
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Keep canonical project trust keys first so persisted trusted project entries keep their existing lookup shape while still matching symlink aliases. Use the per-thread derived config for app-server thread-initialized analytics and isolate app-server integration subprocesses from host managed config by default. Co-authored-by: Codex <noreply@openai.com>
Use the production project trust key helper in hook trust tests and normalize the migrated project expectation so Windows canonical path handling matches runtime behavior. Co-authored-by: Codex <noreply@openai.com>
Session-start hook discovery is disabled on Windows, so trust-loading assertions for hooks are not meaningful there. Keep the cross-platform project trust normalization regression covered separately. Co-authored-by: Codex <noreply@openai.com>
The session-start hook trust-loading assertions depend on hooks.json lifecycle hook discovery, which is intentionally disabled on Windows. Mark the two coverage tests ignored there so Windows CI stops expecting handlers that cannot load.\n\nCo-authored-by: Codex <noreply@openai.com>
Contributor
|
Hey ok, thanks your patience -- I've reviewed this as best as I could, and it looks good though a few notes:
Before this PR, the lookup had a clear rule:
This PR changes that into:
That sounds tidy, but it creates a collision problem. If config contains two entries that alias the same repo and disagree, both write to the same normalized key. One overwrites the other If /tmp/link-to-repo resolves to /work/repo, the new code can collapse both onto the same lookup key. Now the effective answer becomes “whichever entry won the overwrite,” instead of a defined policy. |
Collaborator
Author
|
Thanks for the detailed pass. I agree with the notes.
I will patch those before merge. |
Re-enable hook discovery on Windows so the trust-gating tests cover the real behavior instead of skipping it. Avoid alias-expanded project maps that can let a configured symlink alias satisfy the canonical project lookup; keep exact/case-normalized matching deterministic instead. Co-authored-by: Codex <noreply@openai.com>
eternal-openai
approved these changes
Apr 13, 2026
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.codexlayers consistently, including repos that have.codex/hooks.jsonor.codex/execpolicy/*.rulesbut no.codex/config.tomlSecurity
Before this change, an untrusted repo could auto-load project hooks or exec policies from
.codex/as long asconfig.tomlwas absent. This makes trust the single gate for project-local config, hooks, and exec policies.Stack
Test