Conversation
dylan-hurd-oai
approved these changes
May 25, 2026
c341c6a to
f61834b
Compare
1e77d01 to
12e87f5
Compare
viyatb-oai
approved these changes
May 28, 2026
Collaborator
viyatb-oai
left a comment
There was a problem hiding this comment.
lgtm, my only concern is that someone can configure a bad profile that can balloon up the environment context unbounded.
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
Some permission profiles can encode filesystem reads that should remain unavailable to the agent. Before this change, the model-visible context and automatic approval review prompt summarized the effective permissions as a legacy sandbox mode, which can omit permission-profile filesystem entries from escalation decisions.
For example, a profile can grant workspace access while denying a private subtree across every workspace root:
The context window now describes the workspace roots and effective filesystem side of the
PermissionProfiledirectly, with deny entries marked as non-escalatable:Managed requirements can impose the same kind of deny-read restriction:
The automatic approval review prompt also receives the parent turn's denied-read context, so review decisions can account for the active permission profile.
What Changed
<environment_context>, including profile type, filesystem entries, workspace roots, and non-escalatable deny entries.workspace_rootsinTurnContextItemso resumed/replayed context does not have to bind:workspace_rootsthrough legacycwdfallback.Testing
just test -p codex-core context::environment_context::tests::serialize_environment_context_with_full_filesystem_profilejust test -p codex-core context::environment_context::tests::turn_context_item_filesystem_uses_workspace_roots_instead_of_cwdjust test -p codex-core context::permissions_instructions::permissions_instructions_tests::builds_permissions_from_profile_with_denied_readsjust fix -p codex-coreI also attempted
just test -p codex-core; the changed prompt-context tests passed, but the full local run did not complete cleanly in this sandboxed macOS environment due unrelated user-shellCODEX_SANDBOX*expectations and integration-test timeouts.