fix(exec-policy) use is_known_safe_command less#20305
Merged
Merged
Conversation
evawong-oai
approved these changes
Apr 30, 2026
Contributor
evawong-oai
left a comment
There was a problem hiding this comment.
Security review done. I approve this PR.
Non blocking: while reviewing this file I noticed a pre existing issue in exec policy loading. A malformed rules file currently falls back to an empty policy, which can drop explicit rules for the session. This does not look introduced by this PR, and this PR narrows the approval bypass surface, so I would not block this change on it. It should be tracked as a separate follow up.
Research done:
- Reviewed PR 20305 from base f3e0a64 to head 116859a.
- Triage covered the three changed files. The runtime review focused on the exec policy implementation. The test files were used as behavior evidence.
- Confirmed the PR makes known safe command auto allow narrower. Under OnRequest, known safe sandbox escalation now prompts. Under Granular with sandbox approval disabled, it is forbidden.
- Found one Medium reviewed file issue. It appears pre existing and not introduced by this PR.
- Dedupe was skipped because there was one finding. Rerank completed. High severity corruption and RCE validation was skipped because there were no high severity corruption or RCE findings.
- GitHub checks are passing on the current head.
116859a to
227b697
Compare
b3d1147 to
0a9e00a
Compare
dylan-hurd-oai
added a commit
that referenced
this pull request
May 1, 2026
Co-authored-by: Codex <noreply@openai.com>
dylan-hurd-oai
added a commit
that referenced
this pull request
May 5, 2026
Co-authored-by: Codex <noreply@openai.com>
4027374 to
7c62701
Compare
Co-authored-by: Codex <noreply@openai.com>
7c62701 to
d6e4688
Compare
owenlin0
approved these changes
May 11, 2026
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
Restricts behavior of
is_known_safe_commandonly to modes where it is explicitly part of the documented behavior:environment_lacks_sandbox_protectionsAskForApproval::UnlessTrustedNotably, as a result of this, escalations for commands that pass
is_known_safe_commandsare no longer auto-approved in AskForApproval::OnRequest or AskForApproval::Granular.Testing