Skip to content

Bind Guardian reviews to the action's target environment - #47630

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ad3292edddb1c6f5b180142c6857cba6f1308328
Sep 23, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ad3292edddb1c6f5b180142c6857cba6f1308328

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Bind Guardian reviews to the action's target environment

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.

## 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
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ad3292edddb1c6f5b180142c6857cba6f1308328 branch from f7f811f to 851d9e9 Compare September 23, 2026 19:03
@copyberry
copyberry Bot merged commit 851d9e9 into main Sep 23, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ad3292edddb1c6f5b180142c6857cba6f1308328 branch September 23, 2026 19:03
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
@moritzlg
moritzlg deployed to issue-triage September 23, 2026 19:12 — with GitHub Actions Active
@moritzlg
moritzlg deployed to issue-triage September 23, 2026 19:12 — with GitHub Actions Active
@moritzlg
moritzlg deployed to issue-triage September 23, 2026 19:12 — with GitHub Actions Active
@moritzlg
moritzlg deployed to issue-triage September 23, 2026 19:13 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 851d9e95 Deployed Sep 23, 2026 by moritzlg via Identify potential duplicates (open issues fallback) #47792
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.

4 participants