mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Bind Guardian reviews to the action's target environment (#47630)
## Why Actions targeting a secondary environment could be reviewed with the primary environment's denied-read restrictions. Each review needs the permission context of the environment that owns the action, including when a Guardian session is reused across environments. ## What changed - Carry `environment_id` through environment-scoped approval requests and their planned-action JSON. - Select and label permission context using the target environment, explicitly stating when it has no denied-read paths or globs. - Reject reviews for unavailable target environments and reject environment IDs longer than 256 bytes before Guardian inference, while preserving manual approval routing for oversized IDs. ## Testing Add coverage for `exec_command`, `apply_patch`, and `request_permissions` reviews switching environments while preserving the existing review prefix. Extend tests for environment-specific restrictions, unavailable environments, action serialization, and the 256-byte ID boundary. GitOrigin-RevId: ad3292edddb1c6f5b180142c6857cba6f1308328
This commit is contained in:
@@ -61,6 +61,7 @@ pub(crate) use codex_context_fragments::AdditionalContextDeveloperFragment;
|
||||
pub(crate) use codex_context_fragments::AdditionalContextUserFragment;
|
||||
pub use codex_context_fragments::AnsweredQuestion;
|
||||
pub use codex_context_fragments::ContextualUserFragment;
|
||||
pub(crate) use codex_guardian_context::PermissionContext as GuardianPermissionContext;
|
||||
pub(crate) use codex_prompts::MultiAgentRoleInstructions;
|
||||
pub use codex_prompts::PermissionsInstructions;
|
||||
pub(crate) use compaction_summary::CompactionSummary;
|
||||
|
||||
Reference in New Issue
Block a user